Article 4 min read

Invisible character finder: zero-width spaces, BOM and hidden characters explained

Oct 29, 2026 6 views
Invisible character finder: zero-width spaces, BOM and hidden characters explained

TL;DR

Find hidden characters in pasted text: zero-width spaces, joiners, BOM, non-breaking spaces, soft hyphens and direction controls, with a cleaned copy.

Table of Contents

    Hidden characters in 30 seconds

    Zero-width space U+200B Splits one word into two for search
    Byte order mark U+FEFF At a file start it is a signature, inside text it is stray
    Non-breaking space U+00A0 Looks like a space, never matches one
    Joiners U+200C and U+200D Check first: they belong in emoji and some scripts

    Open Cubbbix Invisible Character Finder.

    You copy a name from a chat, paste it into a form, and the form says it does not match. You paste code into an editor, and the editor reports an error on a line that looks clean. Nothing is wrong with your typing. The string contains a character you cannot see. The free Cubbbix Invisible Character Finder scans pasted text and names every hidden character it finds, with its code point, its position and what to do about it.

    The usual suspects are few. Zero-width space (U+200B) adds a line-break chance with no visible gap, and it splits one word into two for search, spellcheck and string comparison. Zero-width non-joiner (U+200C) stops two letters joining, which Persian and Arabic spelling needs. Zero-width joiner (U+200D) joins emoji into one picture. Byte order mark (U+FEFF) at the start of a file is an encoding signature, but inside text it is a stray character that breaks parsers and shifts the first column heading of a CSV.

    Dark green graphic with a magnifier and the words Hidden Characters

    Figure 1: The scan names each hidden character, so you fix the exact code point instead of retyping and hoping.

    Spaces that are not spaces

    Non-breaking space (U+00A0) and narrow no-break space (U+202F) look like spaces but never match a plain space in find and replace. Soft hyphen (U+00AD) stays hidden until a line wraps, then turns into a hyphen nobody typed. The other space variants (U+1680, U+2000 to U+200A, U+205F, U+3000) all read as a space to you and as something else to software. Word joiner (U+2060) blocks a line break without adding visible space. The cleaned copy from the tool turns all of these into plain spaces, which is the fix for pasted text in almost every case.

    Trim does not fix any of this. Trim removes whitespace at the ends of a string, and most of these characters are not whitespace in that sense, or they sit in the middle of the string. A zero-width space in the middle of a username survives trim, survives a visual check, and still makes two identical-looking strings compare as different. The fix is to find the exact code point, not to retype the text.

    Dark green graphic with a magnifier and the words Not A Space

    Figure 2: A non-breaking space looks like a space and never matches one in find and replace.

    When to keep a flagged character

    Do not delete blindly. Keep a joiner when it sits between emoji or inside an Arabic, Persian or Indic word: removing it changes the spelling or breaks the emoji. Keep a variation selector after an emoji, since it picks the colour emoji form. Keep a non-breaking space when it is doing typography work, such as keeping a number with its unit. Direction controls (U+202A to U+202E and U+2066 to U+2069) are different: they can make code display in a different order from how it runs, the Trojan Source trick, so any of those in code from an untrusted source should be treated as suspicious, not just cleaned quietly.

    Dark green graphic with a magnifier and the words Check First

    Figure 3: Joiners inside emoji and some scripts are doing a job. Flag them, do not delete them blindly.

    Questions people ask

    What is a zero-width space?

    Unicode character U+200B, an invisible line-break chance with no visible gap. It sneaks in from chat apps, copied web pages and rich-text editors, and it splits one word into two for search and string comparison.

    Why does pasted code fail with an invisible character error?

    Because a character such as U+200B or U+FEFF landed outside a string, where the language parser does not expect it. The fix is to find and remove that exact code point.

    Should I remove zero-width joiners too?

    Not blindly. U+200D joins emoji into one picture and joins letters in Arabic, Persian and Indic scripts. Inside a real emoji sequence or a word in those scripts, it is doing its job.

    Was this article helpful?

    Comments

    Loading comments...