UTF-8 Byte Encoder

Type any text to see its UTF-8 byte sequence and code points.

Result

9 bytes
6
43 61 66 C3 A9 20 E2 82 AC
U+0043 = 43 U+0061 = 61 U+0066 = 66 U+00E9 = C3 A9 U+0020 = 20 U+20AC = E2 82 AC

How it is calculated

Type or paste any text and the tool reads it as UTF-8 bytes. UTF-8 stores each Unicode code point in 1 to 4 bytes, decided by the leading byte:

0xxxxxxx = 1 byte (U+0000 to U+007F), 110xxxxx = 2 bytes, 1110xxxx = 3 bytes, 11110xxx = 4 bytes

The tool outputs the total byte count, the number of code points, all bytes in uppercase hex separated by spaces, and one line per code point in the form U+XXXX = bytes. The code point value is rebuilt from the data bits of the bytes. Note that the count is of code points, not of visible characters: an emoji built from several code points, or a letter plus a combining accent, counts as more than one.

Worked example

The text is "Café €". C, a, f and the space are plain ASCII, one byte each (43, 61, 66, 20). The é is U+00E9 and takes two bytes, C3 A9. The euro sign € is U+20AC and takes three, E2 82 AC. Total: 1 + 1 + 1 + 2 + 1 + 3 = 9 bytes for 6 characters. The full hex output is 43 61 66 C3 A9 20 E2 82 AC.

Try this example →

Common mistakes

  • Assuming one character is one byte. Accented letters take 2 bytes, many Asian characters 3, and emoji 4, so a 100-character message can exceed a 100-byte limit.
  • Comparing the byte count with a limit that is actually in UTF-16 units or characters, such as many database column types, instead of bytes.
  • Confusing code points with what the eye sees as one character; a flag or a family emoji is several code points joined together.
  • Copying text that contains hidden characters such as a non-breaking space or a zero-width joiner; they add bytes that you cannot see.
  • Reading the hex as a different encoding. These are UTF-8 bytes, which differ from Latin-1 or UTF-16 bytes for any character above U+007F.

Sources

About this calculator

UTF-8 encodes every Unicode code point as 1 to 4 bytes: ASCII characters (U+0000–U+007F) take a single byte, most Latin-extended and common symbols take 2 bytes, most CJK and other BMP characters take 3 bytes, and emoji and rarer characters outside the Basic Multilingual Plane take 4 bytes — which is why a string's byte length can be much larger than its character count once accents, non-Latin scripts, or emoji are involved.

This tool encodes any text to UTF-8 and shows the total byte length, the raw hex bytes, and a per-codepoint breakdown of how each character was encoded. Backend and mobile developers use it to debug byte-length limits in databases, APIs, or SMS/push-notification payloads where character count and byte count diverge, and students learning encoding use it to see the byte structure behind Unicode text firsthand.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    If an emoji gets dropped or turned into question marks when saved, paste it here and look at the breakdown. A code point above U+FFFF shows four bytes, and some older database setups, such as MySQL's three-byte utf8 character set, cannot store four-byte characters. A two- or three-byte character will not have that problem. Which string is being cut or garbled for you?

Popular calculators

All Calculators