← Text

Text Cleaner

Strip HTML, collapse whitespace, fix smart quotes, remove line breaks and hidden characters, and see exactly what changed.

Text and options

Structure

Remove

Whitespace

Presets

Cleaned text

Change
–

      

Before and after

MeasureBeforeAfterChange

About this tool

Text Cleaner tidies text copied from web pages, Word documents, PDFs, emails, and chat apps. Tick the fixes you want and the cleaned version appears immediately: strip HTML tags and decode entities such as & and  , collapse runs of spaces and tabs, trim each line, drop empty lines, unwrap hard line breaks so paragraphs flow again, convert curly quotes, dashes, and ellipses to plain ASCII, delete zero-width and other invisible characters that break search and code, and optionally remove URLs, emoji, numbers, or punctuation. Unicode NFC normalization merges decomposed accents into single characters. A before-and-after table shows character, word, line, and byte counts so you can see exactly what changed. It is useful for editors preparing copy for a CMS, developers cleaning data before import, and anyone pasting text into a form that rejects hidden characters.

How it works

The selected steps run in a fixed order so they do not undo each other: HTML stripping first (script and style blocks are dropped with their content, block-level closing tags become line breaks, remaining tags are removed, and named, decimal, and hexadecimal entities are decoded), then removal of zero-width and control characters (U+200B to U+200F, U+2060 to U+2064, U+FEFF, soft hyphens, and C0/C1 controls other than tab and newline), NFC normalization, smart-punctuation replacement (single and double curly quotes, primes, en and em dashes, minus signs, ellipsis, and non-breaking spaces), then URL, emoji, number, and punctuation removal. Emoji are matched with the Unicode Extended_Pictographic property plus skin-tone modifiers, regional-indicator flags, keycap marks, and the zero-width joiner and variation selector that glue sequences together, while ©, ®, and ™ are kept. Punctuation removal uses the Unicode P and S categories. Whitespace steps run last: trim lines, apply the chosen line-break mode, collapse horizontal whitespace including non-breaking spaces to single spaces, and drop empty lines. Byte counts use UTF-8.

Frequently asked questions

What is the difference between the line-break modes?

Keep leaves every line break as is. Collapse blank lines reduces three or more consecutive line breaks to a single blank line, so paragraph spacing stays but large gaps disappear. Unwrap paragraphs replaces a single line break with a space while keeping blank lines, which repairs text hard-wrapped by an email client or copied from a PDF. Remove all joins everything into one line, useful for pasting into a single-line field.

What are zero-width characters and why remove them?

They are Unicode characters with no visible width: the zero-width space (U+200B), zero-width joiner and non-joiner (U+200D, U+200C), word joiner (U+2060), and byte order mark (U+FEFF), plus the soft hyphen (U+00AD) and directional marks. Websites and messaging apps insert them for line-breaking hints or fingerprinting, and they survive copy and paste. They then break exact-match searches, spreadsheet lookups, passwords, and source code, which is why the tool strips them by default.

Will removing emoji also remove symbols like © or arrows?

The emoji step matches the Unicode Extended_Pictographic property, which covers pictographs, faces, hands, flags, and their skin-tone and joiner sequences. Because that property also technically includes © , ®, and ™, the tool explicitly keeps those three. Arrows, mathematical symbols, and currency signs are not pictographic and are untouched by the emoji step, though the separate Remove punctuation step, which uses the Unicode P and S categories, would remove them.

How are HTML entities decoded without a browser parser?

The tool carries a table of about 100 common named entities (amp, lt, gt, quot, apos, nbsp, copy, reg, trade, hellip, mdash, ndash, the curly quote names, accented Latin letters, and currency symbols) and decodes numeric references of the form ​ or ​ for any code point. Unknown named entities are left as written so nothing is silently lost. Script and style elements are removed together with their contents, since their text is code rather than prose.

Related tools

Word Counter · Case Converter · Text Diff · Lorem Ipsum Generator · Slug Generator · Line Tools · Find and Replace · Markdown Preview

Browse all Text Tools, or go back to every free tool on HeroYears.