Clean Messy Pasted Text Online

Remove invisible zero-width spaces, smart curly quotes, em dashes, and strange formatting smuggled in from Word, PDFs, or AI assistants.

Clean Pasted Text runs a 5-step normalization pipeline that strips zero-width characters (U+200B, U+FEFF), converts curly quotes (“ ” → "), replaces em dashes (U+2014 → -), trims line-end spaces, and collapses 3+ newlines. For example, “Hello”—world\u200B (16 chars) becomes "Hello"-world (13 chars).

Fixed:
0 Characters
0 Words
0 Sentences
🧹 Remove
🔤 Convert
📑 Format
Copied to clipboard

What Is Pasted Text Damage and Why Does It Happen?

Pasted text damage consists of hidden Unicode control characters, non-breaking spaces, curly quotes, and em dashes injected by Word, PDFs, web pages, and AI chatbots that break code parsers and layout engines.

When you copy text from modern word processors (like Microsoft Word or Google Docs), PDFs, chat tools, or generative AI assistants, the text arrives with invisible formatting artifacts:

  • Invisible Zero-Width Characters: Zero-width spaces (\u200B), byte-order marks (\uFEFF), and soft hyphens (\u00AD) that silently break string equality, code compilation, database searches, and git diffs.
  • Typographic Smart Quotes: Curly quotes (“ ” ‘ ’ „ ‚) that cause syntax errors in terminal scripts, JSON files, SQL queries, and configuration files.
  • Em and En Dashes: Punctuation marks (— – ‒ ―) that interfere with command-line flags and hyphenated identifiers.
  • Trailing Whitespace & Strange Line Breaks: Ghost spaces and tabs at the ends of lines, plus runs of excessive blank lines.

How Does the 1-Tap Paste Repair Algorithm Work?

The engine runs five sequential regex and Unicode passes while respecting regional typography conventions (such as German low quotes U+201E and French guillemet spacing U+00AB U+00A0).

Text Cleaner's Clean pasted text engine executes a safe, deterministic 5-step normalization sequence:

  1. Strips zero-width characters outright while normalizing exotic Unicode spaces (such as non-breaking \u00A0 or thin spaces) to standard ASCII spaces.
  2. Converts smart quotes to standard straight double (") and single (') quotes.
  3. Converts em and en dashes into standard hyphens (-).
  4. Trims trailing whitespace from every line without touching intentional line starts.
  5. Collapses runs of 3 or more blank lines down to clean double newlines (paragraphs).

What Regex & Unicode Rules Are Applied in Clean Pasted Text?

Below is the exact transformation table with Unicode code points and a worked before/after audit showing character and line count changes:

Worked Before / After Example: Input The quick brown fox—as they say—jumps over the “lazy” dog.\u200B \n\n\nVisit acme.com or pay $9.99 for version 1.5... Right? U.S.A. today. (135 characters, 23 words, 4 lines) → Output The quick brown fox-as they say-jumps over the "lazy" dog.\n\nVisit acme.com or pay $9.99 for version 1.5... Right? U.S.A. today. (127 characters, 23 words, 3 lines; 2 em dashes, 2 curly quotes, 1 zero-width space, 6 trailing spaces, and 1 extra blank line repaired).

Pipeline Step & Unicode / Regex Rule Input Example (Before) Output Result (After) Characters / Lines Changed (count)
1. Zero-Width Strip ([\u200B-\u200D\u2060\uFEFF\u00AD]) dog.\u200B (5 chars) dog. (4 chars) -1 hidden char removed
2. Exotic Space Normalize ([\u00A0\u2002-\u2009\u202F\u3000] → U+0020) hello\u00A0world (11 chars) hello world (11 chars) 1 NBSP normalized to ASCII space
3. Straighten Quotes ([\u201C\u201D] → ", [\u2018\u2019] → ') “lazy” ‘dog’ (12 chars) "lazy" 'dog' (12 chars) 4 curly quotes straightened
4. Normalize Dashes ([\u2012-\u2015] → U+002D) fox—as–said (11 chars) fox-as-said (11 chars) 2 typographic dashes → hyphens
5. Trim Trailing & Collapse Newlines (s/[ \t]+$//gm, s/\n{3,}/\n\n/g) Line 1 \n\n\nLine 2 (21 chars, 4 lines) Line 1\n\nLine 2 (14 chars, 3 lines) -7 chars (-6 spaces, -1 newline)

Is Clean Pasted Text 100% Client-Side & Private?

Yes—100% of text cleaning executes locally inside your browser's JavaScript engine with zero network requests or server logging.

Unlike other web utilities that upload your clipboard content to remote servers, Text Cleaner processes everything directly on your device using client-side JavaScript. Nothing leaves your browser.

How to use this tool:

  1. Paste or type your text into the editor box above.
  2. Click the highlighted action button to run the transformation instantly on your device.
  3. Click Copy to place the cleaned text onto your clipboard.

More Free Online Text Tools

Cleaning & Stripping
Clean Pasted Text Remove Em Dash Remove Line Breaks Remove Invisible Chars Straighten Quotes Strip HTML Strip Markdown
Case Converters
All 11 Case Converters Sentence Case camelCase Converter snake_case Converter
Formatting & Analytics
Remove Duplicate Lines Alphabetize List Word & Character Counter

Clean text from any app with the Share Sheet.

Select text in Safari, Mail, or Notes and share it to Clean Text. The cleaned version is copied back to your clipboard with a summary of what was fixed.

  • Works inside Safari, Mail, Notes, Word, and Slack
  • Counts and audits damage: '2 em dashes, 3 invisible characters removed'
  • 100% on-device: zero network requests, zero telemetry, full privacy
  • Available on iPhone, iPad, and Mac
Text Cleaner: Case Converter App Screenshot