CyberChef Hexdump - To & From
Category: Data Format
Operations: To Hexdump, From Hexdump
Hexdump
Hex Viewer
Binary Data
Data Analysis
Debugging
What is a Hexdump?
A hexdump is a hexadecimal representation of binary data that displays both the raw byte values and their ASCII character equivalents side-by-side. It's one of the most fundamental tools in debugging, reverse engineering, and data analysis, allowing you to inspect the exact contents of files, network packets, memory dumps, or any other binary data.
The hexdump format originated from Unix utilities like hexdump and xxd, and has become a universal standard for viewing binary data in a human-readable format. Each line typically shows a memory offset, 16 bytes in hexadecimal, and the ASCII interpretation of those bytes.
Why Hexdump? While binary data is efficient for computers, it's incomprehensible to humans. Hexdump provides a middle ground - representing binary data in hexadecimal (base-16) with corresponding ASCII characters, making it possible to identify patterns, strings, file signatures, and data structures.
Anatomy of a Hexdump
Understanding the structure of a hexdump is essential for reading and interpreting binary data:
Reading Hexdump Values
| Hex |
Decimal |
ASCII |
Description |
| 00-1F |
0-31 |
. |
Control characters (non-printable) |
| 20 |
32 |
(space) |
Space character |
| 30-39 |
48-57 |
0-9 |
Digit characters |
| 41-5A |
65-90 |
A-Z |
Uppercase letters |
| 61-7A |
97-122 |
a-z |
Lowercase letters |
| 7F-FF |
127-255 |
. |
Extended ASCII / Binary data |
To Hexdump Operation
CyberChef's "To Hexdump" operation converts any input data into hexdump format. This is invaluable when you need to inspect binary files, debug data encoding issues, or analyze raw data structures.
Use Cases for To Hexdump:
- Examining file headers and magic bytes to identify file types
- Debugging binary protocols and network packet contents
- Analyzing firmware or compiled binaries
- Identifying hidden data or embedded files within other files
- Verifying data encoding and character sets
- Investigating malware samples safely in hex format
- Understanding binary file formats and data structures
To Hexdump Configuration Options
CyberChef's To Hexdump operation offers several configuration options to customize the output format:
Common Width Settings:
- 16 bytes: Standard, most readable for general use
- 8 bytes: Narrower format, useful for smaller displays
- 32 bytes: Wider format, shows more data per line
From Hexdump Operation
CyberChef's "From Hexdump" operation performs the reverse process - converting hexdump text back into raw binary data. This is useful when you've received or stored data in hexdump format and need to restore it to its original binary form.
Use Cases for From Hexdump:
- Reconstructing binary files from hexdump logs or documentation
- Converting hex-encoded data back to executable or readable format
- Restoring data from debug logs or error reports
- Processing hexdump output from command-line tools
- Extracting binary payloads from text-based communication channels
- Recreating files from source code examples or tutorials
Hexdump Format Variations
Different tools produce slightly different hexdump formats. CyberChef's From Hexdump operation can handle various formats:
Standard Format (xxd)
00000000: 4865 6c6c 6f20 576f 726c 6421 Hello World!
Hexdump -C Format
00000000 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 |Hello World!|
Plain Hex (No Offset)
48 65 6c 6c 6f 20 57 6f 72 6c 64 21
Continuous Hex
48656c6c6f20576f726c6421
Format Flexibility: CyberChef's From Hexdump operation is forgiving and can parse most common hexdump formats. It intelligently extracts hex values while ignoring offsets, ASCII columns, and formatting characters.
Practical Examples
Example 1: Identifying File Types
Example 2: Debugging Binary Protocols
Example 3: Extracting Embedded Data
CyberChef Recipe Ideas
Here are some useful recipe combinations involving hexdump operations:
- File Analysis: From Base64 → To Hexdump (decode and inspect binary data)
- Data Extraction: Extract Files → To Hexdump (examine extracted file contents)
- Binary Comparison: Fork → To Hexdump (compare two binary files side-by-side)
- Data Recovery: From Hexdump → To Base64 (convert hexdump log back to transferable format)
- Protocol Analysis: From Hex → To Hexdump (reformat hex data for easier reading)
- String Extraction: To Hexdump → Regular expression (find patterns in binary data)
- Format Conversion: From Hexdump → To Hex → To Base64 (chain conversions)
Command-Line Equivalents
If you're working outside CyberChef, these command-line tools produce similar hexdump output:
Unix/Linux Tools
# Standard hexdump
hexdump -C filename
# xxd (more common)
xxd filename
# od (octal dump, can do hex)
od -A x -t x1z -v filename
# Create hexdump
xxd filename > file.hex
# Restore from hexdump
xxd -r file.hex > restored_file
Windows Tools
# PowerShell hexdump
Format-Hex filename
# Using CertUtil
certutil -encodehex input.bin output.txt
# Windows Subsystem for Linux
wsl xxd filename
Tips and Best Practices
Reading Hexdumps Efficiently
- Scan the ASCII column first for recognizable strings and patterns
- Look for repeating byte sequences which often indicate padding or structure
- Check the first few bytes (magic numbers) to identify file type
- Notice patterns like
00 00 00 00 (null bytes) or FF FF FF FF (common padding)
- Watch for alignment - data structures often align to 4, 8, or 16-byte boundaries
Common Gotchas
- Endianness: Multi-byte values may be stored little-endian (reversed byte order)
- Non-printable Characters: Appear as dots in ASCII column, check hex values
- Unicode: Multi-byte characters won't display correctly in ASCII column
- Compression: Compressed data looks random in hexdump
- Encryption: Encrypted data appears as high-entropy random bytes
Performance Considerations
- Hexdump representations are much larger than the original data (3x for formatted hexdump)
- Very large files may take time to convert to hexdump format
- Consider extracting only relevant portions for analysis
- Use appropriate width settings to optimize readability vs. screen space
Educational Value
Working with hexdumps develops important skills for technical professionals:
- Low-Level Understanding: See how data is actually stored in computer memory
- Data Encoding: Learn how characters, numbers, and structures are represented
- Pattern Recognition: Develop ability to spot data structures and anomalies
- Debugging Skills: Essential for troubleshooting binary data issues
- Reverse Engineering: Foundation skill for analyzing unknown binary formats
- Security Analysis: Critical for examining malware and vulnerabilities
Learning Path: Start by hexdumping simple text files to understand ASCII encoding, then progress to binary files, network captures, and executable files. The more you practice reading hexdumps, the faster you'll recognize patterns and structures.
← Back to Operations Guide