Hex to String & Bytes to ASCII — How It Works
This guide explains what hex encoding is, how bytes map to ASCII characters, and when you need bytes-to-string conversion. Use the free online converter to decode hex bytes instantly in your browser.
What Is Hex to String Conversion?
Hexadecimal (hex) is a base-16 number system that uses digits 0–9 and letters A–F. In computing, every byte (8 bits) of data is represented as exactly two hex digits, ranging from 00 to FF. Hex to string conversion means taking those hex byte values and mapping each one back to its corresponding ASCII character so you can read the original text.
For example, the string Hello encoded as hex bytes is 48 65 6C 6C 6F. Each byte maps directly to a letter:
| Hex | Decimal | ASCII |
|---|---|---|
48 | 72 | H |
65 | 101 | e |
6C | 108 | l |
6C | 108 | l |
6F | 111 | o |
Bytes to ASCII: How the Mapping Works
ASCII defines a standard mapping from byte values 0–127 to characters. Printable characters occupy the range 0x20 (space) through 0x7E (tilde ~). Converting bytes to ASCII means looking up each byte value in this table and returning the corresponding character.
Key ranges to know when converting bytes to ASCII:
0x30–0x39— digits 0–90x41–0x5A— uppercase A–Z0x61–0x7A— lowercase a–z0x20— space ·0x09— tab ·0x0A— newline
Byte values above 0x7F are outside standard ASCII. Extended encodings like Latin-1 or UTF-8 cover these higher values. The converter shows bytes outside the printable ASCII range as a middle dot (·) by default so the output stays readable.
Bytes to String: When You Need This
Converting raw byte sequences to readable string output is a common task across many technical workflows:
- Network analysis — packet captures in Wireshark or tcpdump display payloads as hex. Converting bytes to string reveals HTTP headers, cookie values, or plain-text protocol messages.
- Binary file inspection — file magic bytes identify formats.
FF D8 FFis a JPEG;89 50 4E 47is a PNG;50 4B 03 04is a ZIP archive. - Embedded systems & IoT — microcontrollers commonly output data over serial in hex notation. Converting bytes to ASCII lets you read sensor readings, log messages, or command responses.
- Debugging & memory inspection — hex dumps from debuggers, memory profilers, or database BLOBs become readable text once decoded.
- Cryptography — keys, nonces, IVs, and cipher outputs are frequently represented as hex strings when passed between systems or libraries.
- Source code verification — string literals stored as hex byte arrays in C, Python, or Java source can be decoded to verify their content.
How to Use the Hex to String Converter
- Open the converter.
- Click ASCII ← HEX to make the hex side the editable input.
- Paste your hex bytes into the Hexadecimal box.
- The decoded ASCII text appears live in the ASCII / Text box — no button press required.
- Use the panel options to change the separator format, toggle uppercase/lowercase, or control how unprintable bytes are displayed.
You can also go the other way: click ASCII → HEX, type or paste text on the left, and get the hex encoding on the right. Both directions are live.
Supported Hex Input Formats
The converter strips common separators and prefixes automatically, so you can paste bytes in any notation you have:
| Format | Example input |
|---|---|
| Space-separated | 48 65 6C 6C 6F |
| 0x prefix | 0x48 0x65 0x6C 0x6C 0x6F |
| Colon-separated | 48:65:6C:6C:6F |
| Dash-separated | 48-65-6C-6C-6F |
| Comma-separated | 48,65,6C,6C,6F |
| No separator | 48656C6C6F |
Additional Features
- Encoding modes — ASCII / Latin-1, UTF-8, and UTF-16 LE for multi-byte character sets.
- Code array export — copy the hex bytes as a code array or string literal for C, Python, JavaScript, Java, C#, Go, Rust, or PHP.
- File import & download — import any file to inspect its bytes, or download the converted text, raw hex, or byte data.
- Shareable URL state — the converter encodes your current input into the URL so you can share a direct link.
- ASCII reference table — a built-in collapsible table covering all 128 ASCII values with decimal, hex, and character columns.
Privacy
All hex to string and bytes to ASCII conversion runs locally in your browser using JavaScript. No input is sent to any server at any point. See the privacy policy for full details.