A Zero Width Space (U+200B) is an invisible Unicode character used to indicate potential line break opportunities within text. It has no visual width, produces no visible symbol, and cannot be detected through normal visual inspection — yet it can break JSON parsing, authentication systems, form validation, and database queries.
Unlike a regular space (U+0020), U+200B does not create spacing. It only signals where a line break is allowed.
Zero width spaces are primarily used in typography and web rendering. They help browsers wrap long strings — such as URLs or continuous characters — without adding visible breaks.
Modern systems that commonly insert U+200B include:
The problem arises when that hidden character is copied into raw code or structured data.
JSON is extremely strict. Only four whitespace characters are allowed:
Zero Width Space (U+200B) is not allowed. If it appears between tokens, JSON.parse() throws:
SyntaxError: Unexpected token
{
"username": "admin"
}
The key visually reads as username, but it actually contains:
u s e r \u200B n a m e
That makes string comparisons fail silently.
Most editors do not display it. However, you can detect it programmatically:
const hasZWSP = /\u200B/.test(inputString);
Or remove it safely:
const cleaned = inputString.replace(/\u200B/g, '');
For quick cleanup, use a dedicated tool:
All tools operate 100% client-side. No data is uploaded.
Zero width spaces cause:
Because the character is invisible, debugging becomes extremely time-consuming.
Regular Space (U+0020):
Zero Width Space (U+200B):
Zero Width Space (U+200B) is a legitimate Unicode formatting character — but in development workflows, it often becomes a hidden bug. When copying text from rich interfaces or AI tools, invisible format characters may enter your codebase silently.
Understanding how U+200B works — and how to remove it — prevents hours of debugging and protects your data integrity.