Clean text: remove extra spaces and hidden characters

Paste text copied from a website, a PDF, Word or an AI chat and get it clean, with a count of exactly what was removed.

  • Free
  • No sign-up
  • Runs in your browser
clean-text
Quick presets
What to clean

100% private — your text is processed in your browser and never sent to any server.

How it works

Paste your text

Copy it from wherever it came from and paste it on the left. It is cleaned as you type.

Choose what to clean

Pick a preset for Word/web or PDF text, or switch individual options on and off.

Copy the result

Copy the clean text or download it as a file. You also see what was removed.

Why text gets dirty when you copy it

Text that looks perfectly normal on screen often carries things you cannot see. Copying from a web page brings non-breaking spaces that are not the ordinary space your keyboard produces. Text taken from a PDF arrives chopped into short lines that ignore your page width. Content pasted from Word or from an AI chat can include zero-width characters, invisible marks that occupy no space but still count as characters.

The problems hidden characters cause

They are the reason a form rejects a value that looks correct, why a search-and-replace finds nothing, why two identical-looking names do not match in a spreadsheet, and why a script fails on a line that seems fine. The character count is another giveaway: if a text looks 40 characters long but a counter says 43, something invisible is in there.

What each option does

  • Invisible characters removes zero-width spaces, byte-order marks, soft hyphens and directional marks. Zero-width joiners inside compound emoji are kept, so emoji such as families or flags do not break.
  • Odd spaces → normal turns non-breaking and typographic spaces into a plain space.
  • Trim and collapse removes spaces at the start and end of each line and reduces runs of spaces to one.
  • Join lines of a paragraph repairs text broken by page width, which is typical of PDFs, and can rejoin words split by a hyphen at the end of a line.
  • Curly quotes & dashes → plain is useful for code, CSV files and systems that only accept plain ASCII punctuation.

Know what was changed

Below the result you see a count for each kind of change. That is useful on its own: if it reports 12 invisible characters, you have found the reason your text was misbehaving. Everything runs in your browser, so pasting an internal document or a contract is safe.

Frequently asked questions

What are invisible characters?
They are characters that take up no visible space but exist in the text: zero-width spaces, soft hyphens, byte-order marks and directional marks. They are usually added by websites, word processors and AI tools, and they cause form and data errors.
Will this remove the emoji in my text?
No. Emoji made of several parts are joined by a zero-width joiner, and this tool leaves those joiners alone when they sit next to an emoji. Only stray ones are removed.
Why does a PDF paste as lots of short lines?
PDFs store text positioned line by line, not as flowing paragraphs. Use the "From a PDF" preset to join the lines back into paragraphs and repair words split across lines.
Can it break text in languages other than English?
Accents, ñ and non-Latin scripts are untouched. One exception: some languages, such as Persian, use the zero-width non-joiner meaningfully. For those texts, turn off "Invisible characters".
Is my text sent anywhere?
No. The cleaning happens in your browser and nothing is uploaded, so it is fine to use with private or confidential text.
Is there a size limit?
There is no fixed limit. Texts of several hundred thousand lines work fine on a computer; very large ones may be slower on a phone.