Invisible / Zero-Width Character Detector
Spot NBSPs, zero-width characters, bidi marks, and tabs in pasted text — then clean them out.
Legend
- · Regular space
- → Tab
- ¶ Newline
- ZW Zero-width character
- ␣ NBSP (U+00A0)
- FMT Other invisible / formatting char
HelloZWworld¶ This→line·has·a·tab.¶ Trailing·spaces·here.¶ ···Leading·spaces·here.¶ A␣non-breaking␣space.¶ A00ELRM·and·a02ALRE·inside.¶ ¶ A·blank·line·above.
Invisible characters found
- U+200BZero-width space×1
- U+0009Tab×1
- U+00A0NBSP (non-breaking space)×2
- U+200ELeft-to-right mark×1
- U+202ALeft-to-right embedding×1
Clean options
Helloworld This line has a tab. Trailing spaces here. Leading spaces here. A non-breaking space. ALRM and aLRE inside. A blank line above.
How to use
- Paste or type the text.
- Read the visualization — coloured dots / arrows mark whitespace, ZW marks zero-width.
- Read the 'found' list to see which Unicode points are hiding.
- Toggle clean options and copy the cleaned version.
About this tool
ShowHide
Paste text and the tool highlights every whitespace and invisible Unicode character: regular spaces as middle-dots, tabs as arrows, newlines as pilcrows, NBSPs in amber, zero-width characters in red, and bidi / formatting marks in fuchsia. A summary lists every invisible code point it found, and a one-click clean removes them — handy for fixing broken JSON, mangled passwords, or copy-pasted code that won't compile.
The non-breaking space is the one that ruins a day, because it looks exactly like a space and is a different character. Word processors, chat clients and some websites insert it automatically, so text copied out of a document arrives with them scattered through it, and a parser that splits on whitespace does not recognise it. The symptom is a config file that fails on a line you have read twenty times, or a password that is rejected while appearing correct in every field.
Zero-width characters are worse because they leave no trace at all. The zero-width space, joiner and non-joiner have legitimate uses in scripts that need them, and they also survive a copy out of a rendered page where they were inserted for line-breaking. A string that compares unequal to an identical-looking one usually has one of these in it, and no amount of squinting will show it.
Bidirectional control marks are the class worth treating with suspicion in source code. They reorder how text is displayed without changing what it says, so a line can render in one order and compile in another, which is the basis of the Trojan Source attack published in 2021. Compilers and code hosts now warn about them; seeing one in a file you did not expect to contain any is worth a pause.
The clean strips the invisible characters and leaves ordinary spaces and newlines alone. That is the right default for a password or a JSON key and the wrong one for text in a language that relies on these marks, so check the summary before cleaning rather than after.
Frequently asked questions
What's a zero-width character?
A Unicode code point with no width (U+200B, U+200C, U+200D, U+FEFF, …). They take up no visual space but count as characters — common culprits for 'this string is one byte longer than expected' bugs.
What's NBSP?
Non-breaking space (U+00A0). Looks like a normal space but doesn't break across lines. Some word processors auto-insert it after numbers and units; pasting that into JSON or code breaks things.
What do bidi marks do?
U+202A–U+202E (LRE / RLE / PDF / LRO / RLO) override the visual direction. They're useful for mixed-language text but a known phishing vector when sneaked into URLs or filenames.
Is the cleaning lossless?
Mostly — removing zero-width characters and normalizing line endings is safe for most text. Collapsing whitespace and trimming lines may change formatting you care about, so review before pasting back.
Guides on this topic
Related tools
ASCII Code Table
Browse and search the 256-row ASCII / extended-ASCII table — decimal, hex, octal, binary, and the named control characters.
Developer
Character & Word Counter
Count characters, words, sentences, lines, and bytes in real time.
Text
Unicode Escape Converter
Encode text to \uXXXX, U+XXXX or HTML entities — and decode any of those back to text. Handles emoji and astral characters.
Developer
Unicode Character Inspector
Break a string into characters and show each codepoint, UTF-8 bytes, HTML entity, CSS escape, and Unicode block.
Text
TXT Record Splitter (255-Byte Chunks)
Split a long SPF, DKIM or DMARC TXT record into the 255-byte strings DNS requires, in BIND, generic zone-file, Cloudflare or Route 53 syntax.
Network
HTML Entity Encoder / Decoder
Encode HTML special characters (& < > " ') or decode entities back to their original characters.
Developer