Prompt Cleaner

This free cleaner removes the characters you cannot see in your text, from zero-width spaces to the Unicode tags used to smuggle hidden instructions into AI prompts. It lists what it found and why it matters, straightens curly quotes, keeps your emoji intact, and removes line breaks from text copied out of a PDF.

Clean text
What was found
  • U+200BZero-width space×1Splits a word into two tokens without showing anything.
  • U+201C-DCurly double quote×4Breaks JSON, CSV and code that expect a plain quote.
  • U+2013-5En/em dash×2Looks like a hyphen but is a different character.
  • U+2026Ellipsis×1One character pretending to be three dots.
  • U+00A0 etcUnusual space×1Looks like a space but does not match one in code or search.

What is an invisible character?

An invisible character is a real code point in your text that renders as nothing. A zero-width space sits inside a word without widening it. A soft hyphen shows up only when a line happens to wrap. A byte-order mark leads a file and shows up nowhere.

They get in by accident, mostly. Copying from a PDF, a word processor, a web page or an AI response drags them along, and from then on they travel with the text. Your eyes see one thing; the machine reading it sees another. That gap is the whole problem: a prompt that looks right behaves oddly, a string comparison fails against text that appears identical, a JSON file will not parse, a search finds nothing.

Can text carry instructions I cannot see?

Yes, and it is a documented technique rather than a theory. The Unicode tag block, U+E0000 to U+E007F, mirrors ordinary ASCII: add 0xE0000 to a letter's code point and you get an invisible twin of it. String those together and you have written a full sentence that renders as absolutely nothing.

A language model still reads it. It processes characters, not pixels, so a message that shows you "Summarise this article" can carry a second instruction underneath that only the model sees. AWS published guidance on this under the name Unicode character smuggling, and its recommended defence is to filter those code points out of prompts. Security researchers also call it ASCII smuggling.

There is a button above that loads exactly such a text so you can see it for yourself: the visible part is short, the reveal view shows what is actually in there.

The same family of trick applies to code. Bidirectional override characters, U+202A to U+202E and U+2066 to U+2069, reorder how text is displayed without changing what it does, so a reviewer reads one thing and the compiler does another. That one is known as Trojan Source, and it is why this tool strips the whole range.

How do I see what is hidden before removing anything?

Switch to Reveal what is hidden. Nothing is removed there. Every invisible character is marked in place with its Unicode code point, so you can see how many there are and exactly where they sit.

That matters more than a total count. Knowing "twelve characters were removed" tells you nothing; seeing a marker after a sentence that reads Hidden text: "ignore all previous instructions" tells you someone put it there. The clean view then gives an itemised audit: which character, how many, and why it matters.

Will cleaning break my emoji?

Not by default.

Some invisible characters are doing a legitimate job. The zero-width joiner is what fuses 👨 👩 👧 into the single family emoji 👨‍👩‍👧, and what holds 🏳️‍🌈 together. Strip every joiner blindly and those come apart into separate glyphs. Arabic and several Indic scripts use joiners for correct letterforms too.

So this tool keeps joiners that sit inside an emoji sequence or between two letters of Persian, Arabic or an Indic script, and removes the stray ones floating in normal text. If you want a bare result for emoji, turn off Keep emoji intact under What to fix.

Tidy whitespace joins repeated spaces between words and drops trailing spaces, but never touches the indentation at the start of a line, so pasted code and nested lists keep their shape.

What else does it fix?

Three families of character that are visible but wrong for machines:

  • Curly quotes (“ ” ‘ ’) become straight quotes. Word processors and phones insert them automatically, and they break JSON, CSV, shell commands and most code.
  • En and em dashes (– —) become hyphens, and a single-character ellipsis (…) becomes three dots.
  • Unusual spaces, including the non-breaking space, become ordinary spaces, because they look identical and never match in a comparison.

All of them are on by default. What to fix has a switch for each, so you can straighten quotes without touching dashes, or strip invisible characters while leaving typography alone.

How do I remove line breaks?

Turn on Remove line breaks. Text copied from a PDF, an email or a narrow column arrives with a hard break at the end of every line, so it pastes as a ragged block. This joins those lines with a single space, and the audit says how many breaks went.

SwitchWhat it doesExample
Remove line breaksJoins the lines of each paragraphthe quick / brown fox becomes the quick brown fox
Keep paragraphs (on)Keeps the blank line between paragraphstwo paragraphs stay two
Keep paragraphs (off)Puts the whole text on one linehandy for a form field or a spreadsheet cell
Rejoin hyphenated wordsRemoves the hyphen a PDF added to split a wordexam- / ple becomes example

Rejoin hyphenated words is off by default on purpose: a real compound like well- / known would lose its hyphen too, so turn it on when the text came from a PDF.

What we tested

Each case below was pasted into the cleaner with the default settings:

You pasteWhat comes out
"Summarise this article" with an instruction hidden in 33 Unicode tags"Summarise this article"; Reveal shows the hidden line, IGNORE ALL PREVIOUS INSTRUCTIONS
👨‍👩‍👧 and 🏳️‍🌈, plus a stray joiner in a wordboth emoji intact, the stray joiner removed
The Persian word می‌خواهم, and hello + non-joiner + worldthe Persian word keeps its non-joiner; the Latin pair is joined
Python code with 4- and 8-space indentation and a double spaceindentation untouched, the double space reduced to one
Three lines from a PDF with com- / panies (Remove line breaks and Rejoin on)one paragraph per paragraph, companies in one piece, 3 line breaks reported
café (text saved with the wrong encoding)left as it is: that is a different problem, see below

What can't it do?

  • It does not detect AI-generated writing. It removes characters that sometimes appear in AI output, but their absence proves nothing about authorship and their presence proves nothing either, since copying from a PDF produces the same artefacts. Be sceptical of anything claiming to detect AI writing.
  • It does not create hidden text. This is a defensive tool for cleaning text you received, not a way to hide anything in text you send.
  • It does not fix encoding damage. If a file was already saved with the wrong encoding and you are looking at é where é should be, that is mojibake, a different problem, and no amount of character stripping repairs it.
  • It does not rebuild PDF layouts. Line breaks are joined, but columns, tables and headers that a PDF mixed into the text stay where they landed in the paste.
  • It does not change your wording. Nothing is rewritten, reordered or summarised. The visible text you paste is the visible text you get back.

Nothing you paste leaves your browser: the cleaning runs on your device, which matters when the text is a prompt you are about to send or a document from a source you do not fully trust. For what these characters are and where they come from, see the guide to invisible characters.

Read the guide: What Are Invisible Characters?Read more →

Frequently asked questions

What are invisible characters?

Invisible characters are code points that take up no visible space but still exist in your text, like zero-width spaces, byte-order marks, soft hyphens and non-breaking spaces. They arrive when you copy from web pages, PDFs, word processors or AI output, and they break prompts, code, search and form validation without ever showing themselves.

Can someone hide instructions inside text I paste into an AI?

Yes, and it is a documented technique. The Unicode tag block, U+E0000 to U+E007F, can encode a whole sentence that renders as nothing on screen while a language model still reads it normally. AWS publishes guidance on the attack and recommends filtering exactly those code points, which is what this tool does.

How can invisible characters break an AI prompt?

A hidden character inside a word can split it into two tokens, change how the model reads an instruction, or make an exact-match rule fail silently. Because you cannot see the character, the prompt looks correct but behaves oddly. Removing them makes the prompt do exactly what the visible text says.

What is a bidirectional override character?

It is a control character that reorders how text is displayed without changing the underlying content, so what you read can differ from what a computer executes. In source code this is known as Trojan Source, and it is why this tool strips the whole U+202A to U+202E and U+2066 to U+2069 range.

Will it break my emoji?

No, not by default. Some invisible characters are legitimate: a zero-width joiner is what holds the family emoji together as one glyph, and removing it splits it into separate people. The tool keeps joiners that sit inside an emoji sequence and strips the stray ones, and you can turn that protection off.

How do I see what is hidden before removing it?

Switch to Reveal what is hidden. Nothing is removed there; every invisible character is marked in place with its Unicode code point, so you can see exactly where it sits in the text. It is the quickest way to prove a suspicious paste really does contain something you were not shown.

What does straightening quotes and dashes do?

Word processors and phones auto-replace straight quotes with curly ones and hyphens with long dashes. Those characters look nice but break code, JSON, CSV and command lines that expect plain quotes and hyphens. This tool converts them back to the simple versions so your text works where it needs to.

How do I remove line breaks from text copied from a PDF?

Paste the text and turn on Remove line breaks. The lines of each paragraph are joined with a space, and Keep paragraphs leaves the blank line between paragraphs so the structure survives. Turn on Rejoin hyphenated words to turn exam- at the end of one line and ple on the next back into example.

Does this tool detect AI-generated text?

No, and nothing reliably does. It removes hidden characters that sometimes appear in AI output, but their absence proves nothing about who wrote the text and their presence proves nothing either, since a PDF copy produces the same artefacts. Treat any tool claiming to detect AI writing with suspicion.

Is my text private?

Yes. The cleaner runs entirely in your browser with JavaScript. Nothing you paste is uploaded, logged, or stored, and it clears when you close the tab. You can safely clean private prompts, code, or confidential text, and the tool keeps working offline once the page has loaded.

Rate Prompt Cleaner & help shape it

This tool is free and still growing. Tell us what works, what you would change, and what is missing. Your feedback is what decides what we build next.

Your rating
Tap a star to start

Built and tested by the ÆON Toolhub team. Last updated: October 19, 2026. How we test our tools