Count characters
Four counts, because “how many characters” has four answers and the one you want depends on what you are about to do with the text. Nothing you type here leaves your browser. It is worked out on your own device, so there is nothing to send and nothing to log — which matters more for text than for most things, because people paste in work they are not supposed to paste anywhere.
Four numbers, all correct
"How many characters is that?" has four answers, and which one you want depends entirely on what you are about to do with it.
| 👨👩👧 | Who counts this way | |
|---|---|---|
| Characters | 1 | a person reading it |
| Code points | 5 | most "proper" character counts |
| UTF-16 units | 8 | JavaScript's length, and every substring |
| UTF-8 bytes | 18 | a database column, a network packet |
A family emoji is one character to the person who typed it and eighteen bytes to the column it is being saved into. A field declared as twenty characters will hold one of them and not two.
Which is how names get cut in half
Truncating to a length counted one way, in a system that stores it another way, is where this stops being trivia. Cut a string at twenty UTF-16 units and you can land in the middle of a character, leaving half of one behind — which is not a character at all and renders as a question mark.
It is also why some systems will accept a name and others reject it, and why the limit a form claims is rarely the limit it enforces.
What counts as a character at all
A zero width space is a character. A combining accent is a character by some counts and part of one by others. A variation selector — the invisible code point that decides whether an emoji renders as a picture or as plain text — is a character that has no appearance whatsoever.
None of that is a trick. It is what the encoding is for, and it is why one number was never going to be enough.