How X counts characters: emoji, links and the 280 limit
X counts a weighted length, not characters. In twitter-text, the open-source library X published for this, Latin letters and common punctuation count 1, most other characters count 2, every link counts 23, each emoji counts 2, and the total may not go over 280.
The weights
These values come from the version 3 configuration of twitter-text 3.1.0. We counted each example with our own implementation and with the library; they agree.
| What you type | Counts as |
|---|---|
| a, é, Ж (Latin, accented Latin, Cyrillic) | 1 each |
| “ and the long dash | 1 each |
| … (the single ellipsis character), ™, € | 2 each |
| Korean, Chinese or Japanese characters | 2 each |
| 😀 | 2 |
| 👍🏽 or 👨👩👧 (one emoji built from several pieces) | 2 |
| https://example.com | 23 |
The rule behind the table is a set of code point ranges. Characters up to U+10FF, which covers Latin, Greek, Cyrillic, Arabic, Hebrew and Thai among others, weigh 1, together with a few ranges of general punctuation. Everything else weighs 2.
Links are always 23
Every link counts as 23, whether it is 19 characters or 83. That includes a bare domain: example.com with no https:// in front still counts as 23, so “see example.com now” is 31, not 19.
Not everything with a dot is a link. The library only treats a word as one when it ends in a real domain ending, so file.txt counts as 8 ordinary characters.