b2KIT

ASCII to Hex Converter

Convert ASCII text to hexadecimal values and hex strings back to ASCII characters with multiple format options.

Tested tool guide Tested browser tools Checked August 16, 2026

What ASCII to Hex Converter does, with a checked example

This tool converts text into hexadecimal by taking each character, encoding it to bytes, and writing each byte as a two-digit hex pair; it also runs the reverse, turning a hex string back into text by regrouping the digits into bytes and decoding them. Despite the name, most implementations encode using UTF-8 rather than strict 7-bit ASCII, so a character outside the 0-127 range produces more than one hex pair per character. Users often expect a fixed one-character-to-one-byte mapping and are surprised when accented letters, curly quotes, or emoji expand into multiple bytes.

Worked example

A concrete input and expected output from the current implementation.

Input

Hi

Expected output

48 69

H is byte value 72 (0x48) and i is byte value 105 (0x69); each ASCII character maps to exactly one byte because both fall within the 0-127 range.

How the result is produced

1

Text to hex

Each input character is converted to its underlying byte or bytes using a text encoding (UTF-8 for anything outside 7-bit ASCII), and every byte is written as two hexadecimal digits. Digits are then joined according to the chosen output style, such as space-separated pairs, a continuous run of digits, or a 0x-prefixed list.

2

Hex to text

The hex input is first stripped of separators like spaces, commas, or 0x prefixes, then split into two-character byte pairs. Each pair is parsed as a base-16 number and decoded back into a character. An odd count of hex digits or a non-hex character in the string leaves a byte pair incomplete or invalid, which breaks the decode.

Good uses

  • Reading a hex dump from a packet capture or serial log by converting the byte sequence back into the text it represents.
  • Producing a hex-encoded string literal to paste into source code, a config file, or firmware where raw text isn't accepted.
  • Decoding a hex-encoded flag, token, or parameter found in a CTF challenge, API response, or log file back into plain text.

Limits and checks

  • Characters beyond the 0-127 ASCII range encode as multiple UTF-8 bytes each, so a hex output longer than 2x the character count usually signals non-ASCII input, not an error.
  • Decoding is sensitive to formatting: leftover spaces, mismatched case, or a 0x prefix the tool doesn't expect can cause a failed or garbled decode even though the underlying digits are correct.
  • An odd number of hex digits, or any character outside 0-9 and a-f/A-F, cannot form a valid byte pair and will not decode cleanly.

Common questions

Will this mangle accented letters or emoji since the tool is named for ASCII?

It won't corrupt them, but it also won't treat them as single ASCII bytes. Non-ASCII characters get encoded as multi-byte UTF-8 sequences: an accented letter like e with an acute accent typically becomes two hex pairs, while an emoji outside the Basic Multilingual Plane can expand to four, instead of one, which is expected behavior, not a bug.

Can I paste a hex dump copied from a network tool with offsets and ASCII side panels?

No. The decoder expects just the hex digits themselves, with at most simple separators like spaces. Line numbers, byte offsets, or the ASCII preview column that tools like Wireshark or a hex editor print alongside the bytes need to be removed first.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools