What Are Invisible Characters?
Invisible characters are code points that occupy no visible space but still sit inside your text, such as zero-width spaces, byte-order marks, and non-breaking spaces. They slip in when you copy from web pages, PDFs, word processors, or AI output, and they quietly break prompts, code, search, and forms because you never see them.
The short version
Invisible characters are real characters in your text that render as nothing, or as an ordinary space, so you cannot tell they are there. Common ones include the zero-width space, the byte-order mark, and the non-breaking space. They are perfectly valid Unicode, but they cause very real problems: a prompt that behaves oddly, code that will not run, a form that rejects your input, a search that finds nothing.
They matter more than ever now, because copying text between web pages, PDFs, word processors, and AI tools spreads them everywhere.
The usual suspects
A few invisible or look-alike characters cause most of the trouble:
- Zero-width space (U+200B) and its cousins, the zero-width joiner and non-joiner. They have no width at all and sit silently inside or between words.
- Byte-order mark (U+FEFF) often lands at the very start of a file or pasted block.
- Non-breaking space (U+00A0) looks exactly like a normal space but is a different character, so code comparing spaces fails.
- Curly quotes (“ ” ‘ ’) and long dashes (– —). Not invisible, but they masquerade as the straight quotes and hyphens that code expects and quietly break it.
Where they come from
You rarely type these on purpose. They arrive when you copy text. Word processors auto-replace straight quotes with curly ones and hyphens with dashes. PDFs encode layout with special spaces. Some websites inject zero-width characters to watermark or to frustrate scrapers. And AI tools sometimes emit non-standard punctuation in their answers. Every copy-paste between these carries the characters along, invisibly.
Why they break things
AI prompts. Models read tokens, not letters. A zero-width character inside a word can split it into two tokens or shift how an instruction is read. Stop sequences and exact-match rules fail when a hidden character is present, and since you cannot see it, the prompt looks right while acting wrong.
Code and data. A non-breaking space where a normal space should be, or a curly quote instead of a straight one, causes syntax errors in most languages, invalid JSON, and broken CSV. The editor shows what looks like correct code, but it will not run.
Forms and search. A trailing zero-width character makes "email@example.com" not equal "email@example.com" to a validator, and makes a search for a word quietly return nothing.
How to find and remove them
You cannot spot them by eye, so the reliable fix is to run the text through a tool that strips them. The safest approach is one that works in your browser, so sensitive text never leaves your device, and that lets you choose what to remove, invisible characters, curly quotes, odd spaces, so you do not accidentally change something you meant to keep.
Paste your text into the free prompt cleaner below, and it removes the hidden characters and normalizes the punctuation in one step, giving you plain text that behaves exactly as it looks.
Ready to start?
Put it into practice with the free prompt cleaner, right in your browser.
Open the Prompt CleanerLast updated: September 16, 2026