Zero width space

U+200B

Paste it with Ctrl+V, or Cmd+V on a Mac.

Unicode name
ZERO WIDTH SPACE
Block
General Punctuation
Category
Format (Cf)
Line breaking
Allows a break (ZW)
Whitespace
No
Since
Unicode 1.1, 1993

U+200B in HTML and code

  • Code pointU+200B
  • HTML named​
  • HTML decimal​
  • HTML hex​
  • CSS content"\200B"
  • JavaScript, JSON, Java, C#"\u200B"
  • Python"\u200b"
  • PHP"\u{200B}"
  • URL encoded%E2%80%8B
  • UTF-8 bytesE2 80 8B
  • Regex (JS, Python, Java)\u200B

Other zero width characters

Four more characters have no width. Each one does a different job, so pick the one that matches what you need.

Zero width non-joiner

U+200C · ‌

Keeps two letters from joining, as some Persian and Hindi words need.

Zero width joiner

U+200D · ‍

Joins characters, such as the emoji that make up a family or profession emoji.

Word joiner

U+2060 · ⁠

Stops a line break between two characters, without adding any width.

Zero width no-break space

U+FEFF

Works as the byte order mark at the start of a file. Inside text, use the word joiner.

Add zero width spaces to text

Paste text and choose where the zero width spaces go. The result looks the same, and each blue bar in the preview marks one.

Result preview

Type or paste text above.

Find and remove zero width spaces

Paste text to find every zero width character in it. Joiners that an emoji or a Persian or Hindi word needs stay in when you copy the clean text.

What it contains
Paste text to check it for zero width characters.It lists every zero width space, joiner and byte order mark it finds.
    Remove

    About the Zero Width Space

    What is a zero width space?

    A zero width space (ZWSP) is an invisible Unicode character, U+200B, that marks where a line may break. It's also spelled zero-width space, and it takes up no room on the screen.

    Unicode lists it in the General Punctuation block. Browsers wrap long words and URLs at it, and the Unicode Standard recommends it for marking word breaks in Thai, Lao, Khmer and Myanmar text, which don't put spaces between words.

    It has no glyph, so text looks the same with or without one. That makes it useful for layout, and it's also why it causes bugs that are hard to see.

    What should you know about U+200B?

    • It isn't whitespace. It doesn't have the Unicode White_Space property, so JavaScript's trim() and Python's strip() and split() leave it in place, and the regex \s doesn't match it.
    • It takes 3 bytes in UTF-8. The bytes are E2 80 8B, so "a", U+200B and "b" make 5 bytes that still look like "ab".
    • It allows a line break but never forces one. A line wraps at it only when the text doesn't fit.
    • HTML has a named entity for it. Write ​, ​ or ​.
    • It's been in Unicode since 1993. It was part of Unicode 1.1, with the zero width joiner and non-joiner.

    How do you copy a zero width space?

    1. Choose how many. Leave it at 1, or enter up to 1,000.
    2. Click the copy button. The note under the button confirms what was copied.
    3. Paste it. Press Ctrl+V, or Cmd+V on a Mac. Nothing shows where you paste it, but it's there.

    How do you type U+200B?

    Standard keyboards have no key for it, so these methods enter it by its code, 200B, or its name.

    How to type U+200B in each app and system
    WhereHow to type it
    Microsoft Word on WindowsType 200B, then press Alt+X
    Linux with GNOMEPress Ctrl+Shift+U, type 200b, then press Space or Enter
    macOSAdd the Unicode Hex Input keyboard and switch to it, then hold Option and type 200B
    HTMLWrite ​ or ​

    How do you use U+200B in HTML and CSS?

    Put ​ where a long word or URL may wrap, such as after each slash. The browser breaks the line there only when it runs out of room.

    The <wbr> element does the same job, and MDN notes that it behaves like U+200B. It adds no character to the text, so a reader who copies the URL gets a working link.

    In CSS, content: "\200B" adds one from a stylesheet, and overflow-wrap: anywhere lets long words wrap with no extra character at all.

    How does U+200B differ from other invisible characters?

    Several characters and one HTML element have no width. They differ in whether they add a line break chance or block one.

    U+200B compared with other invisible characters
    CharacterCode pointLine breakUsed for
    Zero width spaceU+200BAdds a chanceWrap points in long words and URLs, and word breaks in Thai and Khmer
    Zero width non-joinerU+200CNo effectKeeping two letters from joining in Persian and Indic scripts
    Zero width joinerU+200DBlocks one after itJoining emoji into one, such as the family and profession emoji
    Word joinerU+2060Blocks oneKeeping two characters on the same line
    Zero width no-break spaceU+FEFFBlocks oneThe byte order mark at the start of a file
    No-break spaceU+00A0Blocks oneA visible space that keeps two words together
    The <wbr> elementNoneAdds a chanceWrap points in HTML that add no character

    U+FEFF used to be the only word joiner, and the Unicode Standard now strongly prefers U+2060 for joining words in new text.

    Common mistakes

    These mistakes with zero width characters are easy to make and hard to see.

    • Two strings that look the same don't match. An invisible break character in a name or an ID makes it a different string, and trim() doesn't remove it. Replace /\u200B/g with an empty string, or paste the text into Find and remove.
    • Pasted code fails with a syntax error. Python reports "invalid non-printable character U+200B" and Node.js reports "Invalid or unexpected token" when one lands outside a string. Paste the code into Find and remove to see where it is.
    • A copied URL can stop working. ZWSP characters added to a URL for wrapping get copied too, and the browser keeps them in the path as %E2%80%8B. Keep the plain URL in the link, or wrap it with <wbr> instead.

    Common Use Cases

    People reach for ZWSP wherever text needs a break point or a character that shows nothing.

    • Wrapping long URLs and words. Add break points to URLs, file paths and long words in narrow columns and emails.
    • Thai, Lao, Khmer and Myanmar text. Mark where words end so lines wrap between words.
    • Keeping an empty line. A line that holds nothing but a ZWSP isn't empty, so an app that trims lines and drops the empty ones keeps it.
    • Showing @name or #tag as plain text. A zero width character after the @ or # changes how the word is written. Test it in the app first, because each app handles it differently.
    • Testing your own code. Check that sign-up forms, search and comparisons handle a character nobody can see.

    To check text for every kind of hidden character, not only zero width ones, use the Invisible Text Generator. For blank text that shows as a gap, use Blank Text Copy and Paste.

    Frequently Asked Questions

    What is the U+200B character?

    U+200B, known as ZWSP, is an invisible Unicode character that allows a line break without adding space.

    How do you add a zero width space in HTML?

    Write &ZeroWidthSpace;, &#8203; or &#x200B; where the line may break. The <wbr> element gives the same break without adding a character.

    Is there an Alt code for U+200B?

    Not a dependable one, because Windows Alt codes cover ASCII and the Windows code page. In Word, type 200B and press Alt+X instead.

    How do you remove zero width spaces?

    Paste the text into our Find and remove tool and copy it back without them. In JavaScript, text.replace(/\u200B/g, '') removes every U+200B.

    Why does LaTeX say Unicode character U+200B is not set up?

    The source has an invisible character in it, often pasted from a web page or a PDF. pdfLaTeX has no definition for it, so find it with our Find and remove tool and delete it.

    How is a zero width joiner different from U+200B?

    U+200B allows a break between characters, while a zero width joiner joins them. The joiner is what combines emoji such as the family emoji into one.