Zero Width Space (U+200B)

Zero Width Space is a format character with no width that marks where a line may break, without adding a visible gap.

Updated By Milind Sahu How we test

Copy tool
U+200B, 3 bytes

U+200BCf · formatzero width

Need the code?HTML, CSS, JS escapesFind it in text

How we test

An app result is shown only after a hand test on a named app version, with the date. Results older than 120 days are hidden until re-tested.

Read the method →

What is the Zero Width Space used for?

The Zero Width Space (U+200B) is used to mark where a line may break without adding a visible gap. It lets long URLs and words with no spaces wrap, and it separates words invisibly. It has no width and draws nothing, which is also why it slips unnoticed into copied text and breaks searches.

The Unicode names list says it is intended for invisible word separation and for line break control. It is commonly abbreviated ZWSP, sits in the General Punctuation block and dates from Unicode 1.1.

It belongs to category Cf (format) and is not whitespace, so trim() and \s don't remove it. It is Default Ignorable, which tells renderers to draw nothing.

Its line break class is ZW, so a break is allowed right after it. That lets long URLs or words without spaces wrap, much like the HTML wbr element.

Because it has no width and no glyph, it can end up in copied text unnoticed. There it breaks exact searches, string comparisons and code.

Watch out for

  • Two words joined by a ZWSP look like one word but don't match it in an exact search.
  • In HTML write it as ​, and in JavaScript as \u200B.
  • In UTF-8 it takes 3 bytes (E2 80 8B). To find and remove it, paste the text into the detector.

Sources: Unicode names list (NamesList.txt) · Unicode line breaking (UAX #14) · Unicode derived properties (DerivedCoreProperties.txt) · Unicode blocks (Blocks.txt) · Unicode version each character arrived (DerivedAge.txt) · Unicode character data (UnicodeData.txt) · Unicode properties (PropList.txt) · ECMAScript: white space · HTML: the wbr element · Computed from the character itself (see Codes and escapes)

Codes and escapes

FormatValueCopy
HTML entity ​ · ​
CSS \200B
JavaScript / Java \u200B
Python \u200B
URL-encoded %E2%80%8B
UTF-8 bytes E2 80 8B

Properties

Unicode category
Cf (Format)
Treated as whitespace
No
Width
Zero
Unicode name
ZERO WIDTH SPACE

Where it works

Not tested yet. Results appear here with the app version and date once each app is tested by hand.

Similar characters

Back to all 13 invisible characters

FAQ

What character is 0x200B?

The character 0x200B is the Zero Width Space, U+200B. It is a format character with no width that marks where a line may break. In UTF-8 it is the bytes E2 80 8B, in HTML ​, and in JavaScript \u200B. Copy it with the button at the top of this page.

How do I remove zero width spaces from text?

To remove zero width spaces from text, paste it into the detector, which marks each U+200B and deletes them in one tap. In code, use text.replace(/\u200B/g, ''). trim() won't catch them, because ECMAScript doesn't count U+200B as white space, even at the ends of a string.

What is the difference between a zero width space and a normal space?

The main difference between a zero width space and a normal space is width. U+200B takes up no room and isn't whitespace, so words around it look joined, while U+0020 adds a visible gap and is whitespace. Both allow a line break at their position.