Character Counter

Count characters in your text with and without spaces. Set an optional limit to track usage against platform maximums.

This character counter gives a real-time tally of every character in your text, with and without spaces, plus the word count and remaining characters against an optional limit. It counts UTF-16 code units (the same measure JavaScript's String.length uses), so the numbers match what most web platforms enforce. Everything runs in the browser with no network calls.

Ad
Ad

About Character Counter

How the Counter Works

The "Characters" figure is simply text.length - the number of UTF-16 code units in the string. "Without spaces" strips every whitespace character (space, tab, newline, carriage return) using the regex /\s/g before measuring. "Words" splits the trimmed string on any whitespace run. "Remaining" subtracts the character total from the limit you set and turns red the moment it goes below zero.

Worked example: The string "Hello, world! ๐Ÿ‘‹" is 15 characters with spaces and 13 without. The waving-hand emoji is a single Unicode code point (U+1F44B) but takes two UTF-16 code units (a surrogate pair), so it counts as 2 toward the 15 total. The same text contains 2 words when split on whitespace.

Platform Character Limits Reference

Most social platforms enforce hard character caps and truncate anything that overruns them. These are the current 2026 limits verified against official help centres and Buffer's consolidated reference.

PlatformContent TypeCharacter Limit
Twitter / XTweet280
Twitter / XDisplay name50
Twitter / XBio160
InstagramBio150
InstagramCaption2,200
FacebookPost63,206
LinkedInPost3,000
LinkedInAbout section2,600
YouTubeVideo title100
YouTubeDescription5,000
TikTokCaption4,000
PinterestPin description500
GoogleMeta title (display)~60
GoogleMeta description (display)~155-160
SMSSingle message (GSM-7)160
SMSSingle message (Unicode)70

What Counts as a Character?

TypeExampleCharacters CountedNotes
LetterA, z, e with accent1 eachBasic Latin and accented characters count as 1
Digit0, 91 eachNumbers count as characters
Punctuation. , ! ?1 eachAll standard punctuation
Space(spacebar)1Counted in "with spaces", excluded from "without spaces"
Newline(Enter key)1-2LF = 1 char, CRLF (Windows) = 2 chars
Simple emojiSmiley face, thumbs up2Most emoji use 2 JavaScript code units (a surrogate pair)
Complex emojiFamily, flag, skin tone4-11Compound emoji joined with zero-width joiners use many code units

This tool counts JavaScript string length (UTF-16 code units), which is how most web platforms measure their limits. A single emoji may use 2 or more code units, which is why one emoji can count as 2+ characters.

Why Character Count Differs Between Tools

Different applications count characters differently, which can be confusing:

Counting MethodHow It WorksUsed By
UTF-16 code unitsCounts 16-bit code units (surrogate pairs = 2)JavaScript .length, most web platforms, this tool
Unicode code pointsCounts actual characters including emoji as 1Python len(), Swift, Rust
Grapheme clustersCounts visible characters (compound emoji = 1)Twitter/X (for their 280 limit)
Bytes (UTF-8)Counts raw bytes (ASCII = 1, emoji = 4)Database column sizes, API payloads

Twitter/X uses grapheme cluster counting, which means a complex emoji (like a family emoji) counts as 1 character toward the 280 limit even though it may be 11 UTF-16 code units.

SMS Character Encoding

SMS messages use two different encoding schemes, and the character limit changes depending on which one is needed:

EncodingChars Per MessageCharacters SupportedTriggers
GSM-7160Basic Latin letters, digits, common punctuationDefault for messages using only standard characters
UCS-2 (Unicode)70All Unicode characters including emojiTriggered by any character outside the GSM-7 set

A single emoji in an otherwise plain-text SMS drops the limit from 160 to 70 characters. This is why SMS marketing campaigns avoid emoji when message length is tight.

SEO Character Limits

Google does not enforce hard character limits on meta titles and descriptions, but it truncates them in search results based on pixel width:

ElementSafe Character CountPixel Width (approx)What Happens if Too Long
Meta title50-60 characters~580px on desktopTruncated with "..." in search results
Meta description150-160 characters~920px on desktopTruncated or replaced by Google's own snippet
URL slug50-75 charactersN/ATruncated in search results, harder to share

Wide characters like "W" and "M" take more pixel space than narrow ones like "i" and "l", so a title with many wide characters may get truncated before reaching 60 characters. Tools like the word counter and readability score help refine snippet copy so it fits the display width and still reads clearly.

How Twitter/X Counts Characters Differently

X's 280-character limit does not match what JavaScript reports. The platform counts grapheme clusters - visible characters that may consist of multiple code points joined by zero-width joiners. A family emoji like ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ is 7 Unicode code points and 11 UTF-16 code units, yet X treats it as 1 character against the 280 cap. Links are also special-cased: every URL counts as 23 characters regardless of its actual length, because X rewrites links through its t.co shortener. Some "wide" characters (CJK ideographs, certain math symbols) still count as 2 grapheme weights, so Japanese tweets effectively have a 140-character ceiling.

Because of those rules, this tool's raw count will almost always be higher than the number X displays in its composer. Use X's own character counter when the exact figure matters for publishing.

Common Mistakes When Composing Within a Limit

  • Forgetting that one emoji can double the byte count. A single ๐Ÿ‘€ in an SMS switches the encoding from GSM-7 to UCS-2 and drops the per-message limit from 160 to 70. Carriers split longer messages into multi-part SMS and charge per part.
  • Pasting from Word or Google Docs introduces smart quotes and em dashes. These are multi-byte characters that pass GSM-7 detection in some systems and fail in others, causing inconsistent billing.
  • Trailing spaces and hidden newlines inflate the count. A Windows-style CRLF newline is 2 characters where a Unix LF is 1. Many CMS platforms count both, so a paragraph break can silently eat 2 characters from your budget.
  • Zero-width characters are invisible but counted. Text pasted from certain templating tools can include zero-width joiners (U+200D) or byte-order marks (U+FEFF). These look like nothing but add to length.
  • Trusting Word's character count for web limits. Microsoft Word counts by Unicode code points, so a family emoji is 1 in Word and 11 in a tweet.length check. Always test with the target platform's own counter before scheduling a campaign.

Why Character Limits Exist at All

The 160-character SMS limit has a famous origin: Friedhelm Hillebrand, a Deutsche Telekom engineer, typed random sentences on a typewriter in 1984 and concluded that 160 characters was "perfectly sufficient" for most messages. The GSM standards committee adopted it in 1985, and the constraint stuck because it fits in the signalling band that carried SMS alongside voice calls. Twitter's original 140-character limit was derived from 160 minus 20 characters reserved for the username and routing metadata needed to deliver tweets over SMS in the service's early days. When Twitter doubled the limit to 280 in 2017, internal research showed that only about 9% of English tweets hit 140 characters, versus 0.4% for Japanese where fewer characters convey more meaning - which is why CJK languages retained an effective 140-character ceiling through grapheme-weighting.

Character Limits Across the Web: A Wider Picture

Beyond the obvious social caps, character limits quietly shape a lot of the web. Database columns default to tight sizes that catch developers out: MySQL's VARCHAR(255) was historically the maximum that fit in a single byte of length metadata. Postgres TEXT has no practical limit but indexing a column over 2,712 bytes in a B-tree requires a hashing strategy. On the front end, HTML input[type="email"] defaults to no maxLength, but RFC 5321 caps the full email address at 254 characters. URLs have no standard maximum, though the practical limit is around 2,000 characters before browsers and intermediary proxies start truncating - Google's own documentation recommends keeping URLs under that threshold for crawling.

In print design, character count per line drives readability: typographer Robert Bringhurst's "Elements of Typographic Style" recommends 45-75 characters per line for comfortable reading, with 66 as the ideal for single-column body text. Web-accessibility guidelines under WCAG 2.2 section 1.4.8 require text blocks be no wider than 80 characters per line for people with low vision or cognitive difficulties. If a block of copy feels hard to read online, character-per-line width is often the reason before font choice or colour.

API design runs into similar limits. The HTTP specification allows arbitrary header sizes in theory, but Cloudflare, AWS CloudFront, and most CDNs cap individual headers at 8 KB and total headers at 16 KB or 32 KB. JSON Web Tokens that grow past those thresholds when loaded with scopes or custom claims will be silently rejected at the edge, so teams building with JWT authorization watch the encoded token character count carefully. Even database primary keys have an implicit limit: UUID strings are 36 characters (32 hex digits plus 4 dashes), which is why many systems store them as 16-byte binary instead of VARCHAR(36) to save storage and index space at scale.

Form field limits protect against attack more than they protect against prose: letting a "name" field accept 10,000 characters is both a data-quality risk (truncated records downstream) and an abuse vector (denial-of-service via oversized payloads). OWASP's ASVS 4.0.3 requires length validation on every input, with the limit set no higher than the business case requires. When testing a new form, dropping a few thousand characters into every field quickly reveals whether the backend has been told what a reasonable upper bound looks like. The word counter is often used alongside this character counter during that kind of boundary-testing work.

Sources

Frequently Asked Questions

What counts as a character?

Every letter, digit, punctuation mark, space, and special symbol counts as one character. Emoji may count as two or more characters because they are represented by multiple Unicode code points. The tool counts actual JavaScript string length, which matches what most web platforms use for their limits.

Why does the count differ from my word processor?

Different applications count characters differently. Some exclude spaces or newlines, others count Unicode characters instead of code units. This tool shows both totals (with and without spaces) so you can match whichever convention your target platform uses.

What is the character limit feature for?

Many platforms enforce character limits - for example, SMS messages (160), tweets (280), meta descriptions (160), and LinkedIn posts (3,000). Set a limit and the counter will show how many characters you have remaining, turning red when you exceed it.

Does this tool count emoji as one character?

Emoji may count as two or more characters because they are stored as multiple Unicode code points. The tool counts JavaScript string length, which matches how most web platforms measure their limits. So a single emoji might use 2 characters toward your total.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/character-counter/" title="Character Counter - Free Online Tool">Try Character Counter on ToolboxKit.io</a>