Illustration of an open notebook with a pencil, a speech bubble and blocks of increasing height.

What Zero-Width Characters Do to Your Text

A zero-width character occupies no space on the page and shows nothing when selected, yet it is a character like any other. Text editors, search boxes, and databases treat it as data. That gap between how it looks and how it behaves is the whole source of the trouble.

The Invisible Character Cleaner lists and removes them. This article explains what the main ones are for, so you can tell a stray character from one that is doing real work.

Quick answer

Zero-width characters are Unicode code points that render with no visible width. The zero-width space marks a place where a line may break without inserting a hyphen. The zero-width joiner and non-joiner control whether adjacent characters combine, which matters for Arabic and Indic scripts and for emoji sequences. Outside those uses they are noise, and they make otherwise identical strings fail to match.

The zero-width space

Its purpose is to offer a line-breaking opportunity where there is no space. A long URL or a compound word gets a zero-width space so a browser or word processor can wrap it without adding a hyphen. Used that way it is helpful, because the alternative is an overflowing line.

It becomes a problem when it is copied along with the text. The visible word is unchanged, but the string now contains a character a search will not expect. Two identical-looking words can produce different matches, and the difference cannot be seen.

The joiners

The zero-width joiner tells the renderer to keep two characters together as a single grapheme. It is what holds together many multi-person emoji, and in some scripts it selects a particular letter form. The zero-width non-joiner asks for the opposite: keep them apart.

This is the case where removal does real damage. Strip a joiner from an emoji sequence and a single symbol becomes several. Strip one from certain scripts and the letter shape changes, or the word becomes misspelled. A cleaner should let you see what it will remove before you accept it.

The other invisible marks

Bidirectional control marks tell a renderer which direction a run of text should flow. They exist so right-to-left and left-to-right text can be mixed correctly on one line. They are close to essential in some documents and pure noise in others.

A soft hyphen is a hint that a word may be hyphenated at that point if it falls at a line ending. Copy that into a plain field and the character stays, invisible, waiting to appear when something else wraps the text.

Why they survive copying

Copying takes the underlying characters, not the rendered appearance. A web page, a PDF, or a chat client may place these characters in its text to control layout, and the clipboard carries them along. The receiving field has no idea they were structural, so it stores them as content.

Most of the time this is harmless. It matters when the text is used for exact matching, for length counting, or for code. If you handle any of those, stripping the characters on arrival is more reliable than hoping the source was clean.

For the practical cleanup, see How to Remove Invisible Characters from Copied Text. For the failures this causes in everyday tools, see Why Copied Text Breaks Forms and Searches.

Paste the text into Invisible Character Cleaner and check what it reports before removing anything, especially if the text contains emoji or non-Latin script.

Common questions

Are zero-width characters visible in any way?

No. They occupy no visual width and show nothing when selected. Their presence is only detectable by counting characters, comparing strings, or using a tool that lists code points. That gap between appearance and behaviour is what causes confusion.

What is the zero-width space for?

It marks a place where a line may break without inserting a hyphen, which is useful for long URLs and compound words. Used deliberately it prevents an overflowing line. Copied accidentally into a search field, it makes an otherwise identical string fail to match.

Do emoji use zero-width characters?

Many do. The zero-width joiner combines separate symbols into a single sequence, which is how multi-person emoji and some profession emoji are built. Removing the joiner splits one symbol into several, so check the result before cleaning text that contains them.