Text Cleaner — Remove Extra Spaces & Empty Lines
Updated Free mock REST & WebSocket APIs
Paste messy text from a PDF, web page, email or spreadsheet and tick the fixes you need: remove extra spaces and empty lines, trim each line, convert smart quotes, strip HTML tags, and remove emoji or invisible zero-width characters. The cleaned text updates instantly.
🔒 Runs in your browser — nothing you paste is uploaded.
How to clean up text
- Paste your text or open a file.
- Tick the cleanups you want. The most common ones (trim lines, collapse spaces, at most one blank line, remove invisible characters) are on by default.
- Copy the result, or click Use as input to run more cleanups on it.
What each option fixes
- Collapse repeated spaces: “too many spaces” becomes “too many spaces”. It's common in text copied from PDFs or justified layouts.
- Trim spaces: removes spaces at the start and end of every line, which often cause failed matches in spreadsheets.
- Max one blank line / Remove all empty lines: tightens text with large gaps, or turns it into a clean one-item-per-line list.
- Remove line breaks: joins lines into one paragraph. The remove line breaks tool can also keep paragraph breaks.
- Remove zero-width & non-breaking spaces: deletes invisible characters (U+200B, BOM, soft hyphens) that break searches, code and URLs, and turns non-breaking spaces into normal ones.
- Smart quotes → plain: converts ‘ ’ “ ” – — … to ' " - ... for code, CSV files and SMS.
- Strip HTML tags: keeps the text of copied HTML, turning paragraphs and <br> into line breaks and decoding common entities like &.
Options run in a fixed order: HTML, invisible characters, quotes, emoji, punctuation and numbers first, then spaces, trimming, joining and empty lines, so the result is the same whichever boxes you tick first.
Related tools
Embed this tool on your site
Browse all embeddable tools →Free for blogs, HR, payroll and contractor sites: copy one snippet — the widget sizes itself and matches your colors.
Get the embed code
Frequently asked questions
Is my text uploaded anywhere?
No. Everything runs in your browser, so your text never leaves your device. Nothing is logged or stored on a server.
How do I remove double spaces after periods?
Keep 'Collapse repeated spaces' ticked. Every run of spaces, including two spaces after a period, becomes a single space.
Why does my text have invisible characters?
Zero-width spaces and joiners come from websites, chat apps and word processors. They can't be seen, but they break searches, formulas and code. 'Remove zero-width & non-breaking spaces' deletes them.
Will removing punctuation remove apostrophes?
Yes, it removes all punctuation including apostrophes and hyphens, but keeps @ # $ % & + = < > so emails, hashtags and prices stay readable.
Your business here? Sponsor this tool from $16/week. See placements