Unicode converter
- What you would call characters
- 6
- Code points
- 6
- UTF-16 code units
- 7
- UTF-8 bytes
- 10
| Char | Code point | UTF-8 | UTF-16 | HTML | JS | Block |
|---|---|---|---|---|---|---|
| C | U+0043 | 43 | 0043 | C | \u0043 | Basic Latin (ASCII) |
| a | U+0061 | 61 | 0061 | a | \u0061 | Basic Latin (ASCII) |
| f | U+0066 | 66 | 0066 | f | \u0066 | Basic Latin (ASCII) |
| é | U+00E9 | C3 A9 | 00E9 | é | \u00E9 | Latin-1 Supplement |
| ␣ | U+0020 | 20 | 0020 |   | \u0020 | Basic Latin (ASCII) |
| 😀 | U+1F600 | F0 9F 98 80 | D83D DE00 | 😀 | \u{1F600} | Emoji and pictographs |
Inspected in your browser · nothing is uploaded
Breaks text into code points and shows each one’s UTF-8 bytes, UTF-16 units, HTML entity and JavaScript escape — plus the four different ways of counting characters, which almost never agree.
How to use the unicode converter
The four counts are the point of this page, because the gap between them explains most Unicode bugs. A grapheme is what a person calls a character. A code point is what Unicode calls one. A UTF-16 code unit is what JavaScript’s .length counts. A UTF-8 byte is what a database column measures. For plain English all four are equal, which is why the problem stays hidden until the first emoji arrives.
Take 😀: one grapheme, one code point, two UTF-16 units and four UTF-8 bytes. So "😀".length is 2 in JavaScript, and slicing that string at position 1 splits it into two halves of a surrogate pair — neither of which is a character, which is how you get the replacement diamond in production. A family emoji is worse: one grapheme, five code points, eleven UTF-16 units.
That byte count is where database errors come from. A MySQL column declared utf8 holds three bytes per character, and every emoji needs four — which is why the column has to be utf8mb4, and why an emoji silently vanishing between a form and a page is nearly always this.
The escapes are given in all four forms because the syntax differs by more than notation. Above the Basic Multilingual Plane, JavaScript needs \u{1F600} with braces — the older \uXXXX form simply cannot express a code point above FFFF, and writing it is a silent bug rather than an error.
Questions
It counts UTF-16 code units, and an emoji is two. Slicing at position 1 splits a surrogate pair and produces a replacement diamond.
A MySQL utf8 column holds three bytes per character; emoji need four. The column must be utf8mb4.
What a person calls a character. A family emoji is one grapheme, five code points and eleven UTF-16 units.
Above U+FFFF, JavaScript needs the brace form \u{1F600}. The older \uXXXX cannot express it and fails silently.
No. Everything happens in your browser — you can load the page, go offline, and it still works.