What Is a Text Cleaner and When Should You Use One?
A text cleaner is a tool that fixes the formatting of text without changing the words. It works on the parts of a passage you mostly cannot see: extra spaces, line breaks in the wrong places, stray invisible characters, and leftover markup such as HTML tags or Markdown symbols. The sentences that come out are the sentences that went in, minus the mess the source left behind.
You reach for one when text has been copied out of something that imposed its own layout, such as a PDF, a word processor, an email or a chat window, and the place you are pasting it needs plain, consistent text. The Text Cleaner on this site is one example: paste into one box, choose what to fix, press Clean Text, and copy the result from the other box.
What a text cleaner fixes
The problems come in four kinds, and all of them are about characters, not meaning.
| Kind | Typical examples |
|---|---|
| Whitespace | Doubled spaces, spaces at the ends of lines, tabs, non-breaking spaces, runs of blank lines |
| Line breaks | A break at the end of every visual line, words hyphenated across two lines |
| Stray characters | Zero-width spaces, byte order marks, soft hyphens, control characters |
| Leftover markup | HTML tags and entities, Markdown heading, bold and code markers |
Here is a short passage as it might arrive from a PDF. The · marks a trailing space and [NBSP] marks a non-breaking space (U+00A0). In real text you would see neither.
Before
The survey closed on 3[NBSP]March. Results··
will be published in the spring
newsletter.
Contact the office with questions.
After
The survey closed on 3 March. Results will be published in the spring newsletter.
Contact the office with questions.
That result comes from the PDF Copy preset, which reported “1 non-breaking space converted”, “4 line breaks removed” and “3 extra spaces removed”. The nineteen words are untouched. Only the spacing and the breaks have changed.
What a text cleaner is not
It is not a grammar checker, a spell checker, a paraphraser, a translator or a rewriting tool. It will not fix a typo, shorten a sentence, change the tone or improve an argument. If the text went in with a mistake, the mistake comes out, neatly spaced.
It is not a file converter either. The Text Cleaner does not open PDFs or Word documents. You copy the text out of them and paste it in.
That narrowness is the point. Because every change is mechanical, you can predict what will happen and check it afterwards, which is not true of a tool that rewrites.
The nearest a cleaner comes to touching visible text is a handful of optional character swaps: curly quotes to straight ones, dashes to hyphens, a change of letter case, or a find and replace that you define yourself. In the Text Cleaner all of these are off until you turn them on.
How it differs from pasting as plain text
Pasting as plain text removes styling: fonts, sizes, colours, links. It keeps every character, so hard line breaks, doubled spaces and non-breaking spaces all survive. A cleaner starts where plain-text paste leaves off. If styling is your only problem, plain-text paste is enough, and removing formatting from text covers the ways to do it.
Where it saves time
| Where the text came from | What usually goes wrong | A sensible starting point |
|---|---|---|
| A PDF | A hard break at the end of every line, words split by hyphens, uneven spacing | The PDF Copy preset |
| Word or Google Docs, headed for a CMS | Non-breaking spaces, zero-width characters, manual line breaks | The Word / Docs preset |
| A plain-text email | Lines wrapped at a fixed width, extra blank lines | General Clean plus Join wrapped lines but preserve paragraphs |
| A list headed for a spreadsheet | Spaces around values, blank rows, repeated entries | General Clean plus Trim each line, Remove empty lines and Remove duplicate lines |
| Chatbot output or Markdown going into a plain field | #, ** and backticks showing as literal characters |
The AI Formatting preset |
Email catches people out. The mail format standard recommends lines of no more than 78 characters, which is one reason a plain-text message can arrive with a hard break at the end of every line.
Each of these situations, with its fix, appears in the list of common copy-paste formatting problems.
When you do not need one
- One stray space or one bad line break. Fix it by hand. Opening a tool takes longer.
- Only the styling is wrong. Paste as plain text and you are done.
- The layout is the content. In code, indentation can be syntax, as it is in Python and YAML. In poetry, the line breaks are the poem. In ASCII tables and diagrams, columns are aligned with runs of spaces.
That last case deserves care. General Clean leaves indentation at the start of a line alone, but it does collapse repeated spaces inside a line, which is enough to wreck a table drawn with spaces. Any option that joins lines will flatten verse. For text like this, skip cleaning, or turn on only the single option you need, such as Trim line endings.
Choosing settings conservatively
Do the least, look at the result, then add.
- Start with General Clean, the default preset. It touches whitespace only. Words, punctuation, letter case, emoji, URLs, Markdown and HTML are left exactly as they were.
- Press Clean Text and read the summary that appears by the button. It lists only what actually changed, for example “12 extra spaces removed”.
- If a problem remains, add one option from the option cards or from Advanced Cleaning Options, or switch to the preset that matches the source. Once you have cleaned a text, the result updates by itself whenever you change a setting (for text up to 200,000 characters), so change one thing at a time and you will always know which setting caused what.
- Leave off anything you cannot explain. Remove ZWJ / ZWNJ is the clearest case: it can break emoji sequences and text in scripts such as Persian, Arabic and several Indic scripts, so it is off in every preset.
Nothing is processed until that first press of the button, and the original always stays in the Input Text box, so you can compare the two versions or start again.
What to check afterwards
A cleaner is predictable, not infallible. Some of its steps are educated guesses about what the source meant.
- Paragraphs. If you joined lines, confirm that separate paragraphs did not merge and that no heading ran into the paragraph beneath it.
- Hyphenated words. Rejoin words hyphenated across lines is a heuristic that applies only while lines are being joined. It cannot know whether a hyphen at the end of a line belonged to a real compound, so look for words that lost a hyphen they needed.
- Lists and tables. Check that each item is still on its own line and that nothing aligned with spaces has collapsed.
- The counts. Character, word and line counts sit under each box. General Clean changes whitespace only, so the word count should be identical before and after. If you used other options and the count has dropped a long way, something more than formatting went missing.
- The destination. Paste the result where it is going and look at it there.
One more check belongs before you paste anything confidential into any web tool: find out where the text is processed. The Text Cleaner runs in your browser and does not upload what you paste. The guide to whether online text cleaners are private shows how to verify a claim like that for any site.
Sources
- RFC 5322: Internet Message Format — IETF / RFC Editor
This guide was drafted with AI assistance and reviewed by the publisher. See the editorial policy for how guides are written and corrected.