Clean up pasted text with a text cleaner
Text copied from word processors, PDFs, chat apps and web pages often carries hidden baggage: zero-width characters, curly quotes, non-breaking spaces, doubled spaces and stray tags. This text cleaner removes that baggage in one pass, so the result behaves predictably in code, spreadsheets, databases and search.
Example
Before:
“Smart quotes” — and extra spaces…
[zero-width space]Zero[zero-width space]width characters hide here.
<b>Some HTML</b> too.
After (default options):
"Smart quotes" - and extra spaces...
Zerowidth characters hide here.
<b>Some HTML</b> too.
Notice that "Zerowidth" became "Zerowidth". A zero-width space is removed, not turned into a visible space.
What each option does
- Remove invisible characters – deletes the zero-width space (U+200B), zero-width non-joiner (U+200C), zero-width joiner (U+200D), word joiner (U+2060), byte order mark (U+FEFF) and soft hyphen (U+00AD). It also removes ASCII control characters, except tab, line feed and carriage return.
- Straighten quotes & dashes – ‘ ’ ‚ ‛ and the prime ′ become
'; “ ” „ ‟ and ″ become". En and em dashes become a hyphen, the ellipsis character becomes three dots, and a non-breaking space becomes a normal space. - Collapse spaces – runs of spaces and tabs become a single space.
- Trim lines – removes spaces at the start and end of every line.
- Remove empty lines – deletes blank lines entirely. When it is off, three or more line breaks are still reduced to one blank line.
- Strip HTML tags – removes markup, drops script and style blocks and decodes entities such as
&.
Leading and trailing whitespace of the whole text is always removed.
Why invisible characters cause trouble
A zero-width space inside a word makes "Zerowidth" and "Zerowidth" look identical while comparing as different strings. That breaks searches, deduplication, password fields and code. A byte order mark at the start of a CSV file can end up glued to the first column name. Curly quotes pasted into source code or a shell command cause syntax errors because only straight quotes are recognized.
When not to use every option
- Removing the zero-width joiner splits combined emoji: a family emoji falls apart into separate people. The zero-width non-joiner is also part of correct spelling in Persian and several Indic scripts.
- Collapsing spaces and trimming lines destroys indentation, so do not run code or Python through those options.
- Straightening quotes is right for code and data. Typographically finished prose may be better left curly.
For single jobs there are focused tools: remove extra spaces, remove empty lines, the HTML stripper and remove accents.
Privacy
The processing runs entirely in your browser. The text you enter is not uploaded to a server.