Hex to String Converter — Decode Hexadecimal to ASCII Text

Quick answer: Hex to string conversion turns a hexadecimal sequence (like 48656c6c6f) into the readable ASCII text it represents (Hello). Each pair of hex digits maps to one byte, which maps to one character. This page does the conversion locally in your browser — paste, click Convert, copy.

What is hexadecimal?

Hexadecimal (or hex) is a base-16 number system that uses 16 digits: 0–9 and a–f (or A–F). Each hex digit represents 4 bits, so two hex digits represent exactly one byte (8 bits = 0 to 255).

Hex is the standard way humans and tools talk about binary data: every byte of a file, network packet, or memory address can be written as two hex characters instead of eight 1s and 0s. That's why programmers see hex everywhere — debuggers, hex editors, network captures, cryptographic hashes, color codes (#ff5733), and more.

How hex to string conversion works

Converting hex to a readable string is a simple three-step process:

  1. Strip non-hex characters (spaces, 0x prefix, #, newlines).
  2. Read two hex digits at a time → convert that pair to a number (0–255) → that's one byte.
  3. Map each byte to a character using its ASCII / UTF-8 value.

For example, 48 65 6c 6c 6f decodes byte by byte:

  • 48 → 72 → H
  • 65 → 101 → e
  • 6c → 108 → l
  • 6c → 108 → l
  • 6f → 111 → o

Result: Hello.

Examples

Hex input String output Notes
48656c6c6fHelloPlain ASCII, no separators
48 65 6c 6c 6fHelloSpaces stripped automatically
0x48656c6c6fHello"0x" prefix stripped
7468697320697320612074657374this is a testSpaces are encoded as 0x20
e29ca8UTF-8 emoji (3 bytes)

When you'd convert hex to string

  • Debugging network traffic — Wireshark, tcpdump, and packet captures display payloads as hex. Decoding to text reveals plain-text protocols (HTTP, SMTP, IRC).
  • Reading hex dumps — output from xxd, hexdump, or hex editors needs decoding to see the underlying string content.
  • Reverse engineering — string literals embedded in binaries appear as hex byte sequences in disassemblers.
  • Decoding URL/cookie values — some web apps store identifiers or tokens as hex-encoded UTF-8 instead of base64.
  • Forensics and CTF challenges — hex is a common transport for hidden text in capture-the-flag puzzles.
  • Decoding ID tokens, hashes, signatures — though hashes themselves aren't text, surrounding metadata often is.

Doing it in code

If you need this as part of a script or app, here are the standard one-liners:

JavaScript

const hex = "48656c6c6f";
const str = hex.match(/.{1,2}/g).map(b => String.fromCharCode(parseInt(b, 16))).join("");
// "Hello"

Python

bytes.fromhex("48656c6c6f").decode("utf-8")
# "Hello"

Bash

echo -n "48656c6c6f" | xxd -r -p
# Hello

Node.js

Buffer.from("48656c6c6f", "hex").toString("utf-8")
// "Hello"

Common gotchas

  • Odd-length hex input — Each byte needs exactly 2 hex digits. a3f is missing one digit — should it parse as 0a 3f or a3 0f? Best to fix the source.
  • Bytes > 0x7F — ASCII only covers 0x00–0x7F. Bytes above 0x7F (e.g. 0xc3 0xa9 = "é" in UTF-8) need UTF-8 decoding to display correctly. This tool handles UTF-8 bytes one at a time, which can show garbled text for multi-byte chars.
  • Non-printable bytes0x00–0x1F are control characters (null, tab, newline, etc.). They don't display visibly but are present in the output.
  • Endianness — single-byte values have no endianness. But if your hex represents multi-byte integers (e.g. UTF-16), byte order matters and a simple hex-to-string won't preserve it correctly.

Frequently asked questions

What is hex to string conversion?

Hex to string conversion takes a hexadecimal value (base-16, like 48656c6c6f) and decodes each two-digit pair into the ASCII character it represents. The example 48656c6c6f decodes to Hello. It is the reverse of string-to-hex encoding.

How do I convert hex to text?

Paste your hex value into the input box and click Convert. The tool reads two hex digits at a time, converts each pair to a byte (0–255), and outputs the corresponding ASCII character. Spaces, 0x prefixes, and the # character are stripped automatically.

Does this tool support UTF-8 hex?

Yes. UTF-8 multi-byte characters decode correctly because the converter treats input as raw bytes. For example, e29ca8 decodes to ✨ (sparkles emoji). For pure ASCII text, every character maps to a single byte.

What does the 0x prefix mean in hex?

The 0x prefix is a notation convention used in C, JavaScript, Python, and many other programming languages to indicate that the following digits are hexadecimal rather than decimal. It is purely a marker — the actual value is the digits after it. This converter strips 0x automatically.

Why am I getting odd or garbage characters?

Two common causes: (1) odd number of hex digits — every byte needs exactly 2 hex chars, so a3f is invalid (should be 0a3f or a30f). (2) hex values above 0x7F that represent non-printable bytes — these are valid binary data but display as control characters or boxes. If you expected text, the source data may not be ASCII text-encoded.

Is hex to string the same as base16 decode?

Yes — base16 and hex are the same thing. RFC 4648 defines base16 as the formal name for hex encoding. Some tools label it base16 decode, others hex decode. The output is identical.

Are my hex values sent to a server?

No. The conversion runs entirely in your browser using JavaScript. Nothing is uploaded, logged, or stored. You can confirm by opening DevTools → Network and verifying no request fires when you click Convert.

More pages about Hex to String

Explore intent-specific pages to match what people search for. These are lightweight guides that link back to the main interactive tool.

Want more? Browse all variants for this tool: View related pages