Hidden Characters in Text: How to Find and Remove Zero-Width Spaces, NBSP and More

The invisible Unicode characters that break forms, CSV imports, lookups and code, how to reveal them in Word and VS Code, and a checker that highlights them.

Text that looks right can still contain characters you cannot see. They arrive when you copy from a web page, a PDF, a chat window or a document, and they stay invisible until a form rejects the entry, a spreadsheet lookup fails, a compiler complains about an unexpected token, or a search for a word you can plainly read returns nothing. This page lists the usual suspects, explains what each one breaks, and gives you a checker that shows exactly where they are.

Reveal hidden characters

Paste text below. Every invisible or look-alike character is replaced with a yellow label showing its code point (blue for non-breaking spaces and other odd spaces). Hover a label for the name. The cleaned version, with those characters removed and odd spaces normalised, is ready to copy underneath. Nothing leaves your browser.

0 characters
No hidden characters found

The characters and what they break

Code pointNameWhat it does and why it matters
U+200BZero-width spaceInvisible line-break opportunity. The most common one in copied web text and AI output. Makes "identical" strings compare unequal.
U+200CZero-width non-joinerStops two letters forming a ligature. Meaningful in Persian and some Indic scripts, noise elsewhere.
U+200DZero-width joinerGlues emoji into sequences such as families. Stray ones are left behind when emoji are deleted one character at a time.
U+2060Word joinerInvisible no-break point. The modern replacement for U+FEFF inside text.
U+FEFFByte order markMarks the encoding at the start of a file. Inside text it is invisible; at the start of a CSV or JSON file it breaks parsers and makes the first column header not match.
U+00ADSoft hyphenInvisible unless the line wraps there, at which point a hyphen appears. Breaks search and matching on the word that contains it.
U+00A0Non-breaking spaceLooks like a space. Not matched by a search for a space, prevents wrapping, stops Excel reading a value as a number, and fails equality checks.
U+202F, U+2007, U+2009Narrow, figure and thin spacesTypographic spaces of unusual widths. Same problems as the non-breaking space with a different look.
U+200E, U+200FLeft-to-right and right-to-left marksInvisible direction hints. Common in text copied from sites that mix scripts.
U+202A to U+202EBidi embedding and override controlsCan reverse the visual order of characters. Used in filename spoofing and in "Trojan Source" attacks on code review.
U+2066 to U+2069Bidi isolate controlsNewer versions of the above. Same risk.
U+2061 to U+2064Invisible math operatorsFunction application, invisible times, invisible separator, invisible plus. Show up in formulas copied from documents.
U+180E, U+034FMongolian vowel separator, combining grapheme joinerRare, invisible, and occasionally used to slip text past filters.
U+115F, U+1160, U+3164, U+FFA0Hangul fillersRender as blank. Used to create usernames that look empty.
U+0000 to U+001F, U+007F to U+009FC0 and C1 control codesLegacy terminal controls, except tab, line feed and carriage return which are normal. Rejected by most parsers and databases.
U+E0000 to U+E007FTag charactersInvisible characters that can spell out hidden text. Used for flag emoji variants and, more recently, for hiding instructions or watermarks inside text.
U+FE0E, U+FE0FVariation selectorsChoose text or emoji presentation of the preceding symbol. Harmless attached to an emoji, noise on their own.

Why they break forms, spreadsheets and code

Software compares characters, not what you see. An email address with a zero-width space in it is not a valid email address, so the signup form says "invalid" while you stare at a correct-looking entry. A password pasted from a manager with a trailing non-breaking space is the wrong password. Two product codes that look identical in Excel fail VLOOKUP or MATCH because one has U+200B in it, and TRIM does not remove it. A CSV import puts the whole first row in one column because the file starts with a byte order mark and the header is now the invisible mark plus id rather than id.

In code the errors are more confusing. Python reports SyntaxError: invalid non-printable character U+200B. JavaScript may accept U+200B inside an identifier in some contexts and reject it in others. A shell script with a non-breaking space between a command and its argument reports the command as not found, because the space was not a separator. JSON parsers reject a BOM before the opening brace. SQL treats a non-breaking space as part of a string literal, so a WHERE name = 'Smith' clause never matches 'Smith '.

The bidi override characters deserve a special mention. They can make source code display in a different order from how it compiles, which is how the "Trojan Source" vulnerability worked. Most editors now flag them, and you should never leave one in a file you did not put there on purpose.

How to detect them without this page

Microsoft Word

Press Ctrl+Shift+8 to show formatting marks. Spaces become dots, non-breaking spaces become a small raised circle, tabs become arrows. Zero-width characters still show nothing. To find one, open Find (Ctrl+F, then the Advanced Find option), and type ^u8203; Word's ^u code takes the decimal code point, and 8203 is U+200B. Non-breaking space has its own code, ^s. Google Docs has no equivalent; paste the text here or into a code editor.

VS Code and other editors

VS Code highlights invisible and ambiguous Unicode by default, drawing a yellow box around each one and naming it on hover. If you do not see it, enable editor.unicodeHighlight.invisibleCharacters and editor.unicodeHighlight.ambiguousCharacters. Sublime Text and Notepad++ show non-printing characters through their View menus. In any editor with regex search, [\u200B-\u200D\u2060\uFEFF\u00AD\u00A0] finds the most common ones.

Spreadsheets

Use =LEN(A1) next to a suspicious cell. If the length is longer than the number of characters you can count, something invisible is in there. =CODE(MID(A1,n,1)) in Excel, or =UNICODE(MID(A1,n,1)) in Excel and Sheets, tells you which character sits at position n. The value 8203 is a zero-width space, 160 is a non-breaking space, 65279 is a byte order mark.

Removing them

For a one-off, the checker at the top of this page produces a cleaned copy with every character in the table removed and every odd space turned into a normal one. For text that also needs markdown stripped, em dashes replaced or emojis removed, the AI Text Cleaner does the hidden-character pass as part of its default options and also applies Unicode NFC normalisation, so accented letters built from combining marks become their single-character equivalents and match correctly in searches. In a spreadsheet, =SUBSTITUTE(SUBSTITUTE(A1,UNICHAR(8203),""),UNICHAR(160),"") handles the two most common characters in place. In code, a regex replace with the character class above is the usual fix, and adding an editor rule that flags them stops them coming back.

Curly quotes and em dashes are not hidden, but they cause the same kind of silent failure in code and data. The smart quotes guide covers those.

Frequently asked questions

What is a zero-width space?

U+200B, a Unicode character that marks a possible line break but has no width, so nothing is drawn on screen. It is used legitimately in some Asian scripts and in web layouts to allow long strings to wrap. It becomes a problem when it is copied into a form field, a spreadsheet cell or a source file, where it makes text that looks identical compare as different.

How do I see hidden characters in Word?

Press Ctrl+Shift+8 to show formatting marks. Non-breaking spaces appear as a small degree-like circle and ordinary spaces as dots. Zero-width characters are still not drawn, so use Find with the ^u code followed by the decimal code point, for example ^u8203 for a zero-width space.

How do I find zero-width characters in VS Code?

VS Code highlights invisible and ambiguous Unicode characters by default with a yellow box and shows the code point on hover. If it has been turned off, enable editor.unicodeHighlight.invisibleCharacters in settings. You can also search with the regex [\u200B-\u200D\uFEFF].

Is a non-breaking space a hidden character?

It is visible as a space but behaves differently: it prevents a line break, it is not matched by a search for a normal space, and it stops a number from being read as a number in Excel. Because it looks identical to a space it is usually grouped with hidden characters. The checker on this page highlights it in blue.

Why does my CSV or JSON fail with a character I cannot see?

A byte order mark (U+FEFF) at the start of a file is the usual cause. Editors hide it, but the parser sees three extra bytes before the first field or brace. Save the file as UTF-8 without BOM, or strip the character from the text before you save.

Do AI tools add hidden characters on purpose?

Some do, as a watermark, and some pick them up from the training or retrieval text. Either way the fix is the same: check anything you paste from a chat window and remove the characters before they reach a form, a spreadsheet or a code editor.

Will removing hidden characters change how my text looks?

No. By definition they have no visible width, so the cleaned text looks the same. The only visible change is a non-breaking space turning into a normal space, which may let a line wrap in a different place.

Last updated 2026-09-16. Everything on this page runs in your browser. Nothing you type or upload leaves your device.