3tej home

What is Character Counter?

A Character Counter computes character counter from the inputs you provide. It applies the standard formula to the values you enter and returns the result instantly, without sending any data to a server. Total characters, characters without spaces, letters, digits, uppercase, lowercase, punctuation, and whitespace.

Interactive analyzer

Character counter

Live count with platform-specific limit hints.

Characters-
Without spaces-
Bytes (UTF-8)-
X / Twitter (max 280)-
SMS segments (160 / 153)-
Meta description (max 160)-

Character Counter

Counts every character class: letters, digits, punctuation, whitespace, plus uppercase / lowercase splits.

Browser-onlyInstantFree foreverWorks offlineNo signup
← Utilities

TLDR

Drop in text. The result lists every character class - total, without spaces, letters, digits, uppercase, lowercase, punctuation, whitespace.

Runs entirely in your browser. No upload, no signup, no logging. Output is for personal or commercial use; we don't claim any rights.

About this character counter

A character counter measures the literal length of a string the way the JavaScript runtime, the SMS gateway, and the database column see it. Three numbers matter in practice: total code points (the value string.length returns), code points minus whitespace (the figure most CMS plugins enforce), and UTF-8 byte length (the figure database VARCHAR(n) columns and SMS gateways bill against). This page reports all three, plus platform-specific aggregates for X, SMS, and Google meta descriptions.

Counting characters sounds trivial until Unicode arrives. A naive string.length in JavaScript counts UTF-16 code units, so a single ancient script glyph or a clothed-runner emoji can read as two, three, or seven units even though the user typed one symbol. Our counter exposes the raw figure so you can verify whatever your downstream system is enforcing instead of trusting a sanitized number. For password and slug fields the raw count is exactly right; for user-facing limits like a 280-character post, downstream rules apply.

How the counter works

The page runs in your browser and never sends keystrokes to a server. On every input event the tool computes four primitives and derives the rest from them.

total      = text.length                              // UTF-16 code units
no_space   = text.replace(/\s+/g, '').length          // strips spaces, tabs, newlines
bytes      = new TextEncoder().encode(text).length    // UTF-8 byte count
twitter    = total + heuristic for t.co shortening
sms_segs   = total <= 160 ? 1 : ceil(total / 153)     // GSM 7-bit segments

The SMS segment math drops to 70 then 67 if any character falls outside the GSM 7-bit set, because UCS-2 encoding takes effect for the whole message. The meta-description aggregate flags any total above 160 because Google truncates description snippets at roughly that width on desktop SERPs (mobile is shorter).

Worked example: a tweet with emoji and a link

Suppose you draft this post: Launched the new docs site today! Read more at https://example.com/docs/getting-started-with-tooling followed by a single rocket emoji.

  • Raw code points: 110 characters of text plus 1 for the rocket emoji equals 111 total.
  • X composer view: the 56-character URL collapses to a 23-character t.co link, so X measures roughly 111 minus 56 plus 23 = 78 weighted characters and accepts the post comfortably under 280.
  • UTF-8 bytes: ASCII is 1 byte each, the rocket emoji is 4 bytes, giving roughly 114 bytes. A VARCHAR(120) CHARACTER SET utf8mb4 column accepts it; a legacy VARCHAR(120) CHARACTER SET utf8 column (which is actually 3-byte) rejects it because the rocket needs 4 bytes.
  • SMS billing: the message contains an emoji that is not in GSM 7-bit, so the entire message is sent as UCS-2 and costs two segments (the 70-character single-segment limit is exceeded).
Same string, four different lengths depending on which system asks. The counter shows all of them so you can pick the one your downstream actually enforces.

Platform limits at a glance

SurfaceLimitCounts asSource
X (formerly Twitter) post280 weighted charactersCode points with t.co URL shorteningX Developer Platform docs
Bluesky post300 graphemesGrapheme clustersBluesky AT Protocol spec
SMS single segment (GSM 7-bit)160 charactersGSM 03.38 alphabet3GPP TS 23.038
SMS single segment (UCS-2)70 charactersAny non-GSM character forces UCS-23GPP TS 23.038
Google meta description~155 to 160 charactersTruncation point on desktop SERPsMoz, Ahrefs SERP studies 2026
Google title tag~60 characters (or 580 pixels)Pixel-width truncationGoogle Search Central
Slack message40,000 charactersUTF-8 code pointsSlack API docs
Email subject line (deliverability)~50 characters targetCode pointsLitmus, Mailchimp benchmarks

Common pitfalls

  • Trusting .length for graphemes. A flag emoji is two code points, a family emoji is four to seven. If you need user-perceived characters, segment with Intl.Segmenter's grapheme cluster mode, not raw length.
  • Pasting from Word or Notes. Smart quotes, non-breaking spaces (U+00A0), and trailing carriage returns inflate the count by 5 to 15 characters versus what looks visible. Strip with text.normalize('NFC').replace(/\s+/g, ' ').trim().
  • Confusing bytes with characters in database errors. A MySQL ER_DATA_TOO_LONG is byte-based when the column is utf8mb4; a 250-character latin1 column accepts 250 bytes which is exactly 250 ASCII characters.
  • Forgetting URL shortening on social platforms. X and Mastodon collapse every link to a fixed length internally; LinkedIn does not. Same string, different rendered length.
  • Mixing GSM and UCS-2 in one SMS. A single curly quote, a Euro sign written as the typographic glyph rather than the GSM extension, or a smart apostrophe forces the whole message to 70 characters. Audit the source for stray non-GSM glyphs before sending bulk SMS.
  • Treating zero-width joiners as cosmetic. Invisible ZWJ characters between Hindi or Tamil conjuncts, or used as homograph filler, still occupy code points. A search index that hashes the raw string will not match what the user typed visually.

Related text tools

Frequently asked questions

Why does my character count differ from Twitter or X?

X (formerly Twitter) collapses every URL to a 23-character t.co shortlink before counting, and weights some CJK characters as two units under its 'weighted character' rule. A raw character counter shows the literal code-point length; X shows the weighted length. For posts without links and without CJK, the two match exactly. For posts with links, expect the X composer to report roughly len(text) minus (URL length minus 23) per link.

Are tabs and newlines counted as one character each?

Yes. A tab (U+0009) is one code point, a newline (U+000A) is one code point, and a carriage return plus newline (CRLF) is two. All three add to the total character count but are excluded from the 'without spaces' line. UTF-8 byte length stays equal to the code-point count for ASCII whitespace, so the byte counter shows the same number for these.

How does emoji counting work and why is it confusing?

An emoji can be one code point (a single smiley) or many code points joined by zero-width joiner (ZWJ U+200D). A family emoji is usually four to seven code points: a base man, woman, boy, girl plus ZWJ glue. A skin-tone modifier adds one more. The counter reports the raw code-point total, so a single 'family' emoji often reads as four to seven characters. Most messaging apps count the same way, which is why a tweet with three family emojis can fail validation.

How long is a single SMS segment in 2026?

An SMS is 160 characters when every character is in the GSM 7-bit alphabet (basic Latin plus a small extension table). It drops to 70 characters when any character is outside that set, which forces UCS-2 16-bit encoding for the whole message. Once you exceed one segment, each follow-up segment shrinks to 153 or 67 characters because 7 or 3 bytes are spent on the User-Data Header that tells the receiver how to stitch segments back together. A 200-character GSM message therefore costs two segments, not one.

What is the longest text the counter can handle?

Modern browsers handle a few million characters in a textarea comfortably. Chrome on desktop has paginated five million plus inputs in tests; mobile Safari starts to lag past about one million. The counter itself is O(n) for total length and O(n) for whitespace strip, so a one-million-character string runs in well under 100 ms on a mid-range laptop and stays responsive on phones up to roughly 250,000 characters.

Do invisible and non-printing characters count?

Yes. Zero-width joiners, zero-width spaces, byte-order marks (BOM, U+FEFF), variation selectors (U+FE0F and friends), and bidirectional override marks all count toward total length. This is the most common reason a 280-character tweet is rejected at apparent length 270: copy-pasting from a rich text source dropped invisible markers into the string. Strip them with a regex or use a Unicode normalizer before posting.