No upload, 100% local, no account

Article

Words, characters and case: how text counting really works

Counting text sounds like the one job a computer cannot get wrong, yet two tools will happily report different numbers for the same paragraph, an emoji can cost you 70 SMS characters, and "280 characters" on X does not mean what it seems to. Behind the everyday chores of writing to a limit, renaming variables or filling a mockup sit a few rules worth knowing. This article walks through them, using the small text utilities on this site as working examples.

What counts as a word

Most counters, ours included, define a word the way typists do: a run of visible characters between spaces or line breaks. That single rule already explains most disagreements. Is "state-of-the-art" one word or four? With whitespace splitting, one. Is "don't" one word or two? One. Numbers, URLs and email addresses each count as a word too. The convention breaks down for languages written without spaces: in Chinese or Japanese there is no whitespace to split on, so a "word count" is not meaningful and you should work with character counts instead. Reading time estimates stack a second convention on top: our word counter divides the word count by 200 words per minute, a common average for silent adult reading, so treat the result as a planning figure, not a promise.

A character is not always one symbol

Character counts are murkier, because Unicode text has layers. What you perceive as one character (a grapheme) may be built from several code points, and each code point occupies one or two of the 16-bit units that JavaScript's length property counts. The grinning face emoji is one grapheme but two of those units, so a naive counter says 2. A family emoji built by joining several person emoji is one grapheme, five code points and eight units. Even plain text has this problem: "café" can be stored with é as one code point or as an e followed by a combining accent, identical on screen, different in count. This is why two counters disagree: they measure different layers. The rules for grouping code points into user-perceived characters are standardized in Unicode's text segmentation annex (UAX #29), and well-behaved counters follow it.

Three strings measured on three Unicode layers: a grinning face emoji is 1 grapheme and 2 UTF-16 units, a family emoji is 1 grapheme, 5 code points and 8 units, and a decomposed café is 4 graphemes but 5 code points

The limits you are actually counting for

Character limits are where counting becomes money. An SMS carries 160 characters in the compact GSM-7 alphabet, but a single character outside it (an emoji, or a letter the alphabet lacks) switches the whole message to UCS-2 and the limit drops to 70; long messages split into parts of 153 or 67 characters, each billed separately. X allows 280 characters per post, but weighs them: every URL counts as 23 regardless of its real length, and most emoji and CJK characters count as 2. Search snippets have soft limits instead: Google truncates titles and descriptions by pixel width, so the familiar 60-character title and 155-character description figures are working conventions rather than guarantees. When a limit matters, count with the same rules the platform uses, and leave margin.

Case is a convention, and each style has a home

Changing case sounds trivial until you meet the conventions stacked on top of it. Prose knows Title Case, favoured by US headlines, and sentence case, which most European style guides prefer. Code has its own families: camelCase for variables in JavaScript and Java, PascalCase for class and component names, snake_case in Python and databases, SCREAMING_SNAKE_CASE for constants, and kebab-case for CSS classes, file names and URL slugs, where lowercase avoids the classic trap of links that differ only by letter case. Converting a handful of identifiers by hand is fine; converting a list of eighty is how typos are born. A case converter applies the transformation mechanically, including the fiddly parts like deciding what happens to acronyms and existing separators.

The phrase user profile page written in six case styles: camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, kebab-case and Title Case

Filler text, and files your phone refuses to open

Two more chores round out the set. Layouts are judged with placeholder text because real sentences pull attention to their meaning; lorem ipsum works precisely because it is almost, but not quite, readable Latin. Our generator produces it by the paragraph, sentence or word, so a mockup can be filled to realistic lengths instead of one pasted block repeated. And when someone sends a .md, .json, .csv or .log file that a phone refuses to open, a browser-based text viewer displays it without installing an editor or forwarding the file to some conversion site. Everything above, counting included, runs entirely in your browser: the text never leaves your device, which matters more than usual when the thing you are measuring is a draft, a contract or a log full of internal paths.

Tools in this article

Frequently asked questions

How many words fit on a page?

The publishing conventions are about 500 words for a single-spaced page and about 250 for a double-spaced one, assuming a standard 12-point font on A4 or letter paper. Real documents drift from those figures with every change of font, margin or heading, which is why assignments and submissions increasingly specify a word count instead of a page count. If you have the text, count it directly and skip the estimate; the page conventions are only useful before the text exists.

What does lorem ipsum actually mean?

It is scrambled Latin, not gibberish. The standard passage is cut and reshuffled from Cicero's De finibus bonorum et malorum, a philosophical text from 45 BC; the fragment "dolorem ipsum" means "pain itself". The scrambling is the point: the text looks like natural language, with plausible word lengths and sentence rhythm, but resists being read, so viewers judge the layout instead of the copy. Its modern spread is usually credited to Letraset transfer sheets in the 1960s and desktop publishing software in the 1980s.

Why does a platform count fewer characters than my counter?

Because platforms count with their own weights. X starts from 280 but bills every URL as 23 characters and most emoji and CJK characters as 2 each. SMS gateways switch the whole message from the 160-character GSM-7 alphabet to the 70-character UCS-2 mode as soon as one character requires it. And any platform may count code units rather than graphemes, so a single family emoji can consume 8 of the limit. When the number on the button disagrees with your counter, the platform's rules win; compose with margin or check against the platform's own counter before sending.

Sources