Whitespace & Line-Break Formatter
Fix the invisible mess that copy-paste leaves behind — stray tabs, doubled spaces and rogue blank lines.
Convert separators
What the whitespace & Line-Break Formatter does
Text copied out of a PDF, an email client or a rendered web page carries formatting you cannot see: tab characters standing in for indentation, doubled spaces left over from an older typing convention, non-breaking spaces that look identical to normal ones but break search and sorting, and zero-width characters that some sites insert to defeat scraping. This tool strips all of it.
Six cleaning options run in a fixed order. Invisible characters go first — zero-width
spaces and joiners, byte-order marks, soft hyphens — with non-breaking spaces converted to
ordinary ones rather than deleted, since they usually represent a real space. Tabs are then expanded
to four spaces, line endings normalised to \n, repeated spaces collapsed, and each
line trimmed. Finally, blank lines are either collapsed to a maximum of one or removed entirely.
Separately, four conversion buttons change the structure rather than just cleaning it: join every line into a single paragraph, split a comma-separated list into lines, collapse lines back into a comma-separated list, or join lines with spaces. The comma conversions are the ones that get used most — turning a spreadsheet column into a comma list for a config file, or turning a comma list back into lines so it can be deduplicated or sorted.
The counters show how many characters went in, how many came out and how many were removed, which is a quick way to confirm that a document really was full of invisible junk.
How to use it
- Paste your messy text into the left box — the cleaned version appears immediately on the right.
- Tick or untick the cleaning options until the result matches what you want.
- If you also need to change the structure, press one of the separator conversion buttons, then copy the result.
A worked example
Text copied out of a PDF often arrives like this (the arrows mark a tab and trailing spaces):
The quick brown fox⇥jumps
over the lazy dog.
With the default options it becomes:
The quick brown fox jumps
over the lazy dog.
Press Join all lines into one paragraph and the two remaining lines merge into a single flowing sentence — which is what you usually want when a PDF has hard-wrapped a paragraph at every line of the original page layout.
Frequently asked questions
What are invisible characters and why remove them?
Zero-width spaces, zero-width joiners, byte-order marks and soft hyphens are real characters with no visible width. They break exact-match searches, corrupt CSV imports and make two apparently identical strings compare as different. Removing them fixes bugs that are otherwise very hard to see.
Why convert non-breaking spaces instead of deleting them?
A non-breaking space is a genuine space that simply refuses to wrap. Deleting it would join two words together, so it is converted to a normal space instead — which is almost always the intent when the text is leaving its original layout.
Will it damage code indentation?
It can. Trimming lines and collapsing repeated spaces will flatten indentation, so do not run source code through with those options on. Turn off trim each line and collapse repeated spaces, or use the Minifier if code is what you are working with.
Can I turn a spreadsheet column into a comma-separated list?
Yes — paste the column in and press Line breaks → commas. The reverse button turns a comma list back into one item per line, which is the format the sorter and duplicate remover expect.