A hex dump is the classic way to look at the raw bytes of any file. It lines up three columns — the byte offset, the bytes as hexadecimal, and an ASCII sidebar — so you can find file signatures, embedded text, headers and padding inside otherwise opaque binary data. This viewer renders that layout in your browser for any file you drop in, with no upload.
How it works
The tool reads your file into a byte array using the browser’s FileReader API, then formats it row by row. For each row it prints:
- The offset of the first byte on the line, in hexadecimal, padded to a consistent width.
- The bytes themselves as two-digit hex values, with a small gap in the middle of the row for readability.
- An ASCII sidebar where any printable byte (
0x20–0x7e) appears as its character and everything else appears as a dot.
You can choose 8, 16, 24 or 32 bytes per row. Large files are paged 4 KB at a time so the page stays fast even on big inputs, and the offset column always reflects the true position within the whole file.
Common file magic numbers to recognise
Every file format has a characteristic byte sequence at the start (called a magic number or file signature) that identifies the format regardless of file extension. Once you know these, reading the first row of a hex dump immediately tells you what a file really is:
| Magic bytes | ASCII | Format |
|---|---|---|
89 50 4E 47 0D 0A 1A 0A | .PNG.... | PNG image |
FF D8 FF | ... | JPEG image |
25 50 44 46 | %PDF | PDF document |
50 4B 03 04 | PK.. | ZIP archive (also .docx, .xlsx, .jar) |
47 49 46 38 | GIF8 | GIF image |
52 49 46 46 | RIFF | WAV/AVI (followed by format type) |
1F 8B | .. | Gzip compressed data |
42 5A 68 | BZh | Bzip2 compressed data |
7F 45 4C 46 | .ELF | ELF executable (Linux binaries) |
4D 5A | MZ | Windows PE executable |
When a file has the wrong extension or refuses to open in the expected app, checking the magic number in the hex dump is the first diagnostic step.
Practical uses for a hex dump
Debugging corrupted files: A truncated file often shows clean data up to a certain offset and then fills with zeros or garbage bytes. The offset column pinpoints exactly where the corruption starts.
Reading binary file formats: Many protocols and file formats are documented as byte-level specifications. With a hex dump, you can read a struct definition in a spec document and map it directly to the bytes on screen. For example, a PNG chunk is always: 4 bytes for length, 4 bytes for type (readable in the ASCII sidebar), N bytes of data, and 4 bytes of CRC.
Finding embedded metadata: JPEG files carry EXIF data starting at byte offset 12 of the file. GPS coordinates, camera model, and capture time are stored in a structured block you can read directly in the dump. Checking whether a JPEG has been stripped of metadata before publishing is as simple as looking for recognisable ASCII text past the first few bytes.
Reverse engineering proprietary formats: When a format has no public specification, hex dumping multiple files side by side and comparing them at fixed offsets reveals the structure — where fields are, what values represent what states, and where variable-length data begins.
Tips
Hex dumps are most useful when you know what to look for. Scan the ASCII sidebar to spot human-readable strings such as metadata, URLs or error messages buried in a binary. Because the offset is shown in hex, you can cross-reference a byte position directly against a file-format specification or a C struct layout. Everything runs locally, so even sensitive files stay on your machine.