Unicode and UTF-8 Guide

Unicode gives every character a number, and UTF-8 stores that number as bytes. This guide explains the difference, why emoji count as two characters, and what causes garbled text. Paste text below to see exactly which characters it contains.

Unicode character inspector

0Characters
0UTF-16 units
0UTF-8 bytes
0Invisible characters
CharCode pointUTF-8 bytesNote
Nothing to show yet.

Your text stays in your browser. The table shows the first 200 characters.

Unicode, UTF-8, UTF-16 and UTF-32

EncodingBytes per characterWhere you meet it
UTF-81 to 4The web, most files, Linux and macOS. Compatible with ASCII.
UTF-162 or 4JavaScript strings, Windows internals, Java.
UTF-324Internal processing, where a fixed size is useful.
UCS-22SMS with emoji or non-Latin text. It is why those messages drop to 70 characters.

Common characters and their codes

CharCode pointNameUTF-8 bytesBytes
AU+0041Latin capital A411
éU+00E9e with acuteC3 A92
€U+20ACEuro signE2 82 AC3
’U+2019Curly apostropheE2 80 993
—U+2014Em dashE2 80 943
عU+0639Arabic letter ainD8 B92
中U+4E2DChinese characterE4 B8 AD3
😀U+1F600Grinning face emojiF0 9F 98 804

Why this matters for text messages

An SMS holds 160 characters in the GSM-7 alphabet, but only 70 once it contains any character outside that alphabet. A single curly apostrophe pasted from a word processor can do this, even if the message looks like plain English. The SMS character counter shows the encoding and can swap smart punctuation for plain characters.

Why one visible character can be several code points

Some characters are built from parts. A family emoji is several emoji joined with zero-width joiners, a flag is two regional indicator letters, and é can be stored as e plus a combining accent. They look like one character but have a longer count. See also the ASCII table for the first 128 code points.

Frequently asked questions

What is Unicode?

Unicode is the universal character standard. It gives every letter, symbol and emoji a unique number, called a code point, written like U+0041 for the letter A.

What is the difference between Unicode and UTF-8?

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 of storing the same characters.

Why does one emoji count as two characters?

Many emoji sit outside the range that fits in one 16-bit unit, so UTF-16 stores them as two units called a surrogate pair. JavaScript, SMS and some character counters count those units, so one emoji counts as 2.

Why do I see strange characters like é in text?

That is mojibake: text saved as UTF-8 was read as a different encoding such as Windows-1252. Opening or importing the file as UTF-8 usually fixes it.

What is a zero-width character?

An invisible character with no width, such as the zero-width space (U+200B) or zero-width joiner (U+200D). Paste text into the inspector on this page to reveal them, then remove them with the text cleaner.

How many characters does Unicode have?

Unicode has room for 1,114,112 code points, and more than 140,000 of them are assigned to characters. New versions add characters and emoji regularly.