Skip to content
ToolBoxGenie

Text Cleaner

Text Tools · Added 10 July 2026

Text copied out of a PDF, an email client or a web page arrives full of invisible damage — double spaces, hard line breaks mid-sentence, non-breaking spaces, curly quotes and leftover markup. Tick the problems you want fixed and the cleaned text appears immediately.

Cleaning options — applied in order, top to bottom

Cleaned text

Characters in
0
Characters out
0
Removed
0

Every option destroys information, so apply the narrowest fix that solves your problem. Removing all line breaks will flatten poetry, code and anything else where the layout carries meaning.

How to use the text cleaner

  1. 1Paste the messy text.
  2. 2Tick the cleaning options you need — they apply in a sensible order.
  3. 3Review the output and the summary of what changed.
  4. 4Copy the result, or press Swap to run another pass over it.

Examples

Text copied from a PDF

Input
Lines broken every 70 characters with double spaces after full stops
Result
Line breaks joined into paragraphs, spacing normalised to single spaces

Removing markup

Input
<p>Hello <strong>world</strong></p>
Result
Hello world

About the text cleaner

The invisible characters that break things

A large share of 'this file won't import' problems come down to characters you cannot see. Non-breaking spaces, zero-width joiners, byte-order marks at the start of a file, and Windows line endings mixed with Unix ones all look like nothing at all in an editor.

Cleaning them out is usually the fastest diagnostic step available. If a CSV suddenly parses after a whitespace normalisation pass, you have found your culprit without reading a single line of the file.

Clean, but do not over-clean

Every cleaning operation destroys information. Removing all line breaks turns a poem into a paragraph; stripping punctuation makes prose unreadable; collapsing whitespace ruins indentation-sensitive content such as Python or YAML.

Apply the narrowest fix that solves your problem, and keep the original until you have confirmed the result. The Swap button exists so you can layer passes deliberately rather than applying everything at once and hoping.

Frequently asked questions

What is a non-breaking space and why does it cause trouble?
It is a space character that prevents a line break, common in text copied from web pages and word processors. It looks identical to a normal space but is a different character, so searches fail, string comparisons fail and CSV imports split incorrectly. The cleaner converts them to ordinary spaces.
Will stripping HTML remove the content inside tags?
No. Tags are removed and the text between them is kept, so '<p>Hello <b>world</b></p>' becomes 'Hello world'. Script and style blocks are removed entirely, including their contents, since that is never body text.
Why replace curly quotes with straight ones?
Typographic quotes look better in prose but break code, CSV files and command-line arguments. If you are pasting into anything that will be parsed rather than read, straight quotes are safer.