Why this matters
Understanding how characters map to numeric code points is foundational for anyone working with low-level text processing, network protocols, or character encoding issues. When a UTF-8 byte sequence is garbled or a serial protocol sends raw hex values, being able to manually convert between text and its underlying numeric representation is the difference between minutes and hours of debugging. The ASCII standard covers the first 128 characters, but modern text extends into the full Unicode range where code points can reach six digits in hexadecimal.
The critical implementation detail is that this converter uses `String.codePointAt` instead of the older `charCodeAt` method. The difference matters for emoji and other characters in the astral planes: `charCodeAt` returns surrogate halves, splitting a single emoji into two meaningless 16-bit values, while `codePointAt` returns the full code point. This means the wave emoji is correctly encoded as `U+1F44B` (128075 in decimal) rather than being split into two broken halves.
Encoding format comparison
| Format | Example 'Hi' | Example emoji | Padding | Uppercase |
|---|---|---|---|---|
| Decimal | 72 105 | 128075 | None | N/A |
| Hexadecimal | 48 69 | 1F44B | None | Yes (A-F) |
| Binary | 01001000 01101001 | 111110000100010011 | 8-bit zero-pad | N/A |
How to use it
Type or paste your text into the input box — works with plain ASCII, extended Unicode, and emoji.
Pick a format from decimal, hexadecimal, or binary, and choose a separator such as space, comma, or newline.
Read the converted codes in the output box and click Copy to grab them.
Click Swap to flip the direction and decode numeric codes back into text.
Use custom separators by typing any string into the separator field, including ` ` for newline or ` ` for tab.
Testing your result
Verify the output by encoding a known character manually. The letter 'A' should produce 65 in decimal, 41 in hexadecimal, and 01000001 in binary. Test an emoji like the check mark, which lives at U+2714, confirming the tool returns 10004 in decimal and 2714 in hex. For the round-trip test, encode a mixed string, copy the output, swap the direction, paste the codes, and confirm the decoded text matches your original input character for character.
Common mistakes
Using `charCodeAt` mentally and expecting a single code point for emoji — the tool avoids this, but other sources may not.
Forgetting that binary output is zero-padded to 8 bits only for code points within the ASCII range; larger Unicode values produce more bits.
Leaving whitespace or line breaks in pasted base data, which can cause decoding errors.
Assuming the tool is limited to ASCII only — it handles the full Unicode range via `String.fromCodePoint`.
Edge cases and options
Codes above 127 are decoded back to their proper Unicode characters using `String.fromCodePoint`, which handles the full range up to code point 0x10FFFF. Binary output for small code points is padded to 8 bits, but higher code points naturally require more bits and are not padded to a fixed width. The separator field accepts arbitrary strings, so you can format output for specific use cases — pipe-delimited for spreadsheet import, newline-delimited for script input, or comma-separated for programmatic parsing. The Swap button instantly reverses the direction without reloading, making back-and-forth conversion fluid.
Real-world use cases
Debugging UTF-8 encoding issues by converting garbled text back to code points and identifying which characters are outside the ASCII range.
Preparing character data for serial communication protocols that require hex or binary representations.
Reversing obfuscated strings found in JavaScript or HTML where text has been replaced with ASCII code arrays.
Teaching computer science students how character encoding works by letting them experiment with real conversions.
Frequently asked questions
Q: Does it support emoji?
A: Yes. The converter uses `String.prototype.codePointAt` instead of `charCodeAt`, so astral-plane characters like the wave emoji (U+1F44B) are encoded as a single code point rather than two surrogate halves.
Q: What formats are supported?
A: Decimal (base 10), hexadecimal (base 16, uppercase), and binary (base 2, zero-padded to 8 bits where applicable). Switch with one click.
Q: Can I use a custom separator?
A: Yes — enter any string in the separator field. Use ` ` for newline and ` ` for tab if needed.
Q: Does it decode non-ASCII codes correctly?
A: Yes — codes above 127 are decoded back to their proper Unicode characters using `String.fromCodePoint`.
Q: What is the maximum code point supported?
A: The tool supports the full Unicode range up to U+10FFFF (1,114,111 in decimal), which is the maximum code point defined by the Unicode standard.
Q: How do I encode an entire sentence as a single number?
A: Use the separator field to remove all separators, then treat the concatenated digits as a sequence. Each code point is still individually decodable by knowing the expected digit width.
Start using it now
Try the ASCII Code Converter tool. See also Morse Code Translator, Case Converter, and Reverse Text.