gizmobench

Text Cleaner

Paste the mess on the left and read the cleaned copy on the right, with the list of steps between them in the order they run. Twelve steps, each one a switch: line endings to LF, Unicode normalise, remove invisible characters, no-break spaces to plain spaces, straighten quotes and dashes, tabs to a single space, rejoin hyphenated words, remove line breaks, collapse repeated spaces, trim each line, limit blank lines and remove every space. Beside each switch is the number of things that step changed in your text, so a no-break space or a byte order mark you could never have seen is a count you can read. The text you pasted is never rewritten in place: it stays on the left until you copy or save the result, every step can be switched off, and the order is fixed so the same text and the same switches always give the same answer.

After0 characters

The cleaned text appears here as you type.

Nothing pasted yet.

Every step is optionalNothing is uploadedNo account, no size cap
Steps
9 on
Before
0
After
0
Changes
0

Paste text into the box on the left. It stays there, and the cleaned copy appears on the right.

Steps, in the order they run

Each one is a switch, and the number beside it is what that step changed in your text. The order is fixed and runs top to bottom, because cleaning is not order free: no-break spaces become ordinary spaces before repeated spaces are collapsed, and a hyphenated word is rejoined while the line break is still there to see.

0 to 10
  • Collapse spacesTwo spaces between words
    The quick brown
  • Windows line endingsCRLF, invisible in every editor
    2 line endings changed
  • Curly quotes and dashesStraightened to plain ASCII
    "it's fine" - she said
What you cannot see is what breaks things. A no-break space looks exactly like a space and stops a line wrapping where it should. A byte order mark at the front of a paste turns into a stray character in a CSV. Windows line endings are invisible until a script reads the file and finds a carriage return on every line. Each of those is its own step here, with its own count, so you can tell what was in the text rather than guess.
Accuracy. Each step is listed in the order it runs and counts what it changed, so nothing happens that you cannot see. The original stays on screen until you copy the result, and every step can be switched off.

Common questions

How do I clean up text pasted from a PDF or a word processor?
Start with the Clean up set, which switches on the nine general steps: line endings to LF, Unicode normalise, remove invisible characters, no-break spaces to plain spaces, straighten quotes and dashes, tabs to a single space, collapse repeated spaces, trim each line and limit blank lines. That handles the usual damage: Windows and old Mac line endings, the Unicode line and paragraph separators that word processors emit, curly quotes and long dashes, zero-width spaces, byte order marks and soft hyphens. If the paste also arrived wrapped at a fixed column, switch to the Line breaks set, which runs line endings to LF, rejoin hyphenated words, remove line breaks, collapse repeated spaces and trim each line, so each paragraph lands on one line.
How do I remove line breaks without losing my paragraphs?
Switch on Remove line breaks and leave the paragraph switch ticked. A single break between two lines becomes one space, and a blank line between two blocks is kept as a paragraph break, so a wrapped page turns into one line per paragraph rather than one line in total. Untick it to put everything on a single line. Rejoin hyphenated words runs first: a line ending in a hyphen followed by a lower-case letter is put back together as one word, so a PDF that split hyphenation across two lines reads correctly. A hyphen in the middle of a line, and a capital letter after the break, are both left alone, because those are a real hyphen and a new sentence.
What is a no-break space, and why is it a separate step?
It is the character a word processor or a web page inserts to stop a line wrapping at that point. It looks exactly like an ordinary space and is not one, which is why it survives a search and replace and breaks alignment in a spreadsheet. On this page it has its own switch, along with the narrow, thin and ideographic spaces, and while that switch is off the ordinary spacing steps leave it alone: collapse repeated spaces and trim each line work on spaces and tabs only. The one step that takes it out either way is Remove every space, which removes all spacing of every kind. Switch it on and each one becomes a plain space, counted, and the collapse step can then fold it into its neighbours.
Can I remove all whitespace, or only trim and collapse it?
All three are separate switches and you choose which you want. Trim each line takes the spaces and tabs off the start and end of every line and leaves the middle alone. Collapse repeated spaces turns a run of two or more spaces or tabs inside a line into one space, never into none, so two words are never welded together and the count tells you how many runs were folded. Remove every space is the drastic one: it takes out all spacing, line breaks included, which does run words together. That is what it is for, and the page says so on screen while it is switched on.
What does the Unicode normalise step do?
It rewrites the text in Normalization Form C, which composes a base letter and a following combining accent into the single character that means the same thing. An e followed by a combining acute accent becomes one character, and the compatibility Angstrom sign becomes the ordinary ring-A letter. The count is one for each sequence it recomposed, not one for each character, so a word with one accent reports one change. This matters when text from two sources looks identical but does not compare equal, which is the usual reason a lookup or a duplicate check silently fails.
How do blank lines work, and what is the number next to them?
Limit blank lines keeps at most the number of empty lines in a row that you set, from 0 to 10, and removes the rest, counting each one it removed. Set it to 0 to take out every empty line, or to 1 to keep a single blank line between paragraphs, which is what the Clean up set opens with. A line holding only spaces or tabs counts as blank. A single line break at the very end of the text ends the last line rather than starting an empty one, so a file that ended with a newline still does.
Is my text uploaded anywhere, and is there a size limit?
No, on both counts. Every step runs in your browser, there is no server in this and nothing you paste is sent or logged anywhere. No size cap is imposed, so the practical ceiling is your device's memory rather than a plan: a long paste is cleaned whole, with nothing truncated. Your text and your switches are remembered in this browser alone so they are still here when you come back, and the Start over button above the tool forgets them. If storage is blocked, in a private window for instance, the tool still cleans and simply does not remember.
What happens if I switch every step off?
The page says so and changes nothing: with no step switched on there is nothing to run, so it asks you to switch one on rather than showing you a copy of your own text as though it had done some work. The same is true of the blank-line field: type something that is not a whole number from 0 to 10 and the page says what the field needs while that step is on, and your text on the left is left exactly as you pasted it either way.

Each step is listed in the order it runs and counts what it changed, so nothing happens that you cannot see. The original stays on screen until you copy the result, and every step can be switched off.