Text Cleaner & Formatter
Fix text that arrived broken, stray line breaks, invisible characters, duplicate lines, inconsistent spacing.
In short
Clean pasted text by trimming each line, collapsing repeated spaces, joining lines that were wrapped mid-sentence, and stripping invisible characters such as non-breaking and zero-width spaces.
Last reviewed
Runs entirely in your browser. Nothing you type here is uploaded, stored or logged.
The four kinds of broken text
PDF paste. Every visual line ends in a hard break, because a PDF stores positioned fragments rather than flowing paragraphs. Fix with "join broken lines" plus "collapse repeated spaces".
Email quoting. Forwarded messages arrive wrapped at 72 characters with ">" prefixes and inconsistent indentation. Trim, join and collapse handles most of it.
Word processor output. Smart quotes, em dashes, non-breaking spaces and occasionally invisible formatting marks. Fine in prose, fatal in code, CSV files and URLs. "Normalise punctuation" and "strip invisible characters" between them fix it.
Merged lists. Data pasted from several sources, with duplicates, inconsistent case and stray bullets. Dedupe, sort and strip leading numbers.
Invisible characters, and why they cause chaos
Text often carries characters you cannot see but software can. The usual suspects:
- Non-breaking space (U+00A0): looks exactly like a space, does not match a space in search or code.
- Zero-width space (U+200B): invisible, breaks string comparison and can silently split a word.
- Byte order mark (U+FEFF): the leading character that ruins the first field of a CSV import.
- Directional marks (U+200E / U+200F): picked up from bidirectional text.
- Soft hyphen (U+00AD): invisible unless the line wraps there.
These explain the maddening cases where two strings look identical and refuse to match. Stripping them is on by default.
Joining lines without destroying paragraphs
"Remove all line breaks" flattens everything to a single line, which is rarely what you want.
"Join broken lines" is smarter: it merges lines that were clearly wrapped mid-sentence while keeping breaks that separate paragraphs, identified by a blank line between them. That preserves structure while fixing the wrapping, the right choice for PDF and email paste.
Deduplicating a list properly
Duplicate removal keeps the first occurrence and drops later ones, preserving order. Combine with sorting to group similar entries together first, which makes near-duplicates visible.
One thing it can't do: catch near-duplicates. "john@example.com" and "John@Example.com" are different strings even though they're the same mailbox. Lowercase the list first if that matters, and remember that trailing whitespace makes two otherwise identical lines distinct. Which is why trimming runs before deduplication here.
Order of operations
Operations run in a deliberate sequence, because the order changes the result:
- Character normalisation, quotes, invisible characters, accents, emoji
- Tabs to spaces
- Trim each line
- Collapse repeated spaces
- Strip leading numbers and bullets
- Join or remove line breaks
- Remove blank lines
- Deduplicate
- Sort or reverse
Trimming before deduplication is the important one, otherwise two identical lines with different trailing whitespace survive as separate entries.
Nothing leaves your browser
Every operation runs locally in JavaScript. That matters here more than for most tools, because the text people need to clean is frequently the text they least want to upload: client lists, contract drafts, exported customer data, unpublished writing.
Frequently asked questions
How do I remove line breaks from copied text?
Turn on "join broken lines". It merges lines that were wrapped mid-sentence, the usual result of copying from a PDF or an email. While preserving genuine paragraph breaks, which are marked by a blank line. Use "remove all line breaks" only if you want everything on one line.
Why does text pasted from a PDF break badly?
PDFs store text as positioned fragments rather than flowing paragraphs, so every visual line ends with a hard break. Pasting brings those breaks with it. Joining broken lines and collapsing extra spaces fixes most of it; hyphenated words split across lines usually need a manual pass.
What are smart quotes and why remove them?
Curly quotes (" ") and em dashes that word processors insert automatically. They look better in prose but break code, CSV files, URLs and some databases. The "normalise punctuation" option converts them to plain ASCII equivalents.
Can it remove duplicate lines?
Yes, and it preserves the first occurrence of each. Useful for deduplicating email lists, tidying exported data, or cleaning a list you have pasted together from several sources. Combine it with sorting to see what you actually have.
Is my text sent anywhere?
No. Every operation runs in your browser. Nothing is uploaded, stored or logged, which makes it safe for confidential documents, client data and unpublished work.