What this tool does
It turns text into numbers: for each character you type, it reports the underlying code point in several bases so you can see exactly how the text is encoded. This is useful for debugging encoding issues, building escaping logic, inspecting invisible control characters, or understanding how a string is stored at the byte level.
How it works
The input string is split into characters with Array.from, which iterates by Unicode code point rather than by 16-bit code unit. For each character the tool calls codePointAt(0) to get its numeric value, then formats that value in decimal, hexadecimal, octal, and the canonical U+ notation. Characters with a code point of 127 or less are plain ASCII; anything higher is flagged as non-ASCII because no ASCII code exists for it.
Reading code points (rather than UTF-16 code units) matters for characters above U+FFFF, such as emoji: a naive per-code-unit approach would split them into surrogate pairs and report two wrong numbers.
ASCII vs Unicode: what each column means
| Column | Format | Example for ‘A’ | Notes |
|---|---|---|---|
| Decimal | Base 10 | 65 | The number you would store in a C char variable |
| Hexadecimal | Base 16 | 0x41 | How bytes appear in a hex editor or network packet dump |
| Octal | Base 8 | 0101 | Used in C/Python escape sequences like \101 |
| U+ notation | Unicode hex | U+0041 | The canonical Unicode standard reference format |
For codes 0–127 the decimal value is simultaneously the ASCII code and the Unicode code point — ASCII is a subset of Unicode.
Worked example
Typing Gé@😀 yields four rows:
| Char | Decimal | Hex | U+ | ASCII? |
|---|---|---|---|---|
| G | 71 | 47 | U+0047 | Yes |
| é | 233 | E9 | U+00E9 | No |
| @ | 64 | 40 | U+0040 | Yes |
| 😀 | 128512 | 1F600 | U+1F600 | No |
The é and 😀 are flagged as non-ASCII. The grinning-face emoji has a code point above U+FFFF, which means it is encoded as a UTF-16 surrogate pair internally in JavaScript — but the tool reads it correctly as a single code point because it uses Array.from and codePointAt.
Common use cases
- Debugging encoding issues. Mysterious characters appearing in a string are immediately identifiable by their code point.
- Building escape sequences. If you need to embed a character in a JSON string or URL, its hex code is the basis for
\uXXXXand%XXescaping. - Inspecting invisible characters. Paste text containing zero-width spaces (U+200B) or non-breaking spaces (U+00A0) to find them — they look blank but decode to non-zero codes.
- Writing regex character ranges. Knowing the hex range of a character class helps write accurate character-class ranges in regular expressions.
The copy button gives you the space-separated decimal codes for the whole string, which pairs naturally with the reverse code-to-character tool. All processing runs locally in your browser.