Xerobit

Twitter Character Counter for X Posts

This twitter character counter measures your post length using the open-source twitter-text weighting rules that X publishes. Every URL counts as 23 characters, CJK characters and emoji weigh 2 each, and most Latin, Cyrillic and Arabic text weighs 1. Paste your draft to see the weighted count and remaining space. It runs entirely in your browser with nothing uploaded.

Result

  • Weighted length
    0
  • Remaining
    280

How to use the twitter character counter

  1. Type or paste your draft into the Post text area.
  2. The twitter character counter updates live as you type, applying X weighting rules automatically.
  3. Check the Weighted length row to see how many units your post uses.
  4. Look at Remaining to know exactly how much space you have left before hitting the limit.
  5. Adjust the Character limit field if you are testing against a custom threshold.

How X and Twitter Weight Characters

X (formerly Twitter) does not simply count every character as one unit. The platform uses a weighted system defined in its open-source twitter-text library. Understanding these weights is essential when you use any x character counter.

  • Weight 1: code points U+0000 to U+10FF (Latin, Cyrillic, Greek, Hebrew, Arabic, Thai, Devanagari and similar scripts), plus a few general punctuation ranges such as spaces, hyphens and quotation marks.
  • Weight 2: every other character, including CJK ideographs, Hiragana, Katakana, Hangul syllables, Latin letters with stacked diacritics from the Latin Extended Additional block (such as the Vietnamese ạ), and symbols such as the euro sign.
  • Emoji: each emoji counts as 2 in total, even when it is built from several code points, such as a flag, a skin-tone emoji or a family sequence.
  • URLs: every URL, regardless of its actual length, counts as exactly 23. This accounts for X shortening links through t.co.

For example, Hello 😀你好 https://example.com is 6 characters for "Hello " (weight 6), one emoji (weight 2), two CJK characters (weight 4), a space (weight 1) and one URL (weight 23). The weighted length is 36, while the raw count of Unicode characters is 29.

Weighting Reference Table

This table summarizes the standard weights applied by the twitter counter character logic. Use it to estimate lengths manually when drafting offline.

Content typeWeight per unitExampleWeighted length
Latin letter or digit1A1
Space or punctuation1(space)1
CJK ideograph2你2
Hiragana / Katakana2あ2
Hangul syllable2가2
Simple emoji2😀2
URL (any length)23https://example.com/a/b/c23

Note that newline characters (\n) also carry a weight of 1. When composing threads, each post is evaluated independently against the 280-unit limit.

Why Weighted Count Matters

If you rely on a basic string length function instead of a proper twitter character counter, your posts may be rejected by the API or truncated in the interface. A post containing 200 CJK characters looks like 200 characters to a naive counter, but X treats it as 400 weighted units, well over the 280 limit.

The same issue arises with URLs. Pasting a 120-character link into a naive counter eats 120 units of your budget. On X, that link only costs 23 units, leaving far more room for your message. This tool normalizes those differences so the count you see matches what X enforces.

Developers integrating with the X API should always validate post length using the twitter-text weighting rules rather than String.length. A post that looks short enough in a plain editor can still be over the limit once CJK characters and emoji are weighted.

Common Mistakes When Counting Tweet Length

Several pitfalls trip up even experienced users when working with an x character counter:

  • Assuming one emoji equals one character. Emoji such as flags, skin-tone emoji or family sequences consist of several code points, but X weighs the whole sequence as 2, and so does this tool.
  • Forgetting that URLs are capped at 23. Shortening a URL by hand does not save space, because X counts the link as 23 either way. A link that X does not recognise as a URL is counted character by character.
  • Mixing up bytes and characters. UTF-8 encoding uses multiple bytes for non-ASCII characters, but X counts code points, not bytes. A CJK character is 3 bytes in UTF-8 but only 2 weighted units on X.
  • Ignoring trailing spaces. Spaces at the end of a post still consume weight. Trim unnecessary whitespace before publishing.

Comparing Platform Limits

Different platforms enforce different constraints. While this twitter character counter targets the 280-unit X limit, other tools handle their respective platforms:

  • X (Twitter): 280 weighted units, with URL normalization to 23.
  • Instagram captions: 2,200 raw characters. See the ig character counter for that platform.
  • SMS: 160 characters for GSM-7, 70 for UCS-2. The sms character counter handles segmentation math.
  • General text: For simple raw counting without platform rules, use the character counter.

Each platform requires its own approach. Using the correct tool prevents surprises when you hit publish.

Worked examples

ExampleInputResult
Plain textPost text: Hello world! This is a test post for X.; Character limit: 280Weighted length: 39; Remaining: 241
With a URLPost text: Check out this article https://example.com/very/long/path right now!; Character limit: 280Weighted length: 57; Remaining: 223; URLs found: 1; Raw characters: 68
Emoji and CJKPost text: Hello 😀你好; Character limit: 280Weighted length: 12; Remaining: 268; Raw characters: 9
Maxed outPost text: aaaaaaaaaa bbbbbbbbbb cccccccccc dddddddddd eeeeeeeeee ffffffffff gggggggggg hhhhhhhhhh iiiiiiiiii jjjjjjjjjj kkkkkkkkkk llllllllll mmmmmmmmmm nnnnnnnnnn oooooooooo pppppppppp qqqqqqqqqq rrrrrrrrrr ssssssssss tttttttttt uuuuuuuuuu vvvvvvvvvv wwwwwwwwww xxxxxxxxxx yyyyyyyyyy zzzzzzzzzz 1234567890; Character limit: 280Weighted length: 296; Remaining: Over limit by 16

FAQ

How does the twitter character counter handle URLs?

Every URL detected in your text is counted as exactly 23 characters, regardless of its actual length. This matches X's t.co link-shortening behavior.

Why do some characters count as 2 on X?

In the twitter-text configuration, characters outside U+0000 to U+10FF (and a few punctuation ranges) get a weight of 2. That covers CJK ideographs, Hiragana, Katakana, Hangul syllables, many symbols, and every emoji.

Is this x character counter accurate for the current API?

It applies the published twitter-text weights (280 limit, weight 2 outside the weight-1 ranges, 23 per URL, emoji as 2) and matched the twitter-text library on randomised test strings. One limit: URL detection is simplified. Links with http:// or https:// are recognised, but bare domains such as example.com are only recognised for common endings like .com, .org, .net, .io and .dev, whereas X recognises many more. Longer limits for Premium accounts can be tested with the Character limit field.

What is the difference between this and a regular character counter?

A regular counter treats every character equally. This twitter counter character tool applies platform-specific weights so the result matches what X actually enforces.

Does the tool upload my text anywhere?

No. All counting happens locally in your browser. Your text is never sent to any server.

Can I change the character limit?

Yes. Adjust the Character limit field to test against any threshold, such as 280 for standard X posts or a custom value for internal tools.

How are emoji sequences counted?

Each emoji counts as 2, however many code points it uses. A smiley, a flag, a skin-tone emoji and a family emoji joined with zero-width joiners all weigh 2 each.