Text Tools· 4 min read

ASCII Code Converter: Text to Decimal, Hex, and Binary Codes

Encode any text into decimal, hexadecimal, or binary ASCII and Unicode code points, then decode them back with a single click.

By EasyText Team Last updated: 2026-08-20.

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.

See it in action

Encoding format comparison

FormatExample 'Hi'Example emojiPaddingUppercase
Decimal72 105128075NoneN/A
Hexadecimal48 691F44BNoneYes (A-F)
Binary01001000 011010011111100001000100118-bit zero-padN/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.

Need help using this tool?

Read our complete ASCII Code Converter tutorial for step-by-step guidance.

Ready to try the tool?

No accounts. No uploads. No limits. Start now.