Skip to main content

Hex to ASCII

Convert hexadecimal byte sequences to human-readable ASCII text. Supports space-separated, comma-separated, or 0x prefixed hex values.

Overview

The Hex to ASCII tool decodes hex bytes to UTF-8 text. Input can be formatted with:
  • Space-separated: 48 65 6c 6c 6f
  • Comma-separated: 48,65,6c,6c,6f
  • 0x prefix: 0x48 0x65 0x6c 0x6c 0x6f
  • Continuous: 48656c6c6f
Single-character hex values (e.g., a) are automatically padded to 0a.

Use Cases

Binary data inspection

Decode hex dumps from network packets, memory dumps, or binary files

Protocol debugging

Convert hex-encoded payloads to readable strings

Reverse engineering

Decode embedded strings from hex representations

Cryptographic analysis

Inspect hex-encoded hashes, keys, or ciphertexts

Input Format

Paste hex bytes in any of these formats:
Example: Space-separated
48 65 6c 6c 6f 20 57 6f 72 6c 64
Example: 0x prefix
0x48 0x65 0x6c 0x6c 0x6f
Example: Continuous
48656c6c6f
The tool automatically strips whitespace, commas, and 0x prefixes.

Output

Decoded UTF-8 text with byte count metadata.
Input:
48 65 6c 6c 6f 20 57 6f 72 6c 64
Output:
Hello World
Meta:
11 bytes

Error Handling

Non-hex characters (except whitespace, commas, and 0x) produce an error:
Invalid hex byte: "zz"
Single-character tokens are automatically padded (e.g., a0a). No error is raised.
Byte sequences that don’t form valid UTF-8 may produce replacement characters (\uFFFD) or decoding errors.

Implementation Details

The tool tokenizes the input by whitespace, removes 0x prefixes, pads single-digit hex values, and decodes each byte with TextDecoder (UTF-8). Source: lib/tools/engine.ts:946-960
Key logic
const cleaned = input.trim().replace(/0x/gi, '').replace(/[,\s]+/g, ' ');
const tokens = cleaned.split(' ').filter(Boolean);
const byteVals = tokens.map((t) => {
  const normalized = t.length === 1 ? '0' + t : t;
  if (!/^[0-9a-fA-F]{2}$/.test(normalized)) throw new Error(`Invalid hex byte: "${t}"`);
  return parseInt(normalized, 16);
});
return new TextDecoder().decode(new Uint8Array(byteVals));
For encoding ASCII to hex, use the ASCII to Hex tool.

Keyboard Shortcuts

  • Cmd/Ctrl+Enter — Convert hex to ASCII
  • Cmd/Ctrl+Shift+C — Copy output
  • Cmd/Ctrl+Shift+S — Download output

ASCII to Hex

Reverse operation: convert ASCII text to hex bytes

Base64 String Encode/Decode

Encode/decode Base64 strings

Number Base Converter

Convert between binary, octal, decimal, and hex

Build docs developers (and LLMs) love