Invisible Character & Zero-Width Space Cleaner
Detect, inspect, and remove invisible unicode gremlins, zero-width spaces, and hidden whitespace characters that break code.
Detect, inspect, and strip hidden zero-width spaces, BOM, and unicode gremlins that cause code and regex bugs.
How to use this tool
Private & Safe Source Code Sanitization
All Unicode inspections and string cleanups occur locally inside your web browser. Proprietary source code, configuration files, and API secrets are never uploaded to any external server.
How to Detect and Remove Invisible Unicode Gremlins
Identify and sanitize phantom characters causing compilation or parsing errors.
Paste Suspect Text
Paste code snippets, config files, or copy-pasted strings into the input inspector.
Inspect Hidden Gremlins
View live visual badges highlighting the exact line, column, and Unicode codepoints of all hidden characters.
Clean & Export
Click ‘Clean Invisible Characters’ to purge all zero-width gremlins and copy the sanitized text instantly.
Common Invisible Unicode Codepoints
Understand the most notorious zero-width characters and their origin.
| Codepoint | Name | Typical Source | Impact on Code & Compilers |
|---|---|---|---|
\u200B |
Zero-Width Space | Rich text editors, web scrapers, Medium/Word | Unexpected identifier errors, broken variable names |
\uFEFF |
Byte Order Mark (BOM) | Windows Notepad UTF-8 file exports | JSON.parse syntax errors, broken bash shebangs |
\u00A0 |
Non-Breaking Space (NBSP) | Web pages, copy-pasting from browsers | Syntax errors in Python, YAML indentation failures |
\u200C / \u200D |
Zero-Width Non-Joiner / Joiner | Complex script typography, emojis | String comparison mismatches and hashing disparities |
\u00AD |
Soft Hyphen | Auto-hyphenated web articles & PDFs | Hidden substring search misses and broken regexes |
\u2060 |
Word Joiner | Desktop publishing exports | Invisible string token separation errors |
Frequently Asked Questions
Troubleshooting invisible characters and compiler mysteries.
Why do zero-width spaces cause syntax errors in code?
Compilers and interpreters (like JavaScript, Python, Go, and Rust) treat zero-width spaces as distinct, illegal Unicode characters rather than normal whitespace. Even though they are completely invisible in your code editor, the compiler halts with errors like ‘Unexpected token’ or ‘Invalid character’.
Where do invisible characters typically come from?
They are most commonly introduced when copying code snippets from chat clients (Slack, Microsoft Teams, Discord), PDF documents, rich-text WYSIWYG editors, or websites that employ zero-width spaces for text fingerprinting or line-breaking.
Does this tool strip normal spaces or line breaks?
No. Standard ASCII spaces (\u0020), tabs (\t), and newlines (\n, \r\n) are preserved untouched. Only zero-width gremlins, non-breaking spaces, and hidden format control characters are sanitized.
What is a Byte Order Mark (BOM) and why does it break JSON?
A Byte Order Mark (\uFEFF) is placed at the beginning of files by some text editors (especially on Windows) to indicate endianness. The JSON specification forbids leading BOM characters, causing JSON.parse() to throw a SyntaxError.
Privacy & Safety Policy
All tools run completely in your browser via client-side JavaScript. We do not upload your files, interest parameters, or JSON payloads to any server. Your data remains yours.