text / PRACTICAL GUIDE
Character Count Explained
Understand why emoji, whitespace, and Unicode can make two counters disagree.
A character count can mean visible symbols, Unicode code points, UTF-16 units, or bytes. These agree for simple English letters but can differ for emoji and accented text. Use the measurement required by your destination, and check whether it includes whitespace.
THE IDEA, VISUALLY
The same text, different counts
- Hello world
- 11 with the space
- 10 without the space
Visible characters are not storage units
The letter A is one visible character, one Unicode code point, one UTF-16 unit, and one UTF-8 byte. Many other symbols do not line up so neatly. An emoji can need two UTF-16 units, while a joined emoji sequence can contain several code points.
A grapheme cluster approximates what a reader sees as one character. Combining a letter with an accent can create one visible unit from multiple code points.
References: Unicode: user-perceived characters
Compare different measurements
The accent row describes an e followed by a combining acute accent, not the visible explanatory label. These examples contain no trailing newline. Visually identical accented letters can have different encodings.
| Exact text | Graphemes | Code points | UTF-16 units | UTF-8 bytes |
|---|---|---|---|---|
| A | 1 | 1 | 1 | 1 |
| 😀 | 1 | 1 | 2 | 4 |
| é (U+00E9) | 1 | 1 | 1 | 2 |
| e + ◌́ (U+0065 U+0301) | 1 | 2 | 2 | 3 |
| A B | 3 | 3 | 3 | 3 |
Whitespace still takes space
Spaces, tabs, and line breaks normally count unless a system explicitly excludes them. A pasted trailing line break can push a field over a strict limit. “Without whitespace” is a separate convenience metric, not a universal platform standard.
Windows line endings use two code points for a line break; web textareas commonly normalize them. Compare using the actual destination rather than relying on a copied file’s byte length.
Test the limiting system
For a form with a character cap, try the exact text there. Different systems may count links, emoji, and line breaks differently. Do not assume JavaScript string.length measures visible symbols.
The Edit All counter displays several measures together. Use the one documented by your destination and leave a margin when its rules are unclear.
Frequently asked questions
Does “without spaces” remove newlines too?
In Edit All, the metric excludes whitespace, including spaces, tabs, and line breaks. A destination that excludes only ordinary spaces can report a different total.
Does an emoji always count as one character?
Not under every measurement. A grapheme-aware count may treat a joined emoji as one visible unit, while its code-point, UTF-16, and byte counts are larger.