Home / Guides

Zero Width Non Joiner (ZWNJ): Uses, Typing and Removal

Published 2026-11-06

The zero width non joiner, or ZWNJ, is the invisible character U+200C. It tells two neighbouring letters not to connect. In Persian and some Indian scripts it is a normal part of spelling, and in English text it is almost always an accident. That split decides what to do about it: keep it where it belongs, remove it where it does not. This guide covers what it is, where it comes from, how to find it, and how to clean a text without breaking the languages that need it.

What is the zero width non joiner?

The zero width non joiner is a format character. It has no width and draws nothing. Its only job is to break a connection between the characters on either side of it. The character that does the opposite, the zero-width joiner, is explained alongside it in our guide to the ZWJ and ZWNJ; this guide concentrates on the non-joiner and on what to do with it.

FactValue
NameZERO WIDTH NON-JOINER, short form ZWNJ
Code pointU+200C, decimal 8204
Unicode categoryFormat character (Cf)
UTF-8 bytesE2 80 8C
HTML‌, ‌ or ‌
In code"\u200c" in Python, "\u200c" in JavaScript

It is not the same as the zero-width space, U+200B, which marks a place where a line may break. The non-joiner is about letter shapes, not line breaks.

Where the ZWNJ is correct

In Persian, many words are built from parts that belong to one word but must not be joined in writing. Persian is written in a cursive script, so letters would connect by default. A ZWNJ keeps them apart without adding the wider gap of a space. Persian speakers call it the half-space. It appears in verb forms such as می‌روم (I go) and in plurals such as خانه‌ها (houses). Take the ZWNJ out and the word is misspelled: the parts either fuse together or, if a space is typed, look like two words.

In Devanagari, the script of Hindi, a ZWNJ placed after the virama sign stops two consonants from merging into a conjunct. Related scripts of South Asia use the same trick. The details and a sequence table are in the ZWJ and ZWNJ guide.

Where the ZWNJ turns up by accident

Because it draws nothing, nobody notices it until a symptom appears: a word that search cannot find, two strings that look equal and are not, or a character count that is one too high. Zero-width characters can also be used on purpose to hide a few bits of data inside text, which is one more reason to clean text from sources you do not trust.

One programming detail catches people out: in JavaScript, both the ZWNJ and the ZWJ are allowed inside identifiers after the first character. A variable name pasted from a web page can contain one and still be valid code, which makes it very hard to spot.

Should you remove it?

Your textRemove the ZWNJ?Why
English or other Latin-script textYesIt carries no meaning there and causes mismatches
Persian textNoIt is part of correct spelling
Hindi, Bengali, Sinhala and similar scriptsNoIt chooses letter forms
Code, file names, identifiersYesIt hides in names and breaks matching
Data going into a database or search indexUsuallyFor Latin text, yes. For Persian or Hindi fields, keep it and search with it in mind

How to find it

  1. Use the cleaner. Paste the text into the AI Text Cleaner. The list titled Characters found in your text shows "zero-width non-joiner" with a count.
  2. Use a spreadsheet. This counts the ZWNJ characters in cell A1: =LEN(A1) - LEN(SUBSTITUTE(A1, UNICHAR(8204), "")).
  3. Use Python. This prints each position: [i for i, ch in enumerate(text) if ch == "\u200c"].
  4. Use the command line. This prints each matching line with its line number: perl -CSD -ne 'print "$.: $_" if /\x{200C}/' file.txt.

How to type it

How to remove it and keep everything else

The cleaner's Remove invisible characters option deletes a ZWNJ everywhere except directly between two emoji. It does not look at the language of the text. That is the right result for English and the wrong one for Persian. The same option also removes direction marks, which Persian text sometimes needs.

For Persian or Hindi text, do this instead:

  1. Switch off Remove invisible characters.
  2. Keep Replace unusual spaces on. It works on its own and does not touch the ZWNJ.
  3. Remove only the unwanted characters with your own pattern, which leaves ZWNJ in place:
import re
# remove zero-width space, word joiner, byte order mark and soft hyphen
text = re.sub("[\u200b\u2060\ufeff\u00ad]", "", text)

To remove the ZWNJ itself from English text without the cleaner:

# Python
text = text.replace("\u200c", "")
// JavaScript
text = text.replace(/\u200c/g, "");

In a spreadsheet: =SUBSTITUTE(A1, UNICHAR(8204), "").

Common mistakes

Quick answers

Is the ZWNJ visible? No. It has no width. Some editors can show it with a marker; the cleaner lists it by name.

Does it count as a character? Yes. Its length is 1 in Python and JavaScript, so it raises a character count by one.

Is it a space? No. White-space checks such as trim do not remove it.

Cleaning mixed text? The cleaner deletes the ZWNJ in ordinary text, so switch off Remove invisible characters if your text is Persian or Hindi. Open the AI Text Cleaner

Related guides