Whitespace cleaner

Text copied from PDFs, slides and websites often comes with doubled spaces, broken blank lines and invisible characters. This tool tidies it.

Cleaner

Spaces and lines
Invisible and unusual characters
Leave this off for Urdu, Persian, Hindi and emoji: these scripts use joiners to shape letters and build some emoji.

How to clean up text

  1. Paste the messy text into Messy text.
  2. Check the options. The defaults suit most text copied from PDFs and web pages.
  3. Choose Clean text. The result appears on the right (below on a phone), with a summary of what changed.
  4. Choose Copy result and paste it into your document.

Why invisible characters matter

Some characters take up no space or look exactly like a normal space. A non-breaking space stops a line from breaking. A zero-width space is completely invisible. When they are copied into an essay or a spreadsheet they can split words, stop search and find from working, and make two identical-looking cells fail to match. This tool replaces or removes them.

Line breaks inside paragraphs are kept. If a PDF broke every line in the middle of a sentence, join those lines in your word processor after cleaning.

Worked example

Input, with spaces shown as ·, tabs as [TAB] and the non-breaking space as [NBSP]:

··The···mitochondria[TAB]is·the[NBSP]powerhouse···



of·the·cell.··

Output with the default options:

The·mitochondria[TAB]is·the·powerhouse

of·the·cell.

Runs of spaces became single spaces, the non-breaking space became a normal space, spaces at the ends of lines were trimmed, and four blank lines in a row became one. The tab was kept, because tabs are only replaced when you tick Replace tabs with spaces.

Questions and answers

Will it change my words or punctuation?
No. It only changes spaces, tabs, blank lines and the invisible characters listed in the options.
Why is the tab still there after cleaning?
Tabs are kept unless you tick Replace tabs with spaces, because tabs often separate spreadsheet columns.
Is it safe for Urdu and Arabic text?
Yes, with the default options. Joiners, which these scripts can need, are only removed if you tick that option.