Character Counter Calculator
Enter text to see a detailed breakdown of its characters.
What the counter measures
Paste any text into the input and the tool returns six tallies at once: characters with spaces, characters without spaces, letters, digits, sentences and lines. For the default sample, "Hello, World! This is 1 example.", the results are 32 characters with spaces, 27 without, 23 letters, 1 digit and 2 sentences. Everything runs locally in your browser, so long documents are counted instantly and nothing leaves your machine.
How each number is derived
The with-spaces figure is the raw string length: every code unit counts, including spaces, tabs and newlines. JavaScript stores text as UTF-16 code units, and this counter walks the string one unit at a time, which is why the count always matches what a .length check in code would report for the same string.
The without-spaces figure strips exactly four kinds of whitespace: the space character (code 32), the tab (code 9), the line feed (code 10) and the carriage return (code 13). In the default sample that means the 5 spaces between words are subtracted from 32, leaving 27.
Letters are counted as any character from A to Z or a to z, and digits as any character from 0 to 9. Everything else — punctuation, symbols, currency marks — lands in neither bucket but still counts toward both totals.
Why punctuation sits outside both buckets
The default sample carries 3 punctuation marks: a comma, an exclamation mark and a period. That accounts for the entire non-space remainder: 23 letters + 1 digit + 3 punctuation marks = 27 characters without spaces. Knowing the split helps when a form rejects punctuation or when you need a letter-only count for an identifier or code.
Worked example at the default input
Walk the sample "Hello, World! This is 1 example." character by character. It contains 32 code units in total. Of those, 5 are the spaces between words, so the without-spaces total is 32 − 5 = 27. The letters in Hello, World, This, is and example add up to 23, and the digit 1 brings the alphanumeric total to 24.
Sentences are approximated by terminal punctuation: the exclamation mark after World and the period after example produce a sentence count of 2. Lines are counted by line-feed characters; with none present and non-empty input, the line count is 1. Paste a 10-line document and you will see 9 line feeds plus the final line, giving 10.
Limits worth checking against
The with-spaces number is what most platforms enforce. These are the figures that come up most often:
| Context | Character limit | Notes |
|---|---|---|
| X (Twitter) post | 280 | Standard accounts; every link counts as 23 |
| SMS message | 160 | One GSM-7 segment; accents drop the limit to 70 |
| Meta description | 155–160 | Search snippets truncate past this range |
| Title tag | 50–60 | Cut off by pixel width, not characters alone |
| API string fields | varies | Most backends enforce length including spaces |
For the default text, 32 characters fits inside every one of those limits with room to spare: 280 − 32 = 248 characters would still be available in a standard X post, and 160 − 32 = 128 in an SMS segment.
With spaces versus without
Forms that count only visible characters use the without-spaces figure. The gap between the two numbers is exactly the whitespace count: 5 in the default sample, but typically 150–200 in a full paragraph of English prose, where roughly one character in six is a space.
Characters, bytes and grapheme clusters
A character count is not a byte count. In UTF-8, plain ASCII text such as the default sample uses 1 byte per character, so 32 characters equals 32 bytes. Accented Latin letters need 2 bytes, most CJK characters need 3, and emoji need 4. A 100-character string of Chinese text is therefore about 300 bytes, not 100, which matters when a database column or payload limit is set in bytes.
Emoji also break the code-unit count. Characters outside the Basic Multilingual Plane, such as the thumbs-up sign or national flags, occupy two UTF-16 code units, so the length check reports 2 while you see 1 glyph. This counter follows the code-unit convention, because that is what form validators and APIs almost always enforce.
Grapheme clusters are the third measure: what a reader perceives as one character. A letter with a combining accent is 2 code units but 1 cluster, and a family emoji can span 7 or more code units. Use the code-unit count for limits and the cluster count when talking about readability.
Common counting mistakes
- Pasting text with a trailing newline silently adds 1 to every total and 1 to the line count
- Abbreviations inflate the sentence count: each period in Dr., Mr. or e.g. adds 1
- Curly quotes and accented letters fall outside the A to Z letter range, so they escape the letter count
- An emoji adds 2 to the character count, not 1
- Tabs copied from a code editor count as whitespace exactly like spaces do
Fixing the two most common ones
If your count comes out exactly 1 higher than expected, look for a trailing newline at the end of the paste. If it is higher by an even number, look for emoji or other non-BMP characters, each of which contributes 2 code units. Both show up immediately when you compare the with-spaces and without-spaces totals against your own count.
When to use the sibling tools
For a plain length check with byte counts alongside, the String Length Calculator reports the same totals with encoding sizes added. To find which words dominate a document rather than how long it is, the Word Frequency Counter ranks every word with its count and share of the text.
Frequently asked questions
Do spaces count as characters?
Yes. Spaces, tabs and newlines are all characters, and the with-spaces total includes them while the without-spaces total excludes them. In the default sample the two figures are 32 and 27, because 5 spaces separate the words.
How many characters is the default example text?
"Hello, World! This is 1 example." counts as 32 characters with spaces, 27 without spaces, 23 letters, 1 digit and 2 sentences. The 5-character gap between the first two numbers is the spaces between words.
How are sentences counted?
Each period, exclamation mark or question mark adds 1 to the sentence count, which is an approximation. The default text scores 2 because of its exclamation mark and final period. Abbreviations such as Dr. will inflate the number.
Are numbers counted as letters?
No. Digits 0 to 9 are tallied separately, and letters only include the Latin alphabet from A to Z. The default sample contains exactly 1 digit, the 1 in "is 1 example".
How many characters is an emoji?
Two code units for emoji outside the Basic Multilingual Plane, which is nearly all of them. A single emoji therefore raises the character count by 2 even though it looks like 1 glyph, and it stores as 4 bytes in UTF-8.
Does capitalization change the count?
No. Uppercase and lowercase letters both count as letters, so HELLO and hello each add 5 to the letter tally. Only the character range matters, not the case.
How many characters should a meta description be?
Aim for 155–160 characters including spaces. Search results generally truncate past that range, so the with-spaces figure on this counter is the one to watch while you edit.
Why does my count differ from my word processor?
Word processors often display grapheme clusters, ignore trailing newlines or count words rather than characters. This tool counts UTF-16 code units including every space and newline, matching what JavaScript and most API validators report.
How many characters fit in an SMS message?
One GSM-7 segment holds 160 characters. If your text contains accented letters or emoji, the encoding switches to UCS-2 and the segment size drops to 70 characters, so count your text before sending.
Method and sources
- Character counting conventions for text inputs and social post limits.