Text Cleaning & Comparison

Text Cleaner

Sanitize copied text: strip HTML, smart quotes, URLs, emails, emojis, and extra whitespace.

Before: 0 chars → After: 0 chars

Understanding Your Results

Each output panel above updates locally in real time as your text changes. Here is what every metric or transformation produced by Text Cleaner represents:

  • Three One-Click Cleaning Presets: Jump immediately into Preset: Clean Copy-Paste, Preset: Strip HTML, or Preset: Plain ASCII Only to toggle standard combinations.
  • Granular 10-Filter Pipeline Output: Displays sanitized plain text live on the right alongside reduction stats so you can verify output before exporting.

What is Text Cleaner?

A Text Cleaner is a modular plain-text sanitizer that strips structural clutter—HTML tags, encoded entities, typographic smart punctuation, links, email addresses, non-ASCII characters, and uneven spacing—out of copied documents.

Pasting notes from websites, Google Docs, AI chats, or Word often carries invisible inline `<style>`/`<script>` blocks, curly quotes that break CSV/JSON parsers, or tracking URLs. Cleaning them in sequence leaves predictable plain text ready for publishing or code ingestion.

How Does It Work?

The pipeline executes active rules in an intentional safety sequence inside browser memory: (1) strips `<style>` and `<script>` blocks along with HTML tags, (2) decodes HTML entities (`&`, `—`, numeric codes) safely without DOM rendering, (3) normalizes curly quotes, en/em dashes, and ellipses to ASCII equivalents, and (4) optionally strips URLs, emails, non-ASCII bytes, line breaks, extra spaces, and empty lines.

Ordering matters: stripping HTML tags before decoding entities prevents hidden escaped tags from morphing into raw markup before cleanup finishes.

How to Use Text Cleaner Step by Step

  1. Paste raw web, PDF, or Word copy into the Input pane.
  2. Click one of the three convenience buttons (Clean Copy-Paste, Strip HTML, or Plain ASCII Only) or customize the checkboxes directly.
  3. Check Cleaned Output on the right—toggle Normalize smart quotes or Remove URLs / Remove emails without re-pasting.
  4. Copy Result or Download TXT to save your sanitized plain text.

Calculation Methodology & Rules

Executes regex-guarded cleaning steps sequentially in pure JavaScript (`tat-core.js`)—never invoking `innerHTML` or external parsing libraries.

Typographic punctuation normalization maps `“ ”` -> `"`, `‘ ’` -> `'`, `– —` -> `-`, and `…` -> `...`. Note that "Remove non-ASCII" strips characters outside ASCII printable bounds cleanly.

Order: stripHtml -> decodeEntities -> normalizeQuotes -> removeUrls -> removeEmails -> removeNonAscii -> whitespace passes

Key Text Cleaner Rules & What They Transform

Filter Option Sample Input Cleaned Result
Strip HTML tags <p>Hello <b>World</b></p> Hello World
Decode HTML entities AT&T — 2026 AT&T — 2026
Normalize smart quotes & dashes “Clean”—text… "Clean"-text...
Remove non-ASCII Café 🚀 notes Caf notes (plain ASCII only)

Practical Use Cases

  • Preparing WordPress/Google Docs drafts for Markdown static-site generators or JSON APIs.
  • Redacting email addresses and tracking links from copied support transcripts before internal sharing.
  • Scrubbing curly smart quotes from code examples pasted out of blog posts or slides.

Practical Usage Examples

Scrubbing Messy Web HTML Markup

Input: <article><h2>Release & Notes</h2><p>“Fast” update via https://example.com</p></article>

Output / Insight: With Strip HTML, Decode entities, Normalize quotes, Remove URLs, and Extra spaces ON, outputs clean: "Release & Notes "Fast" update via".

Sanitizing Curly Quotes Before JSON/Code

Input: “key”: ‘value’ — comment

Output / Insight: Outputs clean ASCII syntax: `"key": 'value' - comment`.

Benefits & Limitations

Key Benefits

  • Combines ten cleanup tools into one safe ordered workflow.
  • Three presets configure optimal rule bundles for common cleaning jobs in one click.
  • Never executes pasted `<script>` or `<style>` payloads because tags are matched in plain string buffers.

Important Limitations

  • Turning on "Remove non-ASCII" removes accented European letters (`é`, `ü`, `ñ`), Cyrillic, Hindi, and emojis along with curly punctuation—leave it OFF unless strict legacy ASCII is required.
  • Stripping `<style>`/`<script>` blocks assumes plain text formatting; if you need literal code preserved safely for HTML display, use HTML Entity Encoder & Decoder instead.
  • When `Remove URLs` runs, surrounding prepositions stay in the sentence and may benefit from a quick human read-through.

Frequently Asked Questions

Should I enable Remove non-ASCII for international English or European copy?

No. Keep "Remove non-ASCII" unchecked if you want to keep currencies (`£`, `€`), accented names, or emojis. Enable only Normalize smart quotes & dashes if curly punctuation is your sole issue.

Can this tool remove HTML tags cleanly without running scripts inside them?

Yes. HTML tags, `<script>` tags, and `<style>` blocks are removed solely using JavaScript string matching, never parsed as live browser HTML.

Why does Clean Copy-Paste leave both Extra spaces and Empty lines ON?

It produces compact, single-spaced plain text suitable for forms, emails, and CMS inputs; uncheck Remove empty lines if you want single blank paragraph spacing kept.

How do I remove extra spaces only without modifying quotes or HTML?

Uncheck the other boxes here or visit our streamlined Remove Extra Spaces utility directly.