UTF-8 byte counter
This tool counts how many bytes your text takes in UTF-8, the encoding used by most web pages, APIs and databases. It is useful when a database column, HTTP header or API field has a byte limit rather than a character limit.
- Runs in your browser
- Free, no account needed
- Copy or download the result
Result
Example
Hello 👋 café
{
"normalization": "none",
"utf8Bytes": 16,
"unicodeCodePoints": 12,
"utf16CodeUnits": 13
}How to use the utf-8 byte counter
- Paste text into the Text to count box.
- Choose Unicode normalization: Keep input exactly, NFC, compose where possible, or NFD, decompose where possible.
- Press Run to count.
- Copy result or Download the counts.
How it works
The result gives utf8Bytes, unicodeCodePoints and utf16CodeUnits, along with the normalization used.
Plain ASCII characters use 1 byte each, accented letters usually 2, many other symbols 3, and most emoji 4.
NFC joins letters and accents into single characters where possible, which can lower the count. NFD splits them apart, which can raise it.
Every character in the box counts, including spaces and line breaks.
Visible symbols (grapheme clusters) are not counted separately, so an emoji built from several parts adds several code points.
Everything runs in your browser. Your input is not uploaded or stored.
Questions and answers
Why is the byte count bigger than the character count?
UTF-8 uses 1 to 4 bytes per code point. Letters outside basic English, and emoji, take more than one byte.
What is the difference between NFC and NFD?
They are two ways to write the same text. NFC uses one code point for é where possible, while NFD writes it as e plus a combining accent. Pick the form your system stores.
Why does JavaScript string length differ from the code point count?
JavaScript length counts UTF-16 code units. Characters such as most emoji use two units, so length can be larger than the number of code points.
Is my text sent anywhere?
No. Counting happens in your browser.