Emoji and Unicode: How Characters Are Really Counted
One emoji can be 1 character, 2 units or 4 bytes. Here is why, and which number matters.
By the Universal Character Counter Team
One symbol, many numbers
Ask three programs how long the thumbs-up emoji is and you may get 1, 2 and 4. All three are right, because each is counting something different. Text on a computer is stored in layers, and each layer has its own unit: what the reader sees, the code points of the Unicode standard, the code units of an encoding and the bytes in a file.
Most of the time the differences are invisible. They show up with emoji, accented letters and scripts such as Japanese, which is where limits on length become confusing.
Characters, code points and grapheme clusters
Unicode assigns a number, called a code point, to each symbol. A grapheme cluster is the unit a reader perceives as a single character, and it can be made of several code points. The Unicode standard on text segmentation describes it as the best approximation of a user-perceived character.
Examples from the standard include a letter followed by a combining accent, Hangul syllables built from several parts, and flags, which are made of two regional indicator symbols. An emoji family is also one visible symbol that is built from several emoji joined together.
Code units and the JavaScript length
JavaScript stores strings as UTF-16 code units. A character outside the basic range, such as most emoji, needs two code units, so the property length reports 2 for a single emoji. A family emoji built from several parts can report 8 or more.
Programs written in other languages count differently. Python counts code points, so a single emoji is 1 but a family is 5. A counter that follows what the reader sees uses grapheme clusters, and in a modern browser this is available through the Intl.Segmenter interface, which is what this counter uses.
Bytes and UTF-8
A file stores text as bytes. In UTF-8, the encoding used on most of the web, a basic Latin letter takes 1 byte, an accented letter such as é takes 2, a Japanese character takes 3 and an emoji takes 4. A limit given in bytes therefore allows fewer emoji and Japanese characters than English letters.
Databases, some interfaces for developers and some social networks measure in bytes or code units, which is why a text that looks short can be rejected. This counter shows the size of your text in UTF-8 bytes in its details so you can check such limits.
How platforms count
Platforms choose their own measure. X assigns a weight to each character, and every emoji counts as 2. Some interfaces for Threads measure in bytes. SMS switches to a 16-bit encoding as soon as an emoji appears. None of this follows the visible count, so a platform’s own counter is the final word.
A visible count is still the best figure for planning because it is the one you can see and reason about. Add a margin when the text contains emoji.
Combining accents and normalisation
An accented letter such as é can be stored as one code point or as a letter plus a combining accent. Both look identical. Counting by code points gives 1 for the first and 2 for the second, while counting by grapheme clusters gives 1 for both.
The Unicode standard defines normalisation forms that make these equal, and many systems apply them. If two texts look the same but a tool reports different lengths, differing normalisation is a likely cause.
Hidden characters
Some characters are invisible: the zero-width space, the zero-width joiner used to join emoji and the byte-order mark at the start of some files. They have no width on screen but they are in the text, and tools disagree about whether to count them.
If a count looks higher than expected, copy the text into a plain-text editor or retype a suspicious section. Text copied from web pages and chat tools is the most common source of hidden characters.
A worked example
Take the text “Café 👍”. Seen by a reader it has 6 visible characters: C, a, f, é, a space and the thumbs-up. A tool that counts UTF-16 code units reports 7, because the emoji takes two. A tool that counts bytes in UTF-8 reports 10: three for the plain letters, two for é, one for the space and four for the emoji.
Each number is correct for its purpose. Only the first matches what a person would count by eye, which is why this counter reports it first and shows the byte count separately in the details.
Why this matters for writers
Most writers never need to think about code points. The practical lesson is simpler: when a limit looks wrong, ask what is being counted. A form that says 100 characters but rejects 60 may be counting bytes, and a post with five emoji may use more of the limit than five characters.
Keep a small margin whenever a text includes emoji, symbols or non-Latin letters, and test the final version in the real system rather than relying on a count made elsewhere.
Which count to use
- Writing for readers or planning a post: visible characters.
- A limit given in characters: visible characters, with a margin for emoji.
- A limit in bytes, for a database or an API: UTF-8 bytes.
- SMS: follow the 160 and 70 rules.
When you do not know which measure a system uses, test with a short text containing one emoji and see what the system reports.
Count your text now
→ universalcharactercounter.com