UTF-8 Byte Length Calculator

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.

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

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

© 2019 to 2026 Calculate.co.nz. All rights reserved.