TOP

Free browser-based hex decoder

Hex to ASCII Converter

Convert hexadecimal bytes into readable text. Choose standard ASCII for bytes from 00 to 7F, or UTF-8 for multilingual text, symbols, and emoji.

No signup Free online conversion

Interactive tool

Decode hexadecimal bytes into text

Ready

Text encoding

Spaces, line breaks, commas, colons, hyphens, 0x prefixes, and \x byte escapes are accepted. Every byte must contain two hex digits.

Conversion guide

How Hex to ASCII Conversion Works

Hexadecimal writes each byte with two base-16 digits from 00 to FF. To decode ASCII, parse each pair as a byte and map values from 00 through 7F to the matching ASCII character. Hex 48 is decimal 72, which represents H.

The input 48 65 6C 6C 6F therefore becomes Hello. Separators only make byte boundaries easier to read; compact input such as 48656C6C6F produces the same result.

Hex byteDecimalASCII character
2032Space
30480
4165A
4872H
6197a
7A122z

Hex to ASCII in JavaScript

For standard ASCII, split the hex into two-digit bytes, parse each byte with parseInt(pair, 16), reject values above 0x7F, and convert the remaining values with String.fromCharCode.

function hexToAscii(hex) {
  const compact = hex.replace(/\s+/g, "");
  if (!/^(?:[0-9a-f]{2})+$/i.test(compact)) {
    throw new Error("Invalid hex bytes");
  }
  return compact.match(/../g).map((pair) => {
    const byte = parseInt(pair, 16);
    if (byte > 0x7F) throw new Error("Not standard ASCII");
    return String.fromCharCode(byte);
  }).join("");
}

hexToAscii("48 69"); // Hi

Hex to ASCII in Python

Python's bytes.fromhex accepts space-separated or compact hexadecimal. Decode with "ascii" for strict standard ASCII, or "utf-8" when the byte stream represents multilingual Unicode text.

ascii_text = bytes.fromhex("48 65 6C 6C 6F").decode("ascii")
utf8_text = bytes.fromhex("E4 BD A0 E5 A5 BD").decode("utf-8")

print(ascii_text)  # Hello
print(utf8_text)   # 你好

Hex Bytes: Standard ASCII vs UTF-8

Standard ASCII defines byte values from 00 to 7F. A byte from 80 to FF is not standard ASCII on its own. It may belong to UTF-8, Latin-1, Windows-1252, or another encoding.

Choose UTF-8 text when the bytes come from a modern web page, JSON payload, API, or UTF-8 file. For example, E4 BD A0 E5 A5 BD is the UTF-8 byte sequence for 你好. Choose Standard ASCII when every byte must stay within 00-7F.

Hex describes byte values, not the text encoding.

The same byte above 7F can mean different characters in different encodings. Select the encoding that matches the source data.

Invalid Hex and Incomplete Byte Input

Every byte needs exactly two hexadecimal digits. Input such as 486 is incomplete, and characters outside 0-9 and A-F are invalid. The converter reports these problems instead of silently changing the byte stream.

In Standard ASCII mode, bytes above 7F appear as ? with a warning. In UTF-8 mode, malformed byte sequences use the replacement character and show a warning so you can check the original encoding.

Advertisement

Sponsored link