Counting characters: SMS, X, YouTube titles and emoji

Updated:

“How many characters is this?” has more than one answer, because each system counts something different: what you see, the code points behind it, or the bytes it takes to send. A waving hand 👋 is one character on screen and two for JavaScript; an SMS with one accented letter holds 70 characters instead of 160. This guide explains the rules the counts come from.

What a “character” is

What you see as one character, a grapheme, can be several Unicode code points, and each code point one or two UTF-16 code units. JavaScript’s length counts code units, so 👋 has a length of 2. The family emoji 👨‍👩‍👧 is one grapheme made of five code points (man, joiner, woman, joiner, girl) and eight code units. Even “café” can be four code points or five, with the accent stored separately; most systems normalise it to four.

A good counter counts graphemes, what a reader sees. Spreading a string into code points or using Intl.Segmenter, as MDN describes, gets there; length alone does not.

Character counter

SMS: 160, 70, 153 and 67

An SMS carries at most 140 bytes of text. With the GSM alphabet, 7 bits per character, that is 160 characters; as soon as one character is outside it, the whole message switches to UCS-2, 2 bytes per character, and holds 70. A few GSM characters take two places because they need an escape: € [ ] { } ^ ~ \ |.

Longer texts are sent in parts, and each part spends 6 bytes on a header that tells the phone how to join them, which leaves 153 GSM characters or 67 UCS-2 characters per part.

MessageFits in one SMSPer part when split
Only GSM characters160153
At least one other character (an emoji, ó, ã, ê)7067

So 161 GSM characters need 2 parts and 307 need 3; with an emoji, 71 characters already need 2. The French and Spanish accents are the usual trap: à, è, é, ì, ò and ù are in the GSM alphabet, but á, ó, ú, â, ê, ô, ã and õ are not, so “canción” or “não” switches the message to 70.

Limits on X, YouTube and in Google

WhereLimitHow it counts
Post on X280Latin, Greek, Cyrillic, Arabic and most other alphabets 1; Chinese, Japanese and Korean 2; every emoji 2, even a family; every link 23
YouTube video title100Characters
YouTube description5,000Characters
Meta description for GoogleNo limitGoogle cuts the snippet to fit the screen and often writes its own from the page

On X a post of plain Latin text can use all 280 characters, but one in Japanese only 140, and a link always costs 23 however long it is.

Why two counters give different numbers

Frequently asked questions

Why did my SMS drop to 70 characters?

Because one character in it is not in the GSM alphabet: an emoji, a curly quote or an accent such as ó or ã. The whole message is then sent in UCS-2, which fits 70 characters, or 67 per part.

Why does € count as two in an SMS?

It is in the GSM extension table, which is reached with an escape character, so it takes two of the 160 places. The same goes for [ ] { } ^ ~ \ and |.

Do spaces count?

In an SMS, a post on X and a YouTube title, yes: a space is a character like any other. The character counter shows the count with and without them.

How long should a meta description be?

Google sets no limit and cuts the snippet to fit the screen, and it often writes its own from the page. Put the important words first, so they survive the cut.

Why does JavaScript say 2 for one emoji?

Because length counts UTF-16 code units, and most emoji take two. Count graphemes instead, for example with Intl.Segmenter, and 👋 is 1.

References

  1. 3GPP TS 23.040 — Technical realization of the Short Message Service (SMS)
  2. 3GPP TS 23.038 — Alphabets and language-specific information
  3. X Developer Platform — Counting characters
  4. YouTube Help — Edit video settings
  5. Google Search Central — Control your snippets in search results
  6. MDN Web Docs — String: length

Related guides