How to use it
- Paste or type your text.
- Read the UTF-8 and UTF-16 byte counts.
How it works
UTF-8 uses 1 byte for ASCII characters (English letters, digits, basic punctuation), 2 bytes for most accented Latin, Greek and Cyrillic letters, 3 for most Asian characters and 4 for emoji and rare characters. UTF-16 uses 2 or 4 bytes. Characters are counted as Unicode code points, so an emoji counts as one character, while JavaScript’s .length counts it as 2 UTF-16 units.
Examples
- “héllo” is 5 characters but 6 bytes in UTF-8. An emoji is 1 character and 4 bytes.
Limitations
- A single visible “character” (a letter with combining marks, or a flag or family emoji) can be several code points. The count includes every space and line break, and the number of bytes in a saved file also depends on its line endings.
Last verified . See our Accuracy & Editorial Policy. Found a problem? Email contact@tools.gift.