About the Hex to ASCII Converter
The Hex to ASCII Converter translates hexadecimal byte values to readable ASCII text and encodes ASCII text back to hex. Use it to inspect binary data, decode hex dumps from network traces, debug serial communication, interpret memory dumps, and work with encoding in low-level programming, embedded systems, and security analysis.
How to Use
- Hex to ASCII: Paste hex values into the input field — space-separated (
48 65 6C 6C 6F), run-together (48656C6C6F), or with 0x prefixes (0x48 0x65 0x6C). Click Convert to read the ASCII text.
- ASCII to Hex: Type or paste ASCII text and click Encode. The output shows each character as its 2-digit hex byte value.
- Toggle output formatting: uppercase hex, lowercase hex, space-delimited, or compact.
ASCII and Hex Fundamentals
ASCII (American Standard Code for Information Interchange) defines 128 characters — control codes (0x00–0x1F), printable characters (0x20–0x7E), and the DEL character (0x7F). Each character maps to a 7-bit value conventionally written as a 2-digit hexadecimal byte:
0x41 → A 0x61 → a
0x30–0x39 → digits 0–9
0x20 → space 0x0A → newline (LF) 0x0D → carriage return (CR)
0x00 → NUL (string terminator in C) 0x1B → ESC (ANSI escape codes)
Common Use Cases
- Network packet inspection — Wireshark and tcpdump display payload bytes as hex. Convert those bytes to ASCII to read HTTP headers, SMTP commands, or plaintext protocol messages.
- Debugging serial and UART communication — Serial terminals often show received bytes in hex. Convert to ASCII to verify the device is sending the expected text commands or responses.
- Binary file header inspection — File magic numbers identify file types.
89 50 4E 47 → PNG; 25 50 44 46 → PDF (%PDF). Pasting the first bytes of an unknown file reveals its format.
- Encoding in cryptography and security — Hash outputs, encryption keys, and digital signatures are binary data commonly displayed as hex strings. This tool helps verify expected values against documented test vectors.
- Embedded systems development — Firmware and microcontroller code often work with raw byte values. Converting between hex literals and their ASCII meaning speeds up debugging.
Hex, ASCII, and Extended Character Sets
ASCII covers only 128 characters (7-bit values 0x00–0x7F). Bytes above 0x7F are not standard ASCII:
- Latin-1 (ISO-8859-1) — Values 0x80–0xFF map to accented characters and additional symbols. This is the default interpretation in many legacy Windows and HTTP contexts.
- UTF-8 multi-byte sequences — Bytes above 0x7F in UTF-8 are part of multi-byte sequences. A single character like
é encodes as two bytes: C3 A9. Interpreting each byte individually as Latin-1 produces mojibake.
- Binary data — Bytes that do not correspond to printable characters appear as control characters or are shown as dots in hex editors. Non-printable ranges: 0x00–0x1F and 0x7F.
Common Conversion Errors
- Odd hex digit count — Each byte requires two hex digits. An input like
4865 6C6 has an incomplete last byte. Pad with a leading zero: 06.
- 0x prefix confusion — The tool accepts
0x48 prefix notation, but mixing prefixed and unprefixed values in the same input may cause parse errors. Use one format consistently.
- Control characters in output — Bytes like
0x00, 0x0A, 0x1B are valid ASCII but not printable. The output may contain invisible characters or line breaks that affect display.
- High bytes misread as ASCII — If your hex contains bytes above
7F, those are not ASCII characters. The output is only meaningful if you know the encoding (Latin-1, UTF-8, etc.) and interpret accordingly.
Frequently Asked Questions
- What is the hex value of a space?
- Space is
0x20 (decimal 32). It is the first printable ASCII character. Tab is 0x09, newline (LF) is 0x0A, and carriage return (CR) is 0x0D. Windows line endings are CRLF (0D 0A); Unix uses LF only (0A).
- How do I convert hex to ASCII in code?
- In Python:
bytes.fromhex("48656C6C6F").decode('ascii') → "Hello". In JavaScript: "48656C6C6F".match(/.{2}/g).map(h => String.fromCharCode(parseInt(h, 16))).join(''). In PHP: hex2bin('48656c6c6f') → binary string, then treat as ASCII.
- What does a hex dump look like?
- A hex dump shows byte offsets, hex values, and ASCII representation side by side — the format used by tools like
xxd, hexdump, and Wireshark. Example: 00000000 48 65 6c 6c 6f 20 77 6f 72 6c 64 0a |Hello world.|. Non-printable characters appear as dots in the ASCII column.
- Why is 0xFF not a valid ASCII character?
- ASCII is a 7-bit standard — valid values are 0x00 through 0x7F. The byte value 0xFF (255 decimal) falls outside the ASCII range. It is a valid byte in Latin-1 (the ÿ character), in UTF-8 it cannot appear at all (it is not a valid UTF-8 byte), and in binary contexts it often appears as a fill byte or delimiter.