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:

Standard Hexdump Format
00000000 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 0a 54 68 |Hello, World!.Th| 00000010 69 73 20 69 73 20 61 20 68 65 78 64 75 6d 70 20 |is is a hexdump | 00000020 65 78 61 6d 70 6c 65 2e 00 |example..|
Component Breakdown:
  • Offset (Blue): Shows the position in the file (hexadecimal), starting at 00000000
  • Hex Bytes (Green): Each byte shown as two hexadecimal digits (00-FF)
  • ASCII (Orange): Printable ASCII characters; non-printable shown as dots or other symbols

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:

Example: Creating a Hexdump

Original Text:

The quick brown fox jumps over the lazy dog.

Hexdump Output:

00000000 54 68 65 20 71 75 69 63 6b 20 62 72 6f 77 6e 20 |The quick brown | 00000010 66 6f 78 20 6a 75 6d 70 73 20 6f 76 65 72 20 74 |fox jumps over t| 00000020 68 65 20 6c 61 7a 79 20 64 6f 67 2e |he lazy dog.|

Notice how each character is represented by its hexadecimal ASCII value. For example, 'T' = 0x54, 'h' = 0x68, 'e' = 0x65, and space = 0x20.

To Hexdump Configuration Options

CyberChef's To Hexdump operation offers several configuration options to customize the output format:

Width
Number of bytes per line (typically 16)
Uppercase Hex
Display hex values in uppercase (A-F) or lowercase (a-f)
Include ASCII
Show or hide ASCII representation column
Show Offset
Display or hide address offsets

Common Width Settings:

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:

Example: Converting From Hexdump

Hexdump Input:

00000000 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 |Hello, World!|

Extracted Raw Data:

Hello, World!

The operation intelligently parses the hexdump format, extracting only the hex bytes and converting them back to their original binary/text representation.

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

File Signature Detection

Use hexdump to identify files by their magic bytes (file signatures):

00000000 50 4b 03 04 14 00 00 00 08 00 b6 8c 6d 51 4a 89 |PK........m.QJ.| 00000010 f2 0c 20 00 00 00 2c 00 00 00 08 00 1c 00 74 65 |.. ...,.......te|

The bytes 50 4b 03 04 at the start indicate this is a ZIP archive.

Common File Signatures:
  • FF D8 FF - JPEG image
  • 89 50 4E 47 - PNG image
  • 50 4B 03 04 - ZIP archive
  • 25 50 44 46 - PDF document (%PDF)
  • 4D 5A - Windows executable (MZ)
  • 7F 45 4C 46 - Linux executable (ELF)

Example 2: Debugging Binary Protocols

Network Packet Analysis
00000000 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a |GET / HTTP/1.1..| 00000010 48 6f 73 74 3a 20 65 78 61 6d 70 6c 65 2e 63 6f |Host: example.co| 00000020 6d 0d 0a 0d 0a |m....|

This hexdump reveals an HTTP GET request. Notice the CRLF line endings (0d 0a) typical of HTTP protocol.

Example 3: Extracting Embedded Data

Finding Hidden Strings
00000000 de ad be ef 00 00 00 00 00 00 00 00 53 45 43 52 |............SECR| 00000010 45 54 5f 4b 45 59 3a 20 31 32 33 34 35 00 00 00 |ET_KEY: 12345...|

Hexdump makes it easy to spot ASCII strings embedded in binary data, such as this hidden secret key.

CyberChef Recipe Ideas

Here are some useful recipe combinations involving hexdump operations:

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

Common Gotchas

Performance Considerations

Educational Value

Working with hexdumps develops important skills for technical professionals:

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