Prompt Cleaner & Normalizer
Clean pasted text for your prompt — collapse spaces and blank lines, fix smart quotes, strip HTML and zero-width chars. Free, runs in your browser.
Prompt Cleaner & Normalizer
How to Use the Prompt Cleaner
Paste your text
Drop in whatever you copied — a doc, a webpage, a chat log, an email. Pasted text almost always carries invisible cruft: double spaces, ragged indentation, curly quotes and stray blank lines.
Pick your cleaning options
Each toggle is one transform: collapse runs of spaces, trim every line, squeeze blank lines, normalize smart quotes and dashes, strip HTML tags, and remove zero-width characters. Most are on by default; turn off any you want to keep.
Check the before/after count
The three stat cards show characters before, characters after, and how many were removed — a quick gauge of how much noise you just stripped out of your prompt.
Copy the cleaned text
Hit Copy and paste the result straight into ChatGPT, Claude, Gemini or your own prompt. It all runs in your browser — nothing you paste is ever uploaded.
Why Messy Pasted Text Quietly Breaks Your Prompts
The invisible junk that rides along with copy-paste
When you copy text out of a Word document, a PDF, a webpage, a Slack thread or an email, you rarely get just the words. You get the formatting residue that came with them: runs of double and triple spaces left over from manual alignment, tab characters used as indentation, ragged leading and trailing whitespace on every line, and stacks of empty lines where paragraphs used to be separated. Worse, you get characters that look identical to the plain ones but are not — curly "smart" quotes and apostrophes, en-dashes and em-dashes standing in for a simple hyphen, a single ellipsis glyph instead of three dots, and a category of truly invisible gremlins called zero-width characters that occupy no visual space at all yet are very much present in the string. You can't see them, but the model can, and so can your token counter.
Every one of those extras costs you something. Language models read text as tokens, and tokens are billed and budgeted. A run of five spaces is not free; a curly quote often tokenizes differently from a straight one; a zero-width joiner can split a word into two tokens where there should have been one. Multiply that across a long pasted document and you are paying — in money on metered APIs, and in precious context-window space on every model — for noise that adds nothing. Normalizing the text first means more of your limited context goes to actual content instead of formatting debris, and your prompts get measurably cheaper and longer-lived.
"The model reads every invisible character you paste. Clean text isn't cosmetic — it's the difference between paying for your words and paying for your clipboard's leftovers."
What normalization actually fixes
Cleaning is not just about cost; it is about predictability. Smart quotes are a classic source of silent failure: paste a snippet of code or JSON that someone "helpfully" formatted with curly quotes and it will not parse, because "key" and "key" are different strings to a parser even though they look the same to you. The same trap catches em-dashes substituted for hyphens in command-line flags, and ellipsis glyphs inside data you intend to process. Converting all of these back to their plain ASCII equivalents makes the text behave the way you expect when the model — or any downstream tool — reads it literally.
Whitespace normalization does the rest. Collapsing multiple spaces to one, trimming every line, and limiting consecutive blank lines to a single break turns a jagged, wandering block of text into a clean, compact one that is easier for the model to follow and easier for you to read while you edit it. Stripping HTML tags rescues content you grabbed from a rendered webpage's source, leaving the prose without the markup. And removing zero-width characters eliminates the hardest-to-debug problems of all — the ones you cannot see and would never think to look for. This tool runs entirely in your browser with plain JavaScript regular expressions: nothing you paste is sent to any server, any model, or any third party, and nothing is stored. Paste, toggle, check the count, copy — and feed your prompt clean text instead of clipboard clutter.
10 Facts About Cleaning Prompt Text
Models read text as tokens — and extra spaces, blank lines and odd characters all cost tokens.
Smart quotes ("…") are different characters from straight quotes ("…") and can break code and JSON.
Zero-width characters are invisible but real — they sit inside the string and waste tokens silently.
Copy-paste from Word, PDFs and webpages is the most common source of hidden formatting cruft.
An em-dash (—) pasted into a command-line flag or hyphenated term will often parse wrong.
Collapsing runs of spaces and blank lines makes a prompt shorter and easier for the model to follow.
On metered APIs, noisy whitespace is real money — you pay per token whether it carries meaning or not.
A single ellipsis glyph (…) is one character that often tokenizes oddly; three dots (...) are safer.
Stripping HTML tags rescues prose you grabbed from a page's source without dragging markup along.
This cleaner runs entirely in your browser — your pasted text is never uploaded or saved.
Frequently Asked Questions
- It cleans up text you paste so it's ready to drop into a prompt. It can collapse runs of spaces, trim each line, squeeze blank lines down to one, convert smart quotes and dashes to their plain equivalents, strip HTML tags, and remove invisible zero-width characters. Each cleanup is a toggle you can turn on or off.
- Models read text as tokens, and tokens cost money on metered APIs and consume your limited context window. Extra spaces, stray blank lines, curly quotes and zero-width characters all add tokens that carry no meaning — so cleaning the text first makes your prompts cheaper, tighter and more predictable.
- Smart (curly) quotes and apostrophes are different characters from the straight ASCII ones, even though they look almost identical. They commonly break code, JSON and command-line input because a parser treats them as distinct. Normalizing converts them — along with en/em dashes and the ellipsis glyph — back to plain hyphens, quotes and dots.
- A zero-width character — like the zero-width space, zero-width joiner or byte-order mark — takes up no visible space but is still present in the string. It's nearly impossible to spot by eye, yet it costs tokens and can corrupt comparisons and parsing. This tool strips them out completely.
- No. All cleaning happens in your browser with plain JavaScript. Nothing you paste is sent to any AI model, server or third party, and nothing is saved — close the tab and it's gone.
- Most pasted text isn't HTML, and you sometimes want to keep tags — for example when you're cleaning a code snippet that legitimately contains angle brackets. So tag-stripping is opt-in. Turn it on when you've copied content out of a rendered page's source and want the prose without the markup.
- No — it only normalizes formatting. It removes redundant whitespace and invisible characters and swaps typographic quotes/dashes for plain ones. The words themselves are untouched, so your content's meaning stays exactly the same.
- "Characters before" is the length of what you pasted, "characters after" is the length once your selected cleanups are applied, and "characters removed" is the difference. They're a quick gauge of how much noise was stripped — and a rough proxy for token savings.
- Yes. The output is just clean plain text, so it pastes into any model or tool — ChatGPT, Claude, Gemini, an agent framework, or anywhere else you build prompts. Cleaner input helps every model read your prompt the way you intended.
- Completely free, with no account or sign-up and no limit on use. It runs entirely in your browser and collects no data.
Related News
You may be interested in these recent stories from our newsroom.
No related news yet for this tool. Our editorial team publishes new pieces every week.
Browse all news →75 more free tools
Calculators, converters, security tools — no signup.