Skip to the tool
Binary Translator Free tools

What is UTF-8?

UTF-8 is the way most text is stored as bytes today. Type any character below to see its Unicode code point and the exact UTF-8 bytes, then read how ASCII, Unicode and UTF-8 fit together.

Updated · Written and checked by Murugan Vellaichamy

Try:

The short answer

Unicode gives every character a number, called its code point, written like U+00E9.

UTF-8 is a way of storing those numbers as bytes: one byte for the basic English characters and two, three or four bytes for everything else, covering every code point from U+0000 to U+10FFFF.

ASCII is the older set of 128 characters, and UTF-8 stores each of them as the very same single byte, so plain ASCII text is already valid UTF-8.

ASCII vs Unicode vs UTF-8

What it isCoversBytes per character
ASCIIA character set and its 7-bit codes128 characters: English letters, digits, punctuation, control codes1
UnicodeA list giving every character a number (code point)Code points U+0000 to U+10FFFFDepends on the encoding
UTF-8An encoding: how Unicode code points are written as bytesEvery Unicode code point1 to 4

The UTF-8 byte patterns

Code pointsBytesBit pattern (x = bits of the code point)
U+0000 to U+007F10xxxxxxx
U+0080 to U+07FF2110xxxxx 10xxxxxx
U+0800 to U+FFFF31110xxxx 10xxxxxx 10xxxxxx
U+10000 to U+10FFFF411110xxx 10xxxxxx 10xxxxxx 10xxxxxx

The first byte says how long the character is: a leading 0 means one byte, 110 two, 1110 three and 11110 four. Every following byte starts with 10. That is how a program can find the start of each character, and how the binary translator spots a byte that doesn’t fit.

Encoding a character by hand

é is U+00E9, which is 233. It falls in the two-byte range, which has 11 payload bits, so write 233 as 11 bits: 00011101001. Split it 5 + 6 into the pattern 110xxxxx 10xxxxxx and you get 11000011 10101001, which is C3 A9 in hex.

€ is U+20AC. It needs three bytes and 16 payload bits: 0010000010101100. Split 4 + 6 + 6 into 1110xxxx 10xxxxxx 10xxxxxx: 11100010 10000010 10101100, or E2 82 AC in hex.

Why does text turn into é and other junk?

If UTF-8 bytes are read with a one-byte encoding such as Windows-1252, each byte becomes its own character. The two bytes of “é”, C3 A9, then show up as “é”. The fix is to read the text as UTF-8. The binary to text and hex to text converters let you switch the encoding to see both readings.

What UTF-8 never contains

  • The code points U+D800 to U+DFFF. They are reserved for UTF-16 surrogate pairs, and encoding them in UTF-8 is not allowed.
  • Code points above U+10FFFF, which Unicode does not use.
  • Overlong forms, such as writing “A” in two bytes. Every character has exactly one valid UTF-8 form, the shortest one.

Sources and method

The byte breakdown is built from the RFC 3629 bit patterns, and the tests check it against the browser’s own UTF-8 encoder for one-, two-, three- and four-byte characters.

Questions

Is UTF-8 the same as Unicode?

No. Unicode is the list of characters and their numbers; UTF-8 is one way of storing those numbers as bytes. UTF-16 and UTF-32 are other ways.

Is ASCII text valid UTF-8?

Yes. UTF-8 encodes the 128 ASCII characters as the same single bytes, so any ASCII file is also a UTF-8 file.

How many bytes is one character in UTF-8?

One for ASCII characters, two for most accented Latin letters and many other alphabets, three for most other characters including Chinese, Japanese and the euro sign, and four for characters above U+FFFF, which include most emoji.

What does U+ mean?

It marks a Unicode code point written in hex. U+0041 is code point 65, the letter A.

More converters

Copied