Identify blank and invisible characters by their Unicode codes

How to tell a normal space from no-break, zero-width, braille-blank and Hangul filler characters by code point, and when an invisible character is the wrong choice.

A character that looks blank is not necessarily a space. Unicode contains dozens of code points that render as empty space, render as nothing at all, or quietly change how neighboring text behaves. They can look identical on screen and still behave very differently when text is searched, trimmed, wrapped, copied or read aloud. The reliable way to tell them apart is the code point, written as U+ followed by a hexadecimal number. This review explains what each family of blank characters does, how to identify one, and how to judge whether using one suits your purpose.

Is an invisible character right for your use?

Invisible and blank characters are worth using when they solve a specific typographic or linguistic problem. Examples include keeping a number and its unit on one line, allowing a line break inside a long identifier, or joining or separating letters in scripts that need it. In those cases the character carries meaning that plain spaces cannot express. The main tradeoff is predictability. Whether a blank character is kept, stripped, trimmed, collapsed or rejected depends on the software that receives it, and you usually cannot see from the screen which one happened.

  • Reasonable fits: a no-break space (U+00A0) between a value and its unit, or in a name that should not wrap
  • Reasonable fits: thin, hair, figure or narrow no-break spaces for typographic spacing and digit alignment
  • Reasonable fits: a zero-width non-joiner (U+200C) in Persian and other scripts where it is part of correct spelling
  • Reasonable fits: a zero-width joiner (U+200D) inside emoji sequences and in scripts that rely on it
  • Reasonable fits: a zero-width space (U+200B) to permit a line break in a long string without showing a space
  • Poor fits: making a username, profile field or message look empty
  • Poor fits: getting around length limits, duplicate checks, word filters or required-field rules
  • Poor fits: fake indentation or alignment in places where real layout controls exist

Plain text is the better choice when the content must be searchable, editable by other people, processed by scripts, read by assistive technology, or accepted by a form or platform you do not control. If an ordinary space, a line break, or simply leaving a field empty does the job, it is the safer option.

What an invisible character actually changes

Inserting a blank or invisible character changes the stored text. A new code point sits in the string, so its length, byte content and comparison results all change, even when nothing visible changes. This is different from visual spacing created by CSS margins, padding, letter-spacing or the white-space property. Those settings affect only how the text is displayed, and they disappear when the text is copied out as plain text.

HTML adds another layer. By default, browsers collapse runs of ordinary spaces (U+0020) into a single space, but they do not collapse no-break spaces or the other Unicode space characters. This is why people type no-break spaces to force extra visible gaps on web pages. The extra spacing then becomes part of the text rather than part of the styling.

Directional control characters are a special case. Marks such as the left-to-right mark (U+200E) and right-to-left mark (U+200F), and the embedding, override and isolate controls, change the order in which characters are displayed. They do not change the order in which the characters are stored. Text that appears reversed on screen because of a right-to-left override is still stored in its original order. A search, a copy into a plain editor, or a program reading the string will see that original order. This is a common source of confusion when people describe text as reversed or mirrored.

Invisible characters also matter to reverse and mirror text tools. Reversing a string one code point at a time can split a zero-width-joiner emoji sequence into separate emoji. It can also detach combining marks from their base letters and move directional marks to positions where they affect different text. If a transformation includes reversal, test it with input that contains these characters.

The main families of blank and invisible characters

ASCII: one printable blank and a set of control codes

In ASCII, the only printable blank character is the space, decimal 32 (hexadecimal 20, U+0020). The other invisible ASCII codes are control characters, such as tab (9), line feed (10), carriage return (13), and the rarely used null (0) and delete (127). Control characters are meant to direct devices and software, not to be displayed. Many destinations strip or reject them. A request for a blank ASCII character other than the space usually leads to Unicode, because ASCII has no other invisible printable characters.

Unicode space separators

Unicode groups visible-width spaces in the Space Separator category (Zs). Besides the ordinary space, this category includes the no-break space (U+00A0) and a run of typographic spaces from U+2000 to U+200A. That run covers the en quad, em quad, en space (U+2002), em space (U+2003), the three-, four- and six-per-em spaces, the figure space (U+2007, matching the width of a digit), the punctuation space, the thin space (U+2009) and the hair space (U+200A). The category also includes the narrow no-break space (U+202F), the medium mathematical space (U+205F) and the ideographic space (U+3000), which is used in East Asian text and is as wide as a CJK character. Actual widths depend on the font.

Zero-width and format characters

Format characters (category Cf) take up no visible width but affect line breaking, joining or direction. This family includes the zero-width space (U+200B), zero-width non-joiner (U+200C), zero-width joiner (U+200D), word joiner (U+2060) and the zero-width no-break space (U+FEFF). U+FEFF also serves as the byte order mark at the start of a file. The soft hyphen (U+00AD) is related. It is usually invisible but may appear as a hyphen when a line breaks at its position. The Mongolian vowel separator (U+180E) was once classified as a space but was later reclassified as a format character, so older references may list it differently.

The phrase half space is ambiguous. In Persian typing it usually means the zero-width non-joiner, which separates parts of a word without inserting a full space. Elsewhere, people use the phrase for narrower typographic spaces such as the en space or thin space. Check which one is meant before choosing a code point.

Characters that look blank but are not spaces

Some characters often shared as an empty character are not whitespace by any Unicode definition. The braille pattern blank (U+2800) is a braille symbol representing a cell with no raised dots. It is classified as a symbol. The Hangul filler characters (U+115F, U+1160, U+3164 and the halfwidth U+FFA0) exist to support Korean text encoding and are classified as letters. Because software treats these characters as ordinary content rather than spaces, they often get past trimming and empty-field checks. That is why they circulate as blank text characters, and also why some platforms specifically filter them.

Line, paragraph and direction controls

The line separator (U+2028) and paragraph separator (U+2029) are Unicode's own break characters. Support for them varies, and some programming contexts treat them as line terminators. The directional marks (U+200E, U+200F, and the Arabic letter mark U+061C) and the bidirectional embedding, override and isolate controls (U+202A to U+202E and U+2066 to U+2069) are invisible but can rearrange how surrounding text is displayed.

Code point | Name | Category | Unicode White_Space property | Typical purpose
U+0020 | SPACE | Zs | Yes | Ordinary word space
U+00A0 | NO-BREAK SPACE | Zs | Yes | Space that prevents a line break
U+2002 | EN SPACE | Zs | Yes | Typographic space
U+2003 | EM SPACE | Zs | Yes | Wider typographic space
U+2007 | FIGURE SPACE | Zs | Yes | Aligning digits
U+2009 | THIN SPACE | Zs | Yes | Narrow typographic space
U+200A | HAIR SPACE | Zs | Yes | Very narrow space
U+202F | NARROW NO-BREAK SPACE | Zs | Yes | Narrow space that prevents a break
U+3000 | IDEOGRAPHIC SPACE | Zs | Yes | Full-width space in CJK text
U+200B | ZERO WIDTH SPACE | Cf | No | Invisible line-break opportunity
U+200C | ZERO WIDTH NON-JOINER | Cf | No | Prevents joining; Persian half space
U+200D | ZERO WIDTH JOINER | Cf | No | Joins characters and emoji sequences
U+2060 | WORD JOINER | Cf | No | Invisible break prevention
U+FEFF | ZERO WIDTH NO-BREAK SPACE | Cf | No | Byte order mark
U+00AD | SOFT HYPHEN | Cf | No | Optional hyphenation point
U+200E / U+200F | LEFT-TO-RIGHT / RIGHT-TO-LEFT MARK | Cf | No | Directional hint
U+2800 | BRAILLE PATTERN BLANK | So | No | Empty braille cell
U+3164 | HANGUL FILLER | Lo | No | Korean encoding filler

The White_Space column matters in practice. Many trimming, splitting and validation routines rely on this property or on similar rules. Characters marked No in the table are therefore more likely to survive in places where a regular space would be removed. Programming languages differ in detail, so check the documentation for the specific function you rely on.

How to identify a blank character by its code

Looking at the screen will not tell you which character is present. You need to print the code points or the underlying bytes. In Python, the standard unicodedata module reports each character's code point, category and official name:

import unicodedata

text = "a\u200bb\u00a0c"
for ch in text:
    print(f"U+{ord(ch):04X}  {unicodedata.category(ch)}  {unicodedata.name(ch, '<no name>')}")

For that sample string, the output lists U+200B as ZERO WIDTH SPACE in category Cf and U+00A0 as NO-BREAK SPACE in category Zs, between the three letters. Control characters such as tab have no official name, which is why the code supplies a fallback value. In JavaScript, a for...of loop goes through the string one code point at a time, so it can print code points the same way:

const text = "a\u200Bb\u00A0c";
for (const ch of text) {
  console.log("U+" + ch.codePointAt(0).toString(16).toUpperCase().padStart(4, "0"));
}

On the command line, piping text through a hex viewer such as xxd or od shows the raw UTF-8 bytes. The table below lists the byte sequences for common blank characters so you can recognize them in a hex dump.

Character | Code point | UTF-8 bytes
Space | U+0020 | 20
No-break space | U+00A0 | C2 A0
Em space | U+2003 | E2 80 83
Zero-width space | U+200B | E2 80 8B
Narrow no-break space | U+202F | E2 80 AF
Ideographic space | U+3000 | E3 80 80
Byte order mark | U+FEFF | EF BB BF
Braille pattern blank | U+2800 | E2 A0 80
Hangul filler | U+3164 | E3 85 A4

To find invisible characters across a file, a regular expression with Unicode escapes works in tools that support them. One example is GNU grep with Perl-compatible regex support, run in a UTF-8 locale:

grep -nP '[\x{00A0}\x{200B}-\x{200F}\x{2060}\x{FEFF}\x{2800}\x{3164}]' file.txt

Adjust the character list to match what you are looking for. To find a tool for this, search for terms such as Unicode character inspector, code point viewer, show invisible characters or zero-width character detector. Many code editors can also display whitespace and highlight unusual Unicode characters. The relevant setting names vary by editor and version, so check the editor's own settings. This article has not verified any specific tool or setting.

Will the result stay usable after copying or sharing?

When you copy plain text, the code points normally travel with it. What happens at the destination is less predictable. A destination might keep the character, convert it to an ordinary space, strip it, trim it from the ends of a field, normalize it, or reject the input. One successful paste into one app does not show how another app, or a later version of the same app, will behave. Test the exact destination you care about, and test again if that destination changes.

Search and editing are the most common problems. A zero-width space or soft hyphen inside a word can stop it from matching a search for that word. A no-break space can stop two strings from comparing as equal even though they look identical. Moving the cursor through invisible characters can also feel like the text is skipping or sticking. In code, configuration files and data imports, a stray byte order mark or no-break space can cause errors that are hard to find.

Accessibility depends on the screen reader, its settings and the platform. Some invisible characters may be skipped silently. Others may be announced, or may split a word so it is read incorrectly. The braille pattern blank is semantically a braille cell, so assistive technology may treat it differently from a space. No scoped test results were supplied for this review, so no specific screen reader's behavior is claimed here. If accessibility matters, test with the assistive technology your readers use.

Invisible and directional characters can also be used to mislead. Examples include names that look identical but differ underneath, links or labels that display differently from their stored text, and source code where directional controls make the displayed logic differ from what a compiler reads. For shared, published or security-sensitive text, inspect the code points before trusting what you see.

Provide a plain-text equivalent whenever the text will be indexed, quoted, translated, processed by software or read by assistive technology. That usually means using ordinary spaces and real line breaks, and removing zero-width and directional characters that do not serve a linguistic purpose.

What could not be verified

No subject-specific evidence was supplied for this review. There were no destination tests, assistive technology results or tool evaluations. The code points, names, categories and byte sequences above follow the Unicode Standard and UTF-8 encoding rules. How a particular platform, app, font or screen reader handles each character was not tested and will vary. Verify the exact destination before relying on any blank or invisible character.