Zero Width Space

Copy a zero width space (U+200B) to your clipboard.

Zero width space character details

NameZero width space (ZWSP)
UnicodeU+200B
Decimal8203
CategoryCf (Format)
UTF-8E2 80 8B
UTF-16200B
HTML​ or ​
CSS\200B
JavaScript / JSON\u200B
Python\u200b

Other invisible characters

NameUnicodeHTMLCopy
Zero width spaceU+200B​
Zero width non-joinerU+200C‌
Zero width joinerU+200D‍
Word joinerU+2060⁠
Zero width no-break space (BOM)U+FEFF
Soft hyphenU+00AD­
Left-to-right markU+200E‎
Right-to-left markU+200F‏
Mongolian vowel separatorU+180E᠎

Detect and remove zero width spaces

Paste some text to check it.

How to use the zero width space

Press Copy zero width space and paste it anywhere: between words to allow a line break, into an empty field that rejects blank input, or inside a hashtag or mention to stop it from linking. The table lists other invisible characters with their Unicode code points and HTML entities.

How to type a zero width space

  • Word on Windows: type 200B, then press Alt+X.
  • Mac: add the Unicode Hex Input keyboard in System Settings, then hold Option and type 200B.
  • HTML: ​
  • CSS content: content: "\200B"
  • JavaScript, JSON and Python: "\u200B"

How to remove zero width spaces

Paste your text into the box above. The tool counts every zero width space, joiner, byte order mark, soft hyphen and direction mark it finds, and Remove invisible characters strips them all. In code, replace them with a regular expression:

  • JavaScript: text.replace(/[\u200B-\u200D\u2060\uFEFF]/g, '')
  • Python: re.sub('[\u200b-\u200d\u2060\ufeff]', '', text)

FAQ

What is a zero width space?

A zero width space (ZWSP) is the invisible Unicode character U+200B. It takes up no room on screen, but tells the browser where a long word or URL may break onto the next line.

How do I copy and paste a zero width space?

Press Copy zero width space at the top of this page, then paste it with Ctrl+V, or Cmd+V on a Mac. It is invisible, so nothing seems to appear, but the character is there.

Is there an Alt code for the zero width space?

No. Windows Alt codes do not reach U+200B. In Word, type 200B and press Alt+X. On a Mac, switch to the Unicode Hex Input keyboard, hold Option and type 200B. Or copy it from this page.

How do I add a zero width space in HTML?

Write &#8203; or &#x200B; in your markup. If you only want to allow a line break inside a long word, the <wbr> element does the same job and is easier to spot in your code.

What is the difference between a zero width space and a zero width no-break space?

A zero width space allows a line break. The zero width no-break space (U+FEFF) and the word joiner (U+2060) prevent one. U+FEFF is mostly used as a byte order mark at the start of a file, so use the word joiner to keep two words together.

Why does my code break on a character I cannot see?

Text copied from chat apps, PDFs, Word and web pages often carries zero width spaces or a byte order mark. Compilers and JSON parsers reject them, and JavaScript trim() does not remove U+200B. Paste the text above to find and remove them.

Does removing invisible characters break emoji?

No. The zero width joiner that glues emoji like 👨‍👩‍👧 together is kept. Only joiners outside emoji sequences are removed.