Counting runs entirely in your browser using X’s open-source twitter-text rules.
How X counts characters
| What you type | Counts as |
|---|---|
| Letters, numbers, punctuation, spaces, line breaks (Latin, Cyrillic, Greek…) | 1 each |
| Chinese, Japanese, Korean characters | 2 each |
| Emoji (including skin tones, flags, combined emoji) | 2 each |
Any link (https://… or example.com) | 23, whatever its length |
| Attached images, GIFs, videos, polls | 0 |
That's why a post in Chinese or Japanese fits roughly 140 characters, and why shortening a URL yourself doesn't free up any space.
Other X limits worth knowing
- Post: 280 characters (25,000 with Premium).
- Bio: 160 characters.
- Display name: 50 characters.
- Username: 15 characters — letters, numbers and underscores only.
Counting in code
In JavaScript, use X's own library so your count always matches the composer:
import twitter from 'twitter-text';
const r = twitter.parseTweet('Hello 世界 https://relayxapi.com');
console.log(r.weightedLength, r.valid); // 34 trueNeed the posts themselves? The get tweets guide shows how to fetch any account's posts as JSON.
FAQ
What is the character limit on X (Twitter)?
280 characters per post for standard accounts. X Premium subscribers can write longer posts, up to 25,000 characters.
Do links count toward the limit?
Yes, but every link counts as 23 characters no matter how long or short it is, because X shortens it with t.co.
Why do Chinese, Japanese or Korean characters count double?
X weights CJK characters as 2, so a post written entirely in them holds 140 characters. Most Latin, Cyrillic and similar scripts count 1 each.
Do emoji count as 2 characters?
Yes — each emoji counts as 2, including combined emoji such as skin tones, flags and family emoji.
Do images, videos or @usernames count?
Attached images, GIFs and videos don’t count. Usernames X adds automatically at the start of a reply don’t count either, but any @username you type in the text does.