Characters, bytes and weights: why limits are measured differently
"Limit: 100 characters" sounds like one rule. In practice it can mean visible characters, UTF-16 units, bytes or a weighted score, and a text can pass one measurement and fail another.
Systems store and limit text in different units. A web form may count what you see. A database column may count bytes. A JavaScript check may count UTF-16 units. A social network may count a weighted score. For plain English text, all of these agree, which is why the differences surprise people. They appear once the text contains accents, Chinese, Japanese or Korean characters, emoji or links.
The measurements
- Visible characters (grapheme clusters)
- What a reader would count. A letter, a Han character, an emoji. This is the CountText "characters" figure. Browsers can compute it with
Intl.Segmenter[1]. - Code points
- Each Unicode character is a code point. A visible character can be several code points, as in skin-tone emoji or a letter with a combining accent.
- UTF-16 code units
- What JavaScript's
string.lengthreturns [2]. Most emoji take two units. Some APIs describe their limits this way: TikTok's posting API, for instance, documents its caption limit as 2200 "in UTF-16 runes" [3]. - UTF-8 bytes
- How most files and web APIs store text. ASCII letters take 1 byte, accented Latin letters usually 2, Chinese, Japanese and Korean characters usually 3, and emoji usually 4. The YouTube Data API states the description limit as 5000 bytes [4].
- Weighted length
- A score where different characters cost different amounts. X's counting uses weights: most characters 1, emoji 2, CJK 2, and every link 23 [5].
One string, many numbers
| String | Visible | UTF-16 units | UTF-8 bytes | X weight |
|---|---|---|---|---|
| Hello | 5 | 5 | 5 | 5 |
| Café (é as one code point) | 4 | 4 | 5 | 4 |
| 你好世界 | 4 | 4 | 12 | 8 |
| 😀 | 1 | 2 | 4 | 2 |
| 👨👩👧👦 | 1 | 11 | 25 | 2 |
| “Hello” (curly quotes) | 7 | 7 | 11 | 7 |
The X weights were produced by running X's open-source twitter-text library, which X's documentation recommends for counting [5]. The other columns come from JavaScript string length, Intl.Segmenter and UTF-8 encoding.
Three rows deserve attention. The Chinese string is 4 visible characters but 12 bytes and a weight of 8. The family emoji is 1 visible character, 11 UTF-16 units, 25 bytes and a weight of 2. And plain curly quotes add bytes without changing the visible count.
Practical conversions
"Characters" in a byte-limited field
If a limit is in bytes, a safe worst case is: 1 byte per ASCII character, 2 per accented Latin letter, 3 per CJK character and 4 per emoji, with multi-part emoji costing more (the family emoji is 25). For pure English text you can treat bytes as characters. For anything else, count the bytes or leave a large margin. A 5,000-byte description in the YouTube API can hold roughly 1,666 Chinese characters at 3 bytes each, whereas YouTube Studio's help describes the same field as 5,000 characters [4][6]. The practical consequence is that you should not assume the two are interchangeable when you upload through a tool. Apple’s App Store Connect keyword list works the same way with a 100-byte budget; see App Store and Google Play character limits.
Double-width CJK rules in Google Ads
Responsive search ads cap headlines at 30 characters and descriptions at 90, but Google Ads counts double-width characters (Chinese, Japanese and Korean) as two units each. See Google Ads headline and description limits for worked examples.
Weighted limits on X
For a post, start from 280. Subtract 23 for each link. Then each emoji costs 2 and each CJK character costs 2, so an all-CJK post holds at most 140 characters [5]. Everything else costs 1.
SMS segments
SMS uses either GSM-7 or UCS-2. A message using only GSM-7 characters fits 160 in a single segment, or 153 per segment when split. A message containing even one character outside GSM-7 is sent as UCS-2, which fits 70 characters in a single segment, or 67 per segment when split [7]. Twilio's documentation gives a common trap: a text editor can convert straight quotes into curly ones, and that single character moves the whole message from 160 to 70 [7].
Line breaks
A Windows line break is two code points (carriage return and line feed), but it is a single visible character. CountText counts it as 1. A byte-limited system counts it as 2 bytes. If you are near a limit, test with the real system.
How to avoid surprises
- Read the limit carefully for the unit: "characters", "bytes", "UTF-16", "weighted".
- If the unit is not visible characters, convert before you rely on any counter. The table above gives the pattern.
- If your text is plain English, this problem mostly disappears. If it includes accents, CJK, emoji or curly quotes, treat the limit with caution.
- Normalise quotes and dashes if you are targeting SMS or a byte-limited field. Straight quotes are cheaper than curly ones.
- Always test the final text in the destination.
CountText counts visible characters and does not convert to bytes, UTF-16 units or X weights. We would rather show you how the conversion works than present a single number that is wrong for half the destinations.
Sources (checked November 2026)
- MDN Web Docs, Intl.Segmenter.
- MDN Web Docs, String: length.
- TikTok for Developers, Content Posting API: Direct Post.
- YouTube Data API, Videos resource (description maximum of 5000 bytes).
- X Developer Platform, Counting Characters (weights, links, emoji).
- YouTube Help, Upload YouTube videos (5,000 characters).
- Twilio Docs, How long can a message be?.
- Table values computed by us in November 2026 in Node.js, with X weights from the official
twitter-textlibrary.
Try it: Open the CountText counter to see characters, paragraphs and a whitespace-based word count as you type. Your text stays in your browser.