FormatterHQ

Text Cleaner

Clean pasted text in one step: remove invisible characters, straighten curly quotes and dashes, collapse spaces, trim lines and optionally strip HTML.

Input TEXT
Output TEXT
Ready.

How to use the Text Cleaner

  1. Paste the messy text, for example from a word processor, PDF or web page.
  2. Choose the clean-up steps you want: invisible characters, quotes and dashes, spaces, line trimming, empty lines or HTML tags.
  3. Review the cleaned text.
  4. Copy it into your code, spreadsheet or CMS.

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 "Zero​width" 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 &amp;.

Leading and trailing whitespace of the whole text is always removed.

Why invisible characters cause trouble

A zero-width space inside a word makes "Zero​width" 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.

Frequently asked questions

How do I remove zero-width spaces from text?
Paste the text with invisible character removal switched on. Zero-width spaces, joiners, word joiners, byte order marks and soft hyphens are deleted, so words that looked separate but were not will join up.
How do I convert smart quotes to straight quotes?
Keep the straighten quotes and dashes option on. Curly single and double quotes become ' and ", en and em dashes become hyphens, and the ellipsis becomes three periods.
Will the text cleaner break emoji?
Simple emoji are unaffected, but combined emoji such as families or some profession emoji rely on the zero-width joiner. Removing invisible characters splits them into their parts, so turn that option off if your text contains them.
Why do I get errors when pasting quotes into code?
Word processors replace straight quotes with curly ones, and programming languages and shells do not treat curly quotes as string delimiters. Cleaning the text first replaces them with the straight characters the language expects.

Last updated October 3, 2026

Related tools