Breitenloses Zeichen
Zeichen mit der Vorschubbreite null — beim Rendern unsichtbar, aber das Textverhalten beeinflussend. Umfasst ZWSP (Wortumbruch), ZWJ (Verbindung), ZWNJ (Verbindung verhindern) und WJ (Umbruch verhindern).
What is a Zero-Width Character?
A zero-width character is a Unicode character that occupies no visual space when rendered — it is invisible, produces no glyph, and has zero advance width. Despite being invisible, zero-width characters have important semantic functions: they control how text is broken, joined, or displayed. They are essential for correct rendering of Arabic, Hebrew, Indic scripts, and for controlling ligature formation across all scripts.
The three most important zero-width characters are the Zero-Width Joiner (ZWJ), Zero-Width Non-Joiner (ZWNJ), and Zero-Width Space (ZWSP).
The Main Zero-Width Characters
| Character | Unicode | Name | Purpose |
|---|---|---|---|
| ZWJ | U+200D | Zero Width Joiner | Forces joining/ligature between adjacent characters |
| ZWNJ | U+200C | Zero Width Non-Joiner | Prevents joining/ligature between adjacent characters |
| ZWSP | U+200B | Zero Width Space | Allows line break without visible space |
| WJ | U+2060 | Word Joiner | Prevents line break (like NBSP but zero-width) |
| SHY | U+00AD | Soft Hyphen | Invisible hyphenation hint; shows hyphen only if line breaks there |
| BOM | U+FEFF | Byte Order Mark / ZWNBSP | File encoding marker; zero-width non-break space in older usage |
Zero Width Joiner (ZWJ)
The ZWJ (U+200D) tells the text shaping engine to use a joined or ligature form between the surrounding characters, even when they would not normally join.
The most famous modern use is emoji sequences. Many complex emoji are encoded as sequences of simpler emoji joined by ZWJ:
| Sequence | Result |
|---|---|
| 👨 + ZWJ + 💻 | 👨💻 (man technologist) |
| 👩 + ZWJ + ❤️ + ZWJ + 👩 | 👩❤️👩 (couple with heart) |
| 🏳️ + ZWJ + 🌈 | 🏳️🌈 (rainbow flag) |
In Arabic, ZWJ can force a letter into its final-form shape even at mid-word, and in Indic scripts it controls how consonant clusters are rendered.
Zero Width Non-Joiner (ZWNJ)
The ZWNJ (U+200C) has the opposite effect: it breaks joining that would otherwise occur. In Arabic and Persian script, letters normally join to form cursive words — but ZWNJ between two letters prevents them from connecting, showing each in its isolated form. In Indic scripts, ZWNJ prevents conjunct consonant formation.
Example: In Persian, the word "میروم" (I go) uses a ZWNJ after "می" to keep it visually separate from "روم" while still being one word (no space, but no joining).
Zero Width Space (ZWSP)
The ZWSP (U+200B) is invisible and zero-width, but it marks a position where a line break is permitted. It is used in scripts that don't use spaces to separate words — such as Thai, Lao, Khmer, and Tibetan — to give the text renderer a hint about where to break long lines.
It is also used in URLs and long technical strings in HTML to allow wrapping without adding a visible space.
Security Concerns
Zero-width characters are invisible, which makes them exploitable: - Text spoofing: inserting ZWJ/ZWNJ into usernames to create visually identical but technically different strings - Hidden watermarks: embedding patterns of zero-width characters as steganographic markers - Homograph attacks: combined with lookalike characters
Sanitize user input by stripping unexpected zero-width characters from identifiers and URLs.
Quick Facts
| Property | Value |
|---|---|
| Zero Width Joiner | U+200D — forces joining/ligature |
| Zero Width Non-Joiner | U+200C — prevents joining |
| Zero Width Space | U+200B — invisible line-break opportunity |
| Word Joiner | U+2060 — prevents line break (zero-width) |
| Soft Hyphen | U+00AD — visible only when line breaks there |
| ZWJ in emoji | Used in 1,000+ multi-person and multi-component emoji |
| Security risk | Can create invisible text or spoofed identifiers |
| Detection in Python | '\u200d' in text or regex [\u200b-\u200d\ufeff] |
Verwandte Begriffe
Mehr in Typografie
Gepaarte Satzzeichen, die direkte Rede oder Zitate einschließen. Unicode enthält gerade Anführungszeichen …
U+2026 HORIZONTALE AUSLASSUNGSPUNKTE (…). Ein einzelnes Zeichen, das drei Punkte ersetzt, typografisch …
CSS @font-face descriptor specifying which Unicode code points a font should cover. …
Ein Zeichen, das einem Buchstaben hinzugefügt wird, um Aussprache oder Bedeutung zu …
Em: eine Breite gleich der Schriftgröße. En: die Hälfte eines Em. Werden …
The mechanism by which a rendering engine substitutes glyphs from a secondary …
Satzzeichen, die zum Trennen von Satzteilen oder zur Angabe von Bereichen verwendet …
U+00A0. Ein Leerzeichen, das einen Zeilenumbruch an seiner Position verhindert. HTML: . …
Die visuelle Darstellung eines Zeichens, wie sie von einer Schriftart gerendert wird. …
Großbuchstabenformen in der Höhe von Kleinbuchstaben. CSS: font-variant: small-caps. Unicode enthält auch …