Character to ASCII / Unicode Code Converter

Get the decimal, hex, and octal codes for any character

Convert any character to its ASCII or Unicode code point in decimal, hexadecimal, and octal, with the U+ form too. Handles emoji and accented letters correctly, processing each character in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the difference between an ASCII code and a Unicode code point?

For characters 0 to 127 they are identical. Above 127 there is no ASCII code; the character has only a Unicode code point. This tool reports the Unicode code point and flags any character that is not plain ASCII.

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

ColumnFormatExample for ‘A’Notes
DecimalBase 1065The number you would store in a C char variable
HexadecimalBase 160x41How bytes appear in a hex editor or network packet dump
OctalBase 80101Used in C/Python escape sequences like \101
U+ notationUnicode hexU+0041The 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:

CharDecimalHexU+ASCII?
G7147U+0047Yes
é233E9U+00E9No
@6440U+0040Yes
😀1285121F600U+1F600No

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 \uXXXX and %XX escaping.
  • 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.