Character to CharCode Converter
Convert any character to its Unicode code point in decimal, hex, octal, binary, or HTML entity format. Supports full Unicode including emoji.
About
Every character rendered on screen maps to a numeric code point in the Unicode standard. Misidentifying a code point leads to encoding corruption, broken internationalization, and silent data loss in databases that reject out-of-range values. This tool converts any input character - including supplementary plane symbols like emoji and CJK ideographs beyond U+FFFF - into its precise decimal, hexadecimal, octal, binary, or HTML entity representation using codePointAt rather than the legacy charCodeAt, which fails on surrogate pairs. It handles the full Unicode range from U+0000 to U+10FFFF.
Note: this tool operates on Unicode scalar values. It does not decompose grapheme clusters such as flag sequences or skin-tone modified emoji into their constituent code points - each code unit in the surrogate pair is resolved individually when using the code-unit mode. For canonical decomposition, a separate normalization step (NFC/NFD) is required before conversion. Pro tip: when debugging encoding issues, compare the hex output here against your database's column collation to confirm whether the mismatch is at the application layer or storage layer.
Formulas
The core conversion extracts the Unicode code point of each character and represents it in the target radix. For a character c at position i in the input string:
The code point cp is then converted to the desired output format:
Where cp = the Unicode code point (a non-negative integer in the range 0 to 1,114,111 or 0x10FFFF), s = the input string, and i = the character index. The function codePointAt correctly handles supplementary plane characters (code points > 0xFFFF) that are stored as surrogate pairs in JavaScript's UTF-16 internal encoding, unlike the legacy charCodeAt which returns the individual surrogate values.
For reverse conversion (code point โ character):
Reference Data
| Character | Name | Decimal | Hex | HTML Entity | UTF-8 Bytes |
|---|---|---|---|---|---|
| NUL | Null | 0 | 0x00 | 00 | |
| TAB | Horizontal Tab | 9 | 0x09 | 09 | |
| LF | Line Feed | 10 | 0x0A | 0A | |
| CR | Carriage Return | 13 | 0x0D | 0D | |
| Space | 32 | 0x20 | 20 | ||
| ! | Exclamation Mark | 33 | 0x21 | ! | 21 |
| 0 | Digit Zero | 48 | 0x30 | 0 | 30 |
| A | Latin Capital A | 65 | 0x41 | A | 41 |
| Z | Latin Capital Z | 90 | 0x5A | Z | 5A |
| a | Latin Small A | 97 | 0x61 | a | 61 |
| z | Latin Small Z | 122 | 0x7A | z | 7A |
| ~ | Tilde | 126 | 0x7E | ~ | 7E |
| DEL | Delete | 127 | 0x7F | | 7F |
| ยฉ | Copyright Sign | 169 | 0xA9 | © | C2 A9 |
| ยฎ | Registered Sign | 174 | 0xAE | ® | C2 AE |
| รฑ | Latin Small N with Tilde | 241 | 0xF1 | ñ | C3 B1 |
| ฮฑ | Greek Small Alpha | 945 | 0x3B1 | α | CE B1 |
| ฯ | Greek Small Pi | 960 | 0x3C0 | π | CE 80 |
| โ | Snowman | 9731 | 0x2603 | ☃ | E2 98 83 |
| โค | Heavy Black Heart | 10084 | 0x2764 | ❤ | E2 9D A4 |
| ไธ | CJK Ideograph (World) | 19990 | 0x4E16 | 世 | E4 B8 96 |
| ๐ | Grinning Face Emoji | 128512 | 0x1F600 | 😀 | F0 9F 98 80 |
| ๐ก | Electric Light Bulb | 128161 | 0x1F4A1 | 💡 | F0 9F 92 A1 |
| ๐ | Earth Globe Europe-Africa | 127757 | 0x1F30D | 🌍 | F0 9F 8C 8D |