Hex Dump and File Inspector
Choose a file to see its bytes as offset, hex and ASCII, in pages of 256 bytes. Files up to 2 MB are supported.
How to use
- Press the file chooser and pick a file of 2 MB or less. A larger file is refused before it is read.
- Read the three figures: size in bytes, the count of zero bytes and the count of printable ASCII bytes. They cover the whole file, not only the visible page.
- Study the dump. Each line is an offset, sixteen bytes in hex and the same bytes as text.
- Use Next and Previous to move through the file 256 bytes at a time. The label between the buttons shows which page and byte range you are on.
Worked example
Take a 22-byte file that holds the text Hello, tools4free!, a line feed, a zero byte, and the two bytes c3 bf. The tool shows two lines:
00000000 48 65 6c 6c 6f 2c 20 74 6f 6f 6c 73 34 66 72 65 Hello, tools4fre
00000010 65 21 0a 00 c3 bf e!....
The offset on the second line is hex 10, which is byte 16. The line feed (0a) and the zero byte (00) are not printable, so each shows as a dot, and so do both bytes of c3 bf. The summary reads size 22, zero bytes 1, printable bytes 18. The other three bytes are neither zero nor printable ASCII.
How it works
Reading the file. When you choose a file, your browser reads its bytes locally. The file is never uploaded, and nothing about it is stored. Files over 2 MB are refused before they are read.
Each line shows the byte offset (the position from the start of the file, in hex), then 16 bytes in two-digit hex with an extra gap after the eighth byte, then the same bytes as ASCII. Printable characters (space to tilde) appear as they are. Every other byte is shown as a dot.
Pages. The file is shown 256 bytes at a time (16 lines per page). Use Previous and Next to move through it.
Summary. The size is the file size in bytes. Zero bytes counts the 0x00 bytes, and printable bytes counts those from 0x20 to 0x7E.
The ASCII range comes from the US-ASCII standard, summarised in RFC 20. Bytes above 0x7F are not ASCII, so a UTF-8 character outside basic Latin shows as dots, as the example does. The File API is what lets a web page read a chosen file without sending it anywhere.
Reading what you see
Many formats begin with a short signature, sometimes called magic bytes, that you can spot at offset 0:
| Starts with (hex) | Shown as | Usually means |
|---|---|---|
89 50 4e 47 0d 0a 1a 0a | .PNG.... | PNG image |
ff d8 ff | ... | JPEG image |
25 50 44 46 2d | %PDF- | PDF document |
50 4b 03 04 | PK.. | ZIP archive, and formats built on it such as DOCX |
7f 45 4c 46 | .ELF | Linux executable |
Common mistakes
- Trusting the file extension. A file named photo.jpg can hold anything. The first bytes tell you what it really is.
- Reading offsets as decimal. The offset column is hex. The line starting 00000010 begins at byte 16, not byte 10.
- Treating the text column as the content. The dots hide real bytes. A binary file can look empty in the text column and still be full of data.
- Expecting text to look the same everywhere. Line endings differ: Windows files use 0d 0a, Unix files use 0a. The dump shows which one a file has.
- Opening a huge file. Files above 2 MB are refused. Use a command-line tool such as
xxdorhexdumpfor those.
Frequently asked questions
Is my file uploaded?
No. The browser reads it on your device, and no request leaves the page.
Why are some bytes shown as dots?
Only bytes from 0x20 to 0x7E have a visible ASCII character. All others, including control codes and bytes above 0x7F, appear as a dot.
Why is the middle gap in each line?
It splits the sixteen bytes into two groups of eight, which makes it easier to count across.
Can I edit the file here?
No. This is a viewer only, and the file on your disk is never changed.
Does a zero byte count mean the file is corrupt?
No. Many valid formats contain zero bytes. A high count can hint at binary data or padding, while text files rarely have any.
Related tools
- Number Base Converter to turn hex bytes into decimal or binary.
- Hash Generator to compare a file's checksum.
- Unix chmod Calculator for the permissions of the file you are inspecting.