UTF-8 Byte Length Calculator NZ

This tool measures how many bytes a piece of text takes up when encoded as UTF-8, alongside its character and code-point counts, revealing the often-surprising gap between characters and bytes. UTF-8 is the dominant text encoding of the modern web and computing, and its clever design means different characters take different numbers of bytes: the basic English letters, digits and common punctuation take just one byte each, but accented letters, characters from other scripts, and emoji take two, three or even four bytes. This is why a string's length in characters and its size in bytes are not the same thing, a distinction that matters enormously for database fields with byte limits, network payloads, file sizes, and APIs that count bytes rather than characters. This tool makes it concrete. You paste your text and the calculator reports its size in UTF-8 bytes, the number of characters, and the number of Unicode code points, so you can see exactly how the encoding inflates the byte count beyond the character count for non-English text. The results update as you type and everything runs in your browser. Use it to check whether text fits a byte limit, to size data accurately, to understand encoding, or for development and debugging. The byte length is what UTF-8 actually uses, found by encoding the text and counting the resulting bytes; the character count is the number of characters as typically displayed; and the code-point count is the number of Unicode scalar values, which can differ slightly from the visible character count when characters are built from combining marks or when emoji are composed of several code points. For plain English text all three match, since each character is one code point and one byte. For text with accents, other scripts or emoji, the byte count climbs above the character count, which is exactly the gap this tool exposes so you can size and store text correctly.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
Advertise on this page
27 bytes
UTF-8 byte length
Characters23
Code points21
Bytes per char1.17

UTF-8: basic Latin = 1 byte; accents and many scripts = 2-3 bytes; emoji = 4 bytes (and may be several code points). Byte count is what byte limits actually measure.

How it works

The text is encoded to UTF-8 and the resulting bytes are counted, giving the byte length. The character count is the length of the string as typically measured, and the code-point count is the number of Unicode scalar values. For non-English characters and emoji, the byte count exceeds the character count because those characters use multiple bytes.

Worked example

The text Kia ora, Aotearoa! followed by a New Zealand flag emoji has 19 basic Latin characters at one byte each, plus the flag emoji, which is built from two regional-indicator code points totalling eight bytes. That gives 27 bytes from 21 code points, the byte length sitting well above the character count, exactly the gap UTF-8 creates for emoji.

Related calculators