UTF-8 & Code Point Inspector — Bytes and u-Escapes

Look under the hood of your text: each character’s code point and UTF-8 bytes, the byte-versus-character counts, and \u escape conversion.

—

What this tool does

It shows what your text actually is at the level below the screen: each character's Unicode code point, the UTF-8 bytes it is stored as, and how the three common ways of counting a string — bytes, code points and UTF-16 units — differ. It also converts to and from the \u escape form that JSON, JavaScript and configuration files use.

Three ways to count the same string

CountWhat it measuresExample
UTF-8 bytesStorage and network size"é" = 2
Code pointsCharacters as Unicode defines them"é" = 1
UTF-16 unitsJavaScript's .length"😀" = 2

Why this matters in practice

Almost every "the counter says I'm over the limit" problem is one of these counts disagreeing. A database column sized in bytes, a tweet limited in code points, a JavaScript substring that sliced an emoji in half because it counted UTF-16 units — knowing which number a system is using is the whole fix. The breakdown table lets you see exactly where the bytes go, so non-Latin text and emoji stop being mysterious.

When escaping is useful

A \u escape names a character by number, so the text renders correctly no matter what encoding the file is opened in — which is why JSON and config files often use it for anything non-ASCII. It also makes invisible or confusable characters visible in review: a zero-width space or a homoglyph shows up as a distinct escape instead of hiding in the plain text.

Frequently asked questions

What does this tool show?

For every character in your text: its Unicode code point, the UTF-8 bytes it is stored as, and how many bytes it takes. It also converts text to and from \u escape sequences, the form used in JSON, JavaScript and many config files.

Why is one character sometimes several bytes?

UTF-8 is variable-length. Plain ASCII — letters, digits, common punctuation — is one byte each, up to 127. Latin accents are two bytes, most CJK characters three, and many emoji four. So the byte count of a string is usually larger than its character count, and the gap grows with non-English text.

What is a code point?

The number Unicode assigns to a character, written U+XXXX in hexadecimal. "A" is U+0041, "é" is U+00E9, the emoji 😀 is U+1F600. A code point is the character’s identity; UTF-8 is one way of storing that identity as bytes, and UTF-16 (JavaScript strings) is another.

What are \u escapes for?

They write a character by its code point so the text survives any encoding. \u00e9 is é and \u{1F600} is 😀. JSON, JavaScript string literals and many configuration formats use them; the tool converts both ways, including the braced form the astral characters need.

Why do some languages count my text length wrong?

Because "length" is ambiguous. A string has a count of bytes, of code points, and of UTF-16 units — and JavaScript’s .length counts UTF-16 units, so an emoji counts as two. This tool shows all three so you can see which one a limit is actually measuring.

Is my text uploaded?

No. Everything is computed in your browser; the text never leaves the page.

Sources

  • RFC 3629 — UTF-8, a transformation format of ISO 10646.
  • The Unicode Standard — code points and the U+ notation.

Everything runs in your browser — nothing you type is uploaded.