Text ⇆ code points
Convert both ways between text, U+ notation, escapes, entities and raw UTF-8
bytes — and, because it is the reason most people end up here,
find the invisible character that is breaking something.
- Formats
- U+ · \u · entity · bytes
- Inspects
- every character
- Flags
- invisible & confusable
Input
Code points
Characters worth a second look
Every character
Worth knowing
Length lies about emoji
JavaScript's .length counts UTF-16 units, so 😀 is 2 and a
family emoji is 11. Characters, code points and bytes are three different numbers, and this
page shows all three because picking the wrong one is behind a lot of broken validation.
The invisible character problem
A zero-width space pasted from a web page or a design tool looks like nothing at all, but
breaks string comparisons, search, and ===. Anything with no width gets its own
marker in the inspector rather than an empty-looking cell.
Cyrillic а is not Latin a
They render identically in almost every font, and they are entirely different characters. This is the mechanism behind lookalike domain names, and it is also why a copied identifier can refuse to match something that looks the same on screen.
Surrogate pairs are a UTF-16 artefact
Anything above U+FFFF is stored as two units in JavaScript. Slicing a string mid-pair produces an unpaired surrogate — the lone � you sometimes see after a truncation. The inspector works in code points, so pairs stay whole.
Escapes are language-specific
H is JavaScript, Java and C#. H is HTML and XML.
U+0048 is how the standard itself writes it and is not valid in any of them.
Pick the one for where the text is going.
Decoding is forgiving
Paste U+0048, H, H, H,
0x48 or plain 72 and they all decode. Mixed formats in one paste
are fine, because real-world text rarely arrives in a single tidy notation.