Hex Viewer
Hex viewer: open any file and read its bytes as a hex dump, 16 per line, with the offset on the left and the text on the right. Jump to an offset, search for bytes or text, see the file type and the CRC-32, SHA-1 and SHA-256 of the file. Everything runs in your browser.
00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR 00000010: 0000 0010 0000 0010 0802 0000 0090 9168 ...............h 00000020: 3600 0000 5649 4441 5478 9c63 f8ff ff3f 6...VIDATx.c...? 00000030: 775c 3691 e8ff ffff 0c10 8a48 d5dc 71d9 w\6........H..q. 00000040: 0cc8 1c82 aa11 1af0 eb41 9662 c025 814b .........A.b.%.K 00000050: 9001 bf34 a611 e81a 9015 61b5 108b 0688 ...4......a..... 00000060: 525c 5ea2 8606 d29c 449a a749 0b56 d222 R\^.....D..I.V." 00000070: 8eb4 a441 5ae2 2335 7903 0041 4219 3074 ...AZ.#5y..AB.0t 00000080: d075 6800 0000 0049 454e 44ae 4260 82 .uh....IEND.B`.
| CRC-32 | … |
|---|---|
| SHA-1 | … |
| SHA-256 | … |
Hex viewer: the bytes of a file, one line per 16
A hex viewer prints the bytes of a file as hexadecimal numbers, with the position of each line on the left and the same bytes as text on the right. Open a file above, or paste hex, and the first 4 KB appear as a dump you can page through, search and check against a CRC-32, SHA-1 or SHA-256 value. Nothing leaves the browser.
The view is useful whenever the question is what a file really contains rather than what a program makes of it. A download that will not open, a text file that shows odd symbols, a firmware image, an export with a strange header and a log with an invisible character all look different once the bytes are visible. Each byte is a value from 0 to 255, written as two hex digits, as explained on the hexadecimal page.
How to read a hex dump
A dump has the same three columns on every line, whatever tool produced it. The left column is the offset, the number of bytes from the start of the file to the first byte on the line. The middle column shows the bytes themselves. The right column shows the same bytes as characters, with a dot in place of anything that is not printable ASCII, which includes line breaks, tab characters and every byte above 7E.
| Column | Example | What it means |
|---|---|---|
| Offset | 00000010 | Hex position of the first byte on the line; the next line adds 10 (16 in decimal) |
| Hex groups | 636f 6e64 | Two bytes per group, so 636f is the bytes 63 and 6f; groups only make the line easier to scan |
| Text | cond line of the | Byte 63 is the letter c in ASCII, 6f is o; look up any value in the ASCII table |
| Short last line | 2066 696c 652e 0a | The final line holds whatever remains, so its hex column is padded with blanks |
Because the offset is in hex and each line holds 16 bytes, the offset of any byte is easy to compute: the line number times 16, plus the position inside the line. The byte on line 3 (offset 20) at position 5 is at offset 25. A calculator that works in hex, such as the hex calculator, handles larger additions.
Opening a file, jumping to an offset and finding bytes
Choose Open a file, or drop a file onto the dashed box. The viewer shows the file name, the size in bytes and, when the first bytes match a known format, the type it looks like. The dump covers 256 lines at a time; Previous and Next move by one page, and the status line gives the byte range of the page.
To jump, type an offset in hex, with or without 0x, into Go to offset. The viewer opens the page that holds that byte. To search, type hex bytes such as 50 4B 03 04, or switch the box beside it to text and type a word. Find starts at the beginning, and Find next continues after the previous match. The search runs over the whole file, not only the visible page, and it matches exact bytes, so a text search is case-sensitive and uses UTF-8.
What the first bytes say about a file
Most binary formats begin with a fixed pattern, called a signature or magic number, so that programs can recognize the format without trusting the file name. Seeing those bytes in the dump settles the question when an extension is missing or wrong. The text column often helps too, because several signatures contain readable letters.
| Format | Extension | First bytes (hex) | Text column |
|---|---|---|---|
| PNG image | .png | 89 50 4E 47 0D 0A 1A 0A | .PNG.... |
| JPEG image | .jpg | FF D8 FF | ... |
| GIF image | .gif | 47 49 46 38 37 61 | GIF87a |
| PDF document | 25 50 44 46 2D | %PDF- | |
| ZIP archive | .zip | 50 4B 03 04 | PK.. |
| GZIP archive | .gz | 1F 8B | .. |
| ELF executable | .elf | 7F 45 4C 46 | .ELF |
| SQLite database | .sqlite | 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 | SQLite format 3. |
The viewer applies the same table when you open a file, and the Base64 to file converter uses it to name a file decoded from text. Some formats hide their type deeper: a DOCX, XLSX and plain ZIP all start with PK, and only the names of the entries inside tell them apart.
Reading fields from a dump
Once the layout of a format is known, a dump can be read like a form. The example file loaded in the tool is a small PNG, and the table lists the first fields of its header, with the values taken from the bytes by the same code that draws the dump.
| Offset | Length | Bytes (hex) | Meaning |
|---|---|---|---|
| 0 | 8 | 89 50 4E 47 0D 0A 1A 0A | PNG signature |
| 8 | 4 | 00 00 00 0D | chunk length 13 (big-endian) |
| 12 | 4 | 49 48 44 52 | chunk type IHDR |
| 16 | 4 | 00 00 00 10 | width 16 |
| 20 | 4 | 00 00 00 10 | height 16 |
| 24 | 1 | 08 | bit depth 8 |
| 25 | 1 | 02 | color type 2 |
00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR
00000010: 0000 0010 0000 0010 0802 0000 0090 9168 ...............hThe specification of the format gives the order and size of each field. The PNG specification, for example, defines the signature, then a chunk whose type IHDR carries the image width and height. Reading the dump against such a table is how file formats are reverse engineered and how corrupted files are repaired by hand.
Byte order: the same four bytes, two different numbers
A number that takes more than one byte can be stored with its most significant byte first, called big-endian, or last, called little-endian. A dump shows the bytes in file order, so you have to know which convention the format uses before turning them into a value. PNG uses big-endian, as the width above shows. ZIP uses little-endian for its fields.
| Bytes (hex) | Big-endian value | Little-endian value |
|---|---|---|
| 00 00 00 10 | 16 | 268435456 |
| 50 4B 03 04 | 1347093252 | 67324752 |
To convert such a value, copy the bytes into the hex to decimal converter and switch its byte order to little-endian, which reverses the bytes before reading them. For floating-point numbers, the hex to float page does the same with the IEEE 754 layout.
Checksums: CRC-32, SHA-1 and SHA-256
Under the dump the viewer prints three checksums of the whole input. A checksum condenses the bytes into a short value, so two copies of a file can be compared without reading them side by side. If a download page publishes a SHA-256 value and yours matches it, the file arrived intact. CRC-32 is much shorter and is meant to catch accidental damage; it is stored inside ZIP, PNG and gzip files. SHA-1 and SHA-256 are cryptographic hashes, and SHA-1 is no longer considered safe against deliberate forgery.
| Input | CRC-32 | SHA-256 |
|---|---|---|
| 123456789 | cbf43926 | 15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225 |
| abc | 352441c2 | ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad |
SHA-1 and SHA-256 come from the Web Crypto interface of the browser, which is available on pages served over HTTPS. MD5 is not part of that interface, so it is not shown. The hash of a file is one value over all its bytes, so changing a single bit changes the whole result.
The same view on the command line
The layout of the dump is the one printed by xxd, which ships with Vim and with most Linux distributions. Other tools show the same data in their own style, and PowerShell has a built-in.
xxd file.bin | head # offset, hex in groups of two, text
xxd -g1 -l 16 file.bin # one byte per group, first 16 bytes
xxd -s 0x10 -l 16 file.bin # start at offset 16
od -An -tx1 -N16 file.bin # plain hex bytes with od
Format-Hex -Path file.bin # PowerShell 5 and later
Get-FileHash file.bin -Algorithm SHA256The viewer draws the same layout as xxd, and the two agree line for line, so a dump copied from this page can be compared with the output of the command on your own machine. The viewer adds searching, paging by offset and the three checksums in one place.
A viewer, not an editor
This page reads and never changes bytes. Editing a file safely in the browser needs more than a text box: insert and overwrite modes, undo, and writing the result back. If the goal is to change a value, find its offset here, then edit the file with a dedicated editor such as the one built into many code editors, or with a short script. When the data is text in disguise rather than a binary file, the auto decoder recognizes hex, Base64 and several other forms.
Limits of the viewer
Files up to 64 MB can be opened, which covers images, documents, executables and most firmware. The whole file is held in memory, but only 4 KB is drawn at a time. Checksums scan the full file, so very large inputs take a moment. Pasted hex is limited only by what the text box accepts.
Slips when reading a dump
The common ones are reading the offset as decimal when it is hex, treating the text column as the data when it is only a rendering of it, forgetting that a dot can hide any non-printing byte, and mixing up the byte order of multi-byte values. A last one is expecting identical files to have identical text columns: a different line break convention changes the bytes 0D 0A to 0A and therefore the dump and every checksum.
Questions about the hex viewer
What does a hex viewer do?
A hex viewer shows the raw bytes of a file as hexadecimal, usually 16 bytes per line with the offset on the left and the matching ASCII characters on the right. Open a file above and its first 4 KB appear as a dump; nothing is uploaded.
How do I read a hex dump?
Each line starts with the offset of its first byte, in hex. The middle column holds up to 16 bytes as two-digit values, and the right column shows each byte as a character if it is printable ASCII, or a dot if it is not.
How do I jump to an offset in a file?
Type the offset in hex into the Go to offset box, for example 1A0, and press Go. The viewer shows the 4 KB page that contains that byte. Offsets count from zero, so the first byte of the file is offset 0.
Can I open large files?
Yes, up to 64 MB. The whole file is read into the memory of the browser tab, but only one page of 4 KB is drawn at a time, so large files stay responsive. Checksums are computed over the entire file.
Is my file uploaded anywhere?
No. The file is read with the browser and every calculation runs on your device. There is no upload, and the checksum values are produced by the same page. You can check this by disconnecting from the network before opening a file.
