Dev.to WebDev 🛠 Dev 👁 0 📖 1 min read

I built a free character counter that handles X's weighted length and SMS segments

I kept hitting the same problem: a draft that looked short enough would get rejected by X, Instagram or an SMS gateway. Each platform counts characters differently, and most counters only give you one number. So I built

I kept hitting the same problem: a draft that looked short enough would get
rejected by X, Instagram or an SMS gateway. Each platform counts characters
differently, and most counters only give you one number.

So I built CharCountLab, a small static site with four focused tools:

  • Character Counter: characters with and without spaces, words, sentences, paragraphs, reading and speaking time
  • Twitter Character Limit: X's weighted length (URLs cost 23, emoji and CJK cost 2) against the 280 limit
  • Instagram Caption Character Limit: 2,200 characters plus hashtag and mention counts
  • SMS Character Limit: GSM-7 vs Unicode, 160 / 153 / 70 / 67, and how many segments you'll be billed for

Everything runs in the browser. No signup, no upload, no tracking — your text
never leaves the device. The pages are plain HTML with the content in the
source, so they are readable without JS and need no build step.

A few things I learned while building it:

  • One emoji flips an entire SMS from GSM-7 (160 chars) to Unicode (70), doubling the cost
  • Instagram collapses captions after about two lines, so the first 125 characters matter more than the 2,200 limit
  • A URL in an X post always costs 23 characters, however long the link is

Try it: https://charcountlab.pages.dev/

If you've run into a counting rule I've missed, I'd love to hear about it.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.