About Text Counter
What counts as a character
Three answers are defensible and they disagree. 👍🏽 is one character to a reader, two code points, and four UTF-16 units — which is the number length gives, and the number most counters print.
This one counts what a reader counts. An accented letter typed as a letter plus a combining mark is one character, a flag is one, and a thumb with a skin tone is one.
And the other numbers
Without spaces is the count many limits actually mean. Words are runs of non-whitespace. Lines treat a trailing newline as ending a line rather than starting one.
Bytes is the UTF-8 size, which is what a database column or an SMS limit is counted in — and why it can be several times the character count for text that is not plain English.
Or measure something else
Paste into it, or wire anything that produces text — the output of a template, a JSON query, an encoded string — and it measures that instead of the box.
Each number is an output of its own, so a count can go on to drive something else rather than only being read.
Common questions
- How does it count emoji?
- As one character each, including the ones built from several pieces — a thumb with a skin tone is one character, not four. It counts grapheme clusters, which is what a reader means by a character. JavaScript's own string length would say four, and most counters repeat that.
- Why do characters and bytes differ?
- Because most characters outside plain English take more than one byte in UTF-8: an accented letter takes two, most emoji take four or more. Characters is what a reader counts; bytes is what a size limit counts. Both are on the card because both get asked.
- What counts as a word?
- A run of non-whitespace. So "don't" is one word and "--" is one too. It is not a dictionary, and it matches what every other counter does.
- Does a trailing newline add a line?
- No. A newline ends the line it is on rather than starting an empty one, so "a\nb\n" is two lines — the same count an editor's gutter shows.
- Is my text sent anywhere?
- No. It is counted in your browser, and nothing is uploaded or stored.