Browsers & softwarePractical guides

How many characters is one emoji? Check code points, graphemes and byte limits

A single displayed emoji can contain several Unicode code points. Before submitting a bio, label or API field, identify the receiving system’s unit instead of counting visible shapes.

Wooden alphabet blocks with printed letters piled together
Illustrative photo: Megan Qualley · Unsplash License

Key Takeaways

State the limit in explicit units and test a fixed input. A👩‍💻é, without a trailing newline, contains eight UTF-16 units, six code points, three graphemes and 15 UTF-8 bytes. KitNelo reports code points and UTF-8 bytes; its text analyzer does not report graphemes.

In this article

Identify the limit before choosing a count

MDN’s segmentation reference distinguishes grapheme, word and sentence segmentation. A grapheme generally approximates a user-perceived character; a code point represents a different layer. JavaScript string length counts UTF-16 units.

For example, 😀 has one code point, two UTF-16 units and four UTF-8 bytes. 👩‍💻 contains woman, zero-width joiner and laptop code points, usually displayed as one grapheme in a supporting environment. A different font does not automatically change the input bytes.

Audit one original with no trailing newline

Download the fixed UTF-8 text (in this page’s exercise ZIP), read its contents and paste them into the text analyzer. Expect Characters (code points) 6 and UTF-8 bytes 15. Exclude filenames, surrounding quotes and the escape notation in the code below.

The sequence contains A, 👩‍💻, e and combining accent U+0301. The last two code points form one grapheme. This original teaching fixture was recalculated through the current processing function; it does not establish any social platform’s counting policy.

Four counts for the same input
PartUTF-16 units / code pointsGraphemesUTF-8 bytes
A1 / 111
👩‍💻5 / 3111
e + U+03012 / 213
Total8 / 6315

Recalculate in your development environment

const text = "A👩‍💻é";
text.length; // 8
[...text].length; // 6
[...new Intl.Segmenter("en", {granularity:"grapheme"}).segment(text)].length; // 3
new TextEncoder().encode(text).length; // 15
Developer verification code; KitNelo has no grapheme-count selector.

The same-looking accent may have different bytes

String.normalize documentation explains Unicode normalization. NFC on a copy combines this e and accent into é. The complete string then has seven UTF-16 units, five code points, three graphemes and 14 UTF-8 bytes. Similar appearance does not imply identical original bytes or hashes.

Normalize a copy when the receiver explicitly requires it and record the rule. Do not alter order identifiers, passwords, signed material or evidence merely to reduce a count. Compatibility normalization NFKC can make other substitutions and is not interchangeable with this NFC example.

Verify against the actual receiving system

KitNelo’s count does not determine another system’s limit. If a field merely says “10 characters,” consult its documentation or use a non-sensitive control to identify the rejection condition. Record the submitted value, stated unit and error. Six code points do not guarantee acceptance under a ten-byte limit.

For encoding failures, continue with the URL and Base64 checks. For an encoded image upload, use the Base64 size budget. Deleting an accent or emoji would conceal the counting mismatch.

Further reading & sources

Put the guide into practice

Open the relevant tool, preview the result and check your exported file.