UTF-8 byte counter
UTF-8 bytes
Code points
UTF-16 units
Where the bytes go
| Encoding size | Code points | Total bytes |
|---|---|---|
| 1 byte | 0 | 0 |
| 2 bytes | 0 | 0 |
| 3 bytes | 0 | 0 |
| 4 bytes | 0 | 0 |
UTF-8 hex preview
First 32 bytes. No byte-order mark is added. Browser text areas normalize line endings to LF.Why the counts differ
ASCII characters use one UTF-8 byte. Accented letters usually use two, many other writing systems use three, and supplementary characters such as many emoji use four.
JavaScript string length counts UTF-16 code units, not UTF-8 bytes. A supplementary character uses two UTF-16 units but one code point. A combining sequence can look like one character while containing multiple code points. These counts do not measure visual grapheme clusters.
The browser's TextEncoder handles encoding, including replacement of any unpaired UTF-16 surrogate with U+FFFD. Your text is not sent to a server.