Home / Guides

Zero-Width Joiner (ZWJ) and Non-Joiner (ZWNJ): What They Do

Published 2026-10-19

The zero-width joiner and the zero-width non-joiner are two invisible characters with opposite jobs. One asks neighbouring characters to connect, and the other asks them to stay apart. They build family emoji, they spell words correctly in Persian, and they control letter shapes in Indian scripts. This guide explains what each one does, when removing them damages text, and how to find them.

ZWJ and ZWNJ at a glance

NameShort formUnicodeHTMLIn a stringEffect
Zero-width joinerZWJU+200D‍"‍"Asks the characters on both sides to join
Zero-width non-joinerZWNJU+200C‌"‌"Asks the characters on both sides not to join

Both are format characters. They have no shape and no width, and they exist only to influence how their neighbours are drawn. They are relatives of the zero-width space, often shortened to ZWSP, which marks a place where a line may break and has nothing to do with joining. That one has its own guide: what is a zero-width space.

What the zero-width joiner does in emoji

Many emoji are not single characters. They are sequences of simpler emoji glued together with zero-width joiners, and a device that knows the sequence draws it as one picture.

EmojiBuilt fromCode points
👨‍👩‍👧man + ZWJ + woman + ZWJ + girlU+1F468 U+200D U+1F469 U+200D U+1F467
👩‍💻woman + ZWJ + laptopU+1F469 U+200D U+1F4BB
👩‍🚀woman + ZWJ + rocketU+1F469 U+200D U+1F680
🏳️‍🌈white flag + variation selector + ZWJ + rainbowU+1F3F3 U+FE0F U+200D U+1F308

If a device does not know a sequence, it falls back to showing the parts next to each other, so the technologist becomes a woman followed by a laptop. The same thing happens when software deletes the joiner: the single picture splits into its pieces.

These sequences also explain some surprising numbers. The family emoji above looks like one character, but it is five code points. In JavaScript its length is 8, and stored as UTF-8 it takes 18 bytes. A form that limits input to a number of characters may count it as one, five or eight, depending on how the limit was programmed.

What the non-joiner does in Persian

Arabic script is cursive: most letters connect to the letter that follows, and a letter changes shape depending on whether it is joined. Persian, which is written in that script, has many words made of parts that belong together as one word but must not be connected in writing. The zero-width non-joiner sits between the parts and keeps them visually separate without adding the gap of a space. In Persian it is known as the half-space.

A common example is the verb prefix that marks an ongoing action. In می‌خواهم (I want), a non-joiner follows the prefix. Without it, the prefix would fuse with the verb; with a normal space, it would look like two words. Plural endings work the same way, as in کتاب‌ها (books).

For Persian readers this is ordinary spelling, not decoration. Text with the non-joiners stripped out is still readable, but it looks wrong in the way that English with the apostrophes removed looks wrong, and searches for the correctly spelled word may no longer match.

What they do in Indian scripts

In Devanagari, the script of Hindi and several other languages, two consonants with no vowel between them normally merge into a combined shape called a conjunct. The merge is triggered by a sign called the virama. A joiner or non-joiner placed after the virama lets the writer choose a different rendering:

SequenceResultMeaning
consonant + virama + consonantक्षThe usual conjunct
consonant + virama + ZWNJ + consonantक्‌षNo conjunct; the virama is shown
consonant + virama + ZWJ + consonantक्‍षA half form of the first consonant, where the font has one

Other scripts of South Asia rely on the same two characters. Sinhala uses the joiner inside common conjuncts, including the one in the word ශ්‍රී (Sri). Bengali and Malayalam use them to select particular letter forms. The exact result always depends on the font.

Other uses

When removing them breaks text, and when it helps

Because they are invisible, these characters are often swept up by tools that strip everything unusual. That is harmless in some texts and destructive in others.

TextEffect of removing ZWJ and ZWNJ
Emoji sequencesFamily, profession and flag emoji fall apart into their components
Persian and other languages written with the non-joinerWords are misspelled and parts fuse together
Devanagari, Bengali, Sinhala, Malayalam and related scriptsLetter forms change, and some words become incorrect
Plain English and most other Latin-script textNothing visible changes; hidden mismatches disappear

In the last row the characters are almost always accidents. They arrive through copy and paste from web pages, chat apps and documents. There they cause the usual invisible-character problems: a word that search cannot find, two strings that look equal and are not, and a character count that is higher than it should be.

How the AI Text Cleaner treats them

With the option Remove invisible characters switched on, the AI Text Cleaner deletes joiners and non-joiners in ordinary text and keeps a joiner that sits directly between two emoji, so family and flag emoji stay whole. Two limits follow from that rule, and you should know them:

The list Characters found in your text counts every joiner and non-joiner in what you pasted, including the ones inside emoji that the cleaner keeps.

How to find them yourself

In a code editor

Turn on regular expressions in the search box and look for [‌‍]. Visual Studio Code accepts that pattern and also highlights many invisible characters on its own.

On the command line

This prints each line of a file that contains either character, with its line number:

perl -CSD -ne 'print "$.: $_" if /[\x{200C}\x{200D}]/' file.txt

In Python

for i, ch in enumerate(text):
    if ch in "‌‍":
        print(i, f"U+{ord(ch):04X}")

In a spreadsheet

This counts the joiners in cell A1. Use 8204 for the non-joiner.

=LEN(A1) - LEN(SUBSTITUTE(A1, UNICHAR(8205), ""))

How to type them

The key for the non-joiner depends on the keyboard layout: Persian layouts have their own key or combination for it, and many phones show it on the symbols page. In HTML, write ‌ or ‍. In Microsoft Word on Windows, type the code 200C or 200D and press Alt + X. Emoji keyboards insert the joiners for you when you pick a combined emoji.

Quick answers

What is the difference between ZWJ and ZWNJ? The joiner, U+200D, asks neighbouring characters to connect. The non-joiner, U+200C, asks them not to. Neither is visible.

Is a zero-width joiner the same as a zero-width space? No. The zero-width space, U+200B, marks a possible line break. It does not join or separate letter shapes.

Is it safe to delete zero-width joiners? In plain English text, yes. In text with combined emoji, Persian or Indian scripts, deleting them changes how the text looks and can make it incorrect.

Try it on your own text. Paste text and see how many joiners and non-joiners it contains. Open the AI Text Cleaner

Related guides