
Hex ↔ ASCII Converter
Convert text to hexadecimal or hex back to ASCII. Supports space-separated and 0x prefix output. 100% client-side.
Last reviewed: April 2026New to this tool? Click here for instructions
Translate between raw bytes and human-readable text instantly. Paste ASCII to see the underlying hex, paste hex to decode it back, and inspect a classic hex-dump-style visualization of any input — all client-side, with no uploads.
What This Tool Does
This converter is a bidirectional bridge between two representations of the same data. Paste ASCII text and the tool emits the hex byte sequence — every character becomes its two-digit hex code, optionally separated by spaces or prefixed with 0x. Paste a hex string (with or without spaces, commas, or 0x prefixes) and the tool reassembles the original ASCII text by parsing each pair of hex digits as one byte and rendering the corresponding character. The same input field handles both directions; mode chips at the top of the tool select which conversion runs.
The tool also renders a classic hex-dump visualization for any input — three vertical columns showing byte offset, hex byte values, and printable ASCII translation, exactly as you would see them in xxd, hexdump -C, or HxD. This is the format every reverse engineer, protocol analyst, and forensic investigator learns to read fluently. The entire conversion runs in your browser via vanilla JavaScript — no input ever leaves your machine, no analytics on the converted content, and the tool works offline once the page is loaded.
How to Use It
The interface follows a predictable left-input, right-output layout shared across every encoder/decoder in this tool family. Working from top to bottom takes about ten seconds for a typical conversion.
Select Conversion Direction
Click ASCII → Hex or Hex → ASCII on the mode chips row. The direction chip you select determines how the tool interprets your input. The default is ASCII → Hex; switching reloads the example with appropriate sample data for that direction.
Pick Output Formatting
For ASCII → Hex conversions, two independent format toggles control the output style. Space-separated inserts a single space between each byte pair (e.g., 48 65 6C 6C 6F instead of 48656C6C6F) — easier to read by eye, easier to copy into documentation. 0x Prefix emits each byte as 0xNN, suitable for pasting directly into C, Python, JavaScript, or Rust source code. Enabling 0x automatically enables spacing, since 0x-prefixed runs are unreadable without separation.
Paste or Type Your Input
Drop ASCII text or hex bytes into the input pane on the left. Conversion runs live with a 150 ms debounce as you type — there is no separate Convert button to press. The status bar below the panes turns green when conversion succeeds and red on parse errors, with the specific error message inline (most commonly: odd number of hex digits, or non-hex characters mixed in).
Copy or Download the Result
The output pane on the right populates automatically. Copy sends the converted text to your clipboard; Download saves it as output.txt. The Clear button wipes the input and resets the status bar; Try Example pre-loads a sample value (Hello, World! for ASCII → Hex, or its 13-byte hex equivalent for the reverse direction). Tab in the input pane inserts two spaces instead of leaving the textarea, which matters when you are pasting partial hex dumps and want to preserve indentation.
Worked Example: "Hello, World!" Round Trip Plus a Magic Number
- Input (ASCII)
Hello, World!- Expected hex (space-separated)
48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21- Byte count
- 13 bytes
- Enter the source string. Select ASCII → Hex, enable Space-separated, then type
Hello, World!into the input pane. The output pane fills with the hex sequence above as you type. - Verify the first byte. The ASCII letter
Hhas codepoint 72 in decimal. Convert to hex: 72 = 4 × 16 + 8 =48. Match the first byte in the output:48. The second byte,65, is decimal 101 — the lettere. Continuing this byte-by-byte mapping reproduces the entire output column. - Check the count. The status bar reads Done — 13 characters, 13 bytes. Each character is a single ASCII byte; no multi-byte UTF-8 sequences are present in this input.
- Reverse the direction. Switch to Hex → ASCII. The Try Example button now pre-loads
48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21. The output pane showsHello, World!— confirming a clean round trip with no loss. - Decode a magic number. Clear the input. Paste
4D 5Ainto the Hex → ASCII pane. The output readsMZ— the two-byte signature at offset 0 of every Windows PE/EXE binary, named after Mark Zbikowski, the DOS designer who chose his own initials as the magic number in 1981.
Expected output for the round trip: hex output 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21; reverse decode returns the original string exactly. For the magic-number test: input 4D 5A decodes to MZ.
Common Use Cases: Reverse Engineering, Forensics, and Protocol Work
File Format Reverse Engineering
Every binary file format has structure: a header with magic numbers, length-prefixed sections, optional metadata, and a payload. When the format is undocumented or partially documented, the first move is always to open the file in a hex editor and look for visual patterns — repeated four-byte length fields, ASCII-readable identifiers (FourCC tags in RIFF/AVI/WAV files, atom names in MP4), and offset chains that point from one section to another. A hex-to-ASCII converter lets you decode individual byte spans on demand without firing up a full hex editor for one-off questions.
Network Packet Analysis
Wireshark and tcpdump both default to displaying captured packets as hex bytes with an ASCII sidebar. When debugging a custom protocol, you'll spend hours staring at hex dumps trying to match the bytes you see against your protocol specification. Pasting a hex run into this tool gives you the ASCII interpretation in one click — invaluable when the payload includes string fields like HTTP headers, JSON bodies, or user-agent strings buried inside framed binary protocols.
Debug Crash Dumps and Memory Inspection
Windows minidumps, Linux core files, and runtime debugger output all surface raw memory as hex. When a crash report includes a stack trace with addresses and a memory dump, decoding string buffers and stack-allocated structs by eye depends on quick hex↔ASCII conversion. The Binary ↔ Text Converter handles the same conversion at the bit level for embedded debug logs that print binary; the Base64 Encoder/Decoder covers the other common binary-in-text format.
Firmware Blob Decoding and Binary Protocols
Router firmware, BIOS dumps, microcontroller flash images, and IoT device firmware all arrive as raw binary blobs. Even before disassembly, scanning the hex dump for ASCII strings reveals firmware versions, hardcoded URLs, debug messages, and credential constants — the classic strings Unix tool exists for exactly this reason. For binary protocols (Modbus, CAN bus, custom serial frames), each field of each frame is a hex byte you'll convert dozens of times while writing a parser.
Edge Cases and Limitations
A handful of byte-level behaviors and Unicode subtleties trip up new users — knowing them in advance saves debugging time.
UTF-8 multi-byte sequences expand the byte count. ASCII characters take 1 byte each; Latin-1 supplement (accented Western European letters), Greek, Cyrillic, and Hebrew take 2 bytes each in UTF-8; most CJK ideographs and the Basic Multilingual Plane take 3 bytes; emoji and supplementary-plane codepoints take 4 bytes. The string café looks like four characters but encodes as 63 61 66 C3 A9 — five bytes — because é is a 2-byte UTF-8 sequence. The status bar shows both character count and byte count separately to make this visible.
Non-printable bytes appear as dots in dump ASCII columns. Bytes 0x00 through 0x1F (control characters), 0x7F (DEL), and bytes above 0x7F that are not part of a valid printable encoding are conventionally rendered as . in the ASCII column of a hex dump. The raw byte value is preserved — only the visual rendering substitutes a dot. This convention dates to od, the original Unix octal dump utility from 1971, and survives unchanged in xxd, hexdump -C, HxD, and every other hex viewer.
Endianness matters for multi-byte integers. A 32-bit integer with value 0x12345678 is stored as 12 34 56 78 in big-endian memory (network byte order, ARM by default, PowerPC) but as 78 56 34 12 in little-endian memory (x86, x86-64, ARM in little-endian mode, RISC-V). When you decode a hex dump from a binary file, you have to know the endianness to interpret multi-byte integer fields correctly. ASCII strings are unaffected — they read the same in either byte order.
BOM detection identifies text-file encoding. A byte-order mark (BOM) at the start of a text file signals its encoding: EF BB BF is the UTF-8 BOM, FF FE is UTF-16 little-endian, FE FF is UTF-16 big-endian, FF FE 00 00 is UTF-32 LE, and 00 00 FE FF is UTF-32 BE. The UTF-8 BOM is optional and increasingly omitted on Linux; on Windows, Notepad emits it by default.
File magic numbers are diagnostic. A hex dump's first row often tells you the entire file format. 4D 5A = Windows PE/EXE; 89 50 4E 47 0D 0A 1A 0A = PNG; 25 50 44 46 = PDF (%PDF); 50 4B 03 04 = ZIP (including DOCX, XLSX, JAR, APK); 7F 45 4C 46 = Linux ELF; CA FE BA BE = Java class file; FF D8 FF = JPEG. The file(1) utility on Unix and Wireshark's protocol dissectors both rely on these signatures.
Behind the Scenes: xxd, hexdump, od, and the Hex Editor Tradition
Why Hex Is the Standard Binary Representation
Hex prevailed over alternatives for a reason that's almost purely mathematical: base 16 maps cleanly to 8-bit bytes. Four bits encode 2^4 = 16 distinct values, and 8 bits encode 2^8 = 256, which is exactly two hex digits. Every possible byte value from 0x00 to 0xFF has a fixed-width, unambiguous two-character hex representation — no padding, no variable-width strings, no leading-zero conventions. Octal (base 8) uses 3 bits per digit, which doesn't divide evenly into 8 — encoding a single byte takes 3 octal digits and wastes a bit. Decimal requires 1 to 3 digits per byte (values 0–255), forcing every reader to mentally pad. Hex avoids both problems.
The Three Classic Unix Hex Dump Tools
Three command-line utilities have dominated Unix hex dumping for decades, each with slightly different defaults. od (octal dump, 1971) is the oldest; despite the name it supports hex output via -tx1 -An. hexdump (BSD, 1990s) is more configurable via printf-style format strings; the -C flag produces canonical output with offset, hex bytes, and ASCII column. xxd (shipped with vim) added a critical capability the others lack: a reverse mode (-r) that converts a hex dump back into the original binary, which makes xxd the go-to tool for binary editing pipelines (edit the dump in vim, run xxd -r to rebuild the file).
The Venerable Hex Editor Tradition
Graphical hex editors trace back to the early PC era. HxD (Windows, free) is the default starting point for Windows reverse engineering, with built-in disk and RAM editing. 010 Editor (cross-platform, commercial) introduced binary templates — small scripts that parse a file format and overlay typed structure on top of the raw hex view, transforming an opaque blob into navigable named fields. Hex Fiend dominates on macOS for its speed on multi-gigabyte files. Ghidra (NSA, open-source) bundles a hex view inside a full reverse-engineering suite alongside disassembly and decompilation. The hex editor as a category is older than the windowed operating system; it remains the lowest level of practical file inspection short of writing your own parser.
Comparison: This Tool vs. xxd, hexdump, od, and Hex Fiend
The browser-based tool here covers the encode/decode core but is deliberately not a full hex editor. The table below maps it against the four most common alternatives so you know when to pick which.
| Tool | Platform | Strength | Reverse Mode | Binary Editing | Typical Use |
|---|---|---|---|---|---|
| This tool (browser) | Any browser | Instant, no install, paste-friendly, offline-capable | Yes (Hex → ASCII mode) | No | One-off byte conversions, magic-number lookup, quick string decode |
xxd file |
Unix (ships with vim) | Canonical 16-byte rows; -r reverses dump back to binary |
Yes (xxd -r) |
Via edit-dump-rebuild pipeline | Scripted hex pipelines; binary patching workflows |
hexdump -C file |
Unix (BSD-derived) | Configurable via printf-style format strings; canonical output mirrors xxd | No | No | Quick inspection; protocol-trace formatting; custom column layouts |
od -An -tx1 file |
POSIX (everywhere) | Oldest, most portable; available even on minimal Unix installs | No | No | Maximum portability; embedded Linux; busybox environments |
| Hex Fiend | macOS (free) | Multi-gigabyte file handling; fast scrolling; built-in diff | N/A (GUI editor) | Yes — full editor | Inspecting large binaries; macOS reverse engineering |
| HxD / 010 Editor | Windows / cross-platform | HxD: free, disk/RAM editing. 010: binary templates parse formats | N/A (GUI editor) | Yes — full editor | Windows reverse engineering; structured binary parsing |