Skip to content

Text Cleaner

Clean up text pasted from Word, PDFs, or chat. Straighten curly quotes and dashes, remove zero-width and control characters, collapse repeated spaces, fix broken line wrapping, and strip emoji or HTML tags when you need plain text.

How Text Cleaner works

  1. Paste the messy text — a PDF copy or a Word export is the usual culprit.

  2. Toggle the cleaning rules you want applied.

  3. Review the change summary showing how much was removed.

  4. Copy the cleaned result.

When to use Text Cleaner

  • Pasting from a PDF or Word and needing straight quotes and plain hyphens before the text goes into a plain-text field or code.
  • Removing zero-width and control characters that rode along invisibly from a chat app, a web page, or a bad export.
  • Rejoining lines a PDF hard-wrapped at a fixed column so a paragraph flows as one block again.
  • Stripping HTML tags out of a fragment copied from a rendered page to recover just the visible text.
  • Dropping emoji or stray links from a snippet before pasting it somewhere that should stay plain.

Examples

Cleaning a paste from a PDF

Input

“The report,” she said, is due — see fig. 2​.

Output

"The report," she said, is due - see fig. 2.

Curly quotes straighten, the em dash becomes a hyphen, and a zero-width space hiding before the full stop is removed. The change summary lists each rule and the number of characters it touched.

Expanding an ellipsis glyph

Input

Wait… what happened here?

Output

Wait... what happened here?

The single ellipsis character becomes three periods, which is what most plain-text and code contexts expect.

Rejoining a hard-wrapped, hyphenated line

Input

This is a compre-
hensive review of the quarter.

Output

This is a comprehensive review of the quarter.

With “Rejoin hard-wrapped lines” on, the word split across the break is put back together without the trailing hyphen.

How Text Cleaner works under the hood

Cleaning is a pipeline of independent rules, each applied only if its switch is on, and each run against the output of the one before it. The order is deliberate: structural and invisible-character rules run before punctuation and spacing rules, so, for example, Unicode normalisation and HTML stripping happen first, and space-collapsing and line-trimming happen last, once the earlier rules have finished changing the text. Every rule that actually alters something is recorded in the change summary with the number of characters it touched.

The default set targets the problems a copy-paste usually introduces: smart quotes are straightened to their plain forms, en and em dashes and the minus sign are flattened to a hyphen, the ellipsis glyph is expanded to three periods, zero-width and bidirectional-control characters are removed, non-printing control bytes are stripped, runs of spaces or tabs are collapsed to one, and the leading and trailing whitespace on each line is trimmed. Rejoining wrapped lines, removing emoji, stripping HTML, removing URLs, and Unicode NFC normalisation start switched off, because each one is only wanted in specific situations.

The invisible-character rule removes the characters that survive a paste unseen: zero-width spaces, joiners and non-joiners, the byte-order mark, the word joiner, the soft hyphen, and the bidirectional-control block that can reorder how text appears. The control-character rule removes the non-printing C0 and C1 bytes while deliberately leaving tab, line feed, and carriage return intact, so your line structure is preserved even as the junk is cleared out.

The change summary is a per-rule count of how much each rule altered, computed by comparing the text before and after that rule. When a rule changes the length, the count is the size of that change; when a rule swaps characters without changing length — straightening a quote, say — it counts the positions that differ. This is a proxy for “how much this rule did”, not a byte-exact ledger, but it reliably tells you which rules fired and roughly how heavily, so a surprising result is easy to trace back to its cause.

Common mistakes

  • Stripping HTML or removing URLs on Markdown or source code. These rules do exactly what they say — they delete tags and links — so a document where the angle brackets or the links are meaningful will lose them. Keep both off when you are cleaning code or Markdown you want to preserve.
  • Flattening an en dash that carries meaning. “Normalise dashes” turns an en dash into a plain hyphen, which is wrong for a number range like a span of years or pages where the en dash is intentional. Switch the rule off when the dash is meaningful.
  • Expecting hard-wrap rejoining to be perfect on unusual layouts. It is a heuristic that reads punctuation and the start of the next line to decide whether to merge, so a table, a poem, or an oddly indented block can occasionally join lines you meant to keep apart. Review the result when the source layout is unusual.
  • Assuming the tool rewrites words. It never does — every rule works on punctuation, whitespace, or invisible characters, so no word is reworded or reordered. If a word looks changed, it was a quote, dash, or hidden character attached to it that moved, and the change summary will show which rule was responsible.

Frequently asked questions

All tools

Search NeatKit

Jump to a tool, a page, or change the theme.