Skip to content
CleanGlyph home

Text Cleaner

Fix messy spacing, line endings and hidden characters in copied text. Safe cleanup is on by default; quotes, dashes, tabs and Unicode only change when you choose.

Your text never leaves your browser.

0 code points · 0 graphemes · 0 linesAnalyzed as you type

Cleaning options

Recommended. Fixes only spacing and hidden characters that are almost never intentional.

Quick cleanup

Turns runs of ordinary spaces between words into one. Leading indentation is kept.

Removes spaces and tabs at the end of each line.

Converts Windows (CRLF) and old Mac (CR) line breaks to LF. The number of lines stays the same.

Removes U+200B only. Zero width joiners and non-joiners are always kept.

Whitespace

Turns U+00A0 into a normal space. NBSP is sometimes intentional, e.g. between a number and its unit.

Turns figure, narrow no-break, ideographic, thin and other fixed-width spaces into a normal space. Also covers NBSP when Replace NBSP is off.

Tabs can matter in code and tab-separated data. Mid-line tabs shrink to one space while repeated spaces are collapsed.

Spaces per tab

Limits runs of empty or whitespace-only lines. Paragraph breaks are kept.

Max blank lines

Removes spaces, tabs and blank lines at the very start and end of the text.

Punctuation

Curly quotes and apostrophes become straight ' and ". Changes the typographic style.

En (–) and em (—) dashes become a hyphen-minus (-). The minus sign and other dashes are kept.

Unicode
Unicode normalization

NFC composes characters such as e + combining accent into é and is recommended for general compatibility. NFD decomposes them. Off unless you choose a form.

Removes U+00AD, invisible hyphenation hints often found in PDF and web text.

Removes U+FEFF inside the text. A byte order mark at the very start is kept.

What Safe cleanup changes

The default options only fix problems that are almost never intentional in copied text. Every change is counted in the change summary, so you can see exactly what happened before you copy the result.

  • Repeated spaces

    Runs of spaces between words become one. Indentation at the start of a line is kept.

  • Line-end whitespace

    Spaces and tabs hiding at the end of lines are removed.

  • Line endings

    Windows CRLF and old Mac CR breaks become LF without changing the number of lines.

  • Zero width spaces and stray BOMs

    U+200B and mid-text U+FEFF are removed. A BOM at the very start stays.

Optional cleanup

These options can change meaning or style, so they are off until you turn them on. The Plain text preset enables all of them at once for spreadsheets, search and ASCII-friendly data: replace nbsp with regular spaces, normalize unicode spaces, convert tabs to spaces, collapse repeated blank lines, trim outer whitespace, normalize smart quotes, normalize en/em dashes, unicode normalization, remove soft hyphens.

  • Spaces and tabs

    Replace NBSP and other Unicode spaces, convert tabs, limit blank lines and trim the ends.

  • Punctuation

    Straighten curly quotes and turn en/em dashes into hyphen-minus for code and plain data.

  • Unicode normalization

    Choose NFC or NFD so the same character is always stored the same way.

  • Soft hyphens

    Remove invisible U+00AD hyphenation hints left over from PDFs and web pages.

What is always kept

Zero width joiners and non-joiners, bidirectional controls, variation selectors, emoji modifiers, combining marks and letters are never removed. They hold emoji sequences together and are required by scripts such as Persian, Arabic and Hindi. When they are present, the tool lists them so you can review them in the Invisible Character Detector. To remove only zero width spaces, use the Zero Width Space Remover; to compare the cleaned text with the original, use the Text Difference Checker. To count words and characters after cleaning, use the Word & Character Counter.

Frequently asked questions

What does this Text Cleaner remove?

With the default Safe cleanup options it collapses repeated spaces between words, trims spaces and tabs at the end of lines, converts Windows and old Mac line endings to standard line breaks, removes zero width spaces (U+200B) and removes byte order marks (U+FEFF) that appear in the middle of text. Everything else, including tabs, non-breaking spaces, quotes, dashes and soft hyphens, only changes when you turn on the matching option.

Does it remove zero-width spaces?

Yes. Removing zero width spaces (U+200B) is on by default. Only U+200B is removed by that option; other invisible characters are left alone.

Does it remove zero-width joiners or non-joiners?

No. Zero width joiners (U+200D) and zero width non-joiners (U+200C) are always kept because emoji sequences and scripts such as Persian, Arabic and Hindi need them. When they are present, the tool lists them so you can review them in the Invisible Character Detector.

Should I replace non-breaking spaces?

Replace them when the text is going into code, data, search or a spreadsheet, because a non-breaking space (U+00A0) does not match an ordinary space. Keep them in documents where they stop a number and its unit, or a name, from splitting across lines. The option is off by default.

What is Unicode NFC normalization?

Some characters can be written in more than one way, for example é as one precomposed code point or as e followed by a combining accent. NFC converts text to the composed form and is the recommended choice for general compatibility. NFD does the opposite. Normalization is off by default, and the change summary reports how many sequences were rewritten.

Can this cleaner change punctuation?

Only if you ask it to. Normalize smart quotes turns curly quotes into straight quotes, and Normalize en/em dashes turns en and em dashes into a hyphen-minus. Both are off by default because they change the style of the text. Other punctuation is never changed.

Is it safe for code or JSON?

Use caution with code, JSON or exact-match data. Even Safe cleanup can change spacing, trailing whitespace, line endings and U+200B characters, so it does not preserve exact source formatting. Review the cleaned output or use the Text Difference Checker when exact text matters.

Is my text uploaded?

No. Cleaning runs entirely in your browser. Your text is not sent to a server, stored, put in the address bar or included in analytics.