Remove Extra Spaces
Collapse multiple spaces, trim leading/trailing tabs, and tidy messy whitespace.
Open ToolSanitize copied text: strip HTML, smart quotes, URLs, emails, emojis, and extra whitespace.
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:
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.
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.
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.
| 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) |
Explore Next: HTML Entity Encoder & Decoder if you want to escape code safely rather than stripping tags • Remove Extra Spaces for focused whitespace trimming and punctuation spacing • Browse all 30 text tools
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".
Input: “key”: ‘value’ — comment
Output / Insight: Outputs clean ASCII syntax: `"key": 'value' - comment`.
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.
Yes. HTML tags, `<script>` tags, and `<style>` blocks are removed solely using JavaScript string matching, never parsed as live browser HTML.
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.
Uncheck the other boxes here or visit our streamlined Remove Extra Spaces utility directly.
Collapse multiple spaces, trim leading/trailing tabs, and tidy messy whitespace.
Open ToolStrip blank or whitespace-only lines completely or collapse gaps to single line breaks.
Open ToolSafely encode reserved HTML characters or decode named and numeric HTML entities.
Open ToolSearch and replace plain strings, whole words, or RegEx patterns with live match counts.
Open Tool