Home › Guides › Clean Up Text

How to clean up messy copied text

Fix the mangled formatting you get when copying from PDFs, emails, and spreadsheets — in one click.

Copy a paragraph out of a PDF and you get a line break at the end of every visual line. Copy from a spreadsheet and you get duplicates and stray tabs. Copy from email threads and you get doubled spaces and blank-line noise. The Toolsfully clean-up tool fixes all of these at once — you tick what to fix, it does the rest, and your text never leaves your browser.

Step-by-step

  1. Open the Clean Up tool. Go to Text Tools and select the Clean Up tab.
  2. Paste the messy text. Straight from the PDF, email, or spreadsheet.
  3. Tick the fixes you want. Trimming line edges and collapsing repeated spaces are on by default; add removing blank lines, removing duplicate lines, or joining everything into one paragraph as needed.
  4. Clean, then copy. Click "Clean up", review the result, and use Copy or Download .txt.
Clean-up runs entirely in your browser — paste anything, from contracts to code, without it going anywhere.

Tips

The characters you cannot see

Text copied out of a web page, a PDF or a word processor frequently arrives carrying characters that have no visible width at all. The zero-width space, the zero-width non-joiner, the soft hyphen and the byte order mark are the usual suspects, and each of them is a real character that string comparison, sorting and search will honour even though nothing about the text looks different.

The symptom is always the same shape: two strings that are visibly identical refuse to match, a lookup fails against a value you can read on the screen, or a name sorts into the wrong place. Soft hyphens are the most common by a distance, because word processors insert them to control line breaking and they survive a copy. Stripping the invisible characters is usually the entire fix, and it is worth doing to any text that arrived from somewhere else before you rely on it matching anything.

Smart punctuation is right until it is not

Word processors substitute typographic punctuation as you type: straight quotes become curly ones, two hyphens become an em dash, three dots become an ellipsis character. In prose this is correct and makes the text look properly set.

It becomes a problem the moment the text is not prose. A curly apostrophe in a code snippet is a syntax error, because it is not the apostrophe the language expects. A curly quote in a CSV is not a quote character, so a field containing a comma is no longer protected by it. An em dash pasted into a command line is not a hyphen and the flag will not parse. None of these announce themselves — the character is right there and looks approximately correct.

So the direction of the conversion depends entirely on where the text is going. Heading for a document, keep the typography. Heading for a terminal, a spreadsheet, a config file or a code block, flatten it to plain ASCII punctuation first.

Frequently asked questions

What order do the fixes run in?

Trim, then collapse spaces, then remove duplicates, then remove blank lines, then join — so the options compose predictably.

Will it change my words?

No — it only touches whitespace and duplicate/blank lines. Spelling, punctuation, and casing are left exactly as pasted.

Is pasted text private?

Yes. Everything runs locally in your browser and is gone when you close the tab.

Open the Clean Up tool →