Text Cleaner
Clean pasted text by removing messy spacing, weird line breaks, and hidden characters.
Runs in your browser
Paragraph breaks are kept, while broken lines inside each paragraph are merged.
What is a text cleaner?
Text Cleaner repairs text copied from PDFs, Word files, web pages and chat apps. It removes invisible zero-width characters (U+200B to U+200D and U+FEFF), turns non-breaking and other Unicode spaces into normal spaces, collapses repeated spaces and tabs, and joins lines that break mid-sentence while keeping paragraphs and list items. It runs in your browser and can keep paragraph breaks, merge everything into one paragraph, or put each sentence on its own line.
Use cases
- Rejoin text copied from a PDF where every line ends with a hard line break
- Strip hidden zero-width spaces that make identical-looking words fail a search, a spreadsheet match or a login field
- Put each sentence of a transcript on its own line for subtitles, a script or speaking practice
- Clean a snippet pasted from a web page or Word in Keep formatting mode, so the styling stays but the stray spacing goes
When to use?
Use it whenever pasted text has broken lines, double spaces or invisible characters. It only changes spacing and line breaks, so it does not fix spelling, change case or remove duplicate lines; to count words afterwards, use Text Counter. Do not use it on code or poetry, because it collapses indentation and may join short lines.
Examples
Join lines broken by a PDF
Input
The quarterly report shows that revenue grew by twelve percent, mainly because of strong sales in the second half of the year.
Output
The quarterly report shows that revenue grew by twelve percent, mainly because of strong sales in the second half of the year.
Remove extra spaces
Input
Our office will be closed on Monday. We will reopen on Tuesday at 9 AM.
Output
Our office will be closed on Monday. We will reopen on Tuesday at 9 AM.
Questions and answers
Will it remove my paragraph breaks?
No. Blank lines between paragraphs and list items are kept. Only lines that break in the middle of a sentence are joined.
Which hidden characters does it remove?
Zero-width spaces and similar invisible characters are removed, and non-breaking spaces and tabs become normal spaces.
Does it change my words?
No. It only changes spaces and line breaks, including stray spaces before punctuation. Spelling, punctuation marks and capitalization stay as they are.
Does it work with Chinese, Japanese or Thai text?
Yes. These scripts do not put spaces between words, so when a line breaks inside them the tool joins the lines directly instead of adding a space.
Why did my code lose its indentation?
The cleaner collapses repeated spaces and tabs and trims each line, which is right for prose but removes the indentation that code depends on. Keep code out of the input, or paste it back in after cleaning.
Sources and standards
Related tools
All ToolsText Counter
Count words, characters, and lines in your text
TextImage to Text
Extract text from images and screenshots with OCR, right in your browser
PhotoText to Speech
Convert text to speech with sentence-by-sentence playback. Choose a voice and click any sentence to play from there.
TextJSON Formatter
Format and validate JSON data
Formatting