Hex Viewer
View any file as a hex dump with byte offsets and text, search it for text or hex bytes, jump to an offset and inspect the bytes, without uploading the file. Runs in your browser.
Input
Output
| Type | Little-endian | Big-endian |
|---|---|---|
| Unsigned 8-bit | ||
| Signed 8-bit | ||
| Unsigned 16-bit | ||
| Signed 16-bit | ||
| Unsigned 32-bit | ||
| Signed 32-bit | ||
| Unsigned 64-bit | ||
| Signed 64-bit | ||
| 32-bit float | ||
| 64-bit float |
Readme
What is a hex viewer?
A hex viewer shows the raw bytes of a file as hexadecimal numbers, next to the same bytes as text. It lets you look inside any file, whatever its format: check what kind of file it really is from its first bytes, find text hidden in a binary file, see which line endings or text encoding a file uses, or follow the structure of a file format while you debug it.
Reading the dump
- Each row starts with the offset of its first byte, the byte's position in the file counted from 0, written in hex.
- Then come the bytes as hex pairs, from
00toFF, with a wider gap in the middle of the row. - At the end, the same bytes as text: printable ASCII characters as themselves, every other byte as a dot. A character that takes several bytes in UTF-8, like é or an emoji, shows as dots, since none of its bytes is a character on its own: select its first byte to see it.
- Rows hold 16 bytes on wide screens, and 8 or 4 on narrow ones.
Selecting bytes
- Click a byte, in the hex or the text column, to select it. Arrow keys move the selection, Page Up and Page Down move a screen at a time, and Home and End jump to the start and the end of the file.
- To jump to a position, type it in Go to offset as a decimal number like
496or in hex like0x1F0,1F0hor1f0. - The Selected byte section shows the offset, the byte in binary, the UTF-8 character that starts there, and the bytes from that offset read as 8, 16, 32 and 64-bit integers, signed and unsigned, and as 32 and 64-bit floats.
Searching
- Pick Text to find characters, or Hex bytes to find exact byte values. Type the bytes as hex pairs, with or without spaces:
4D 5A,4d5a,0x4D 0x5Aand89:50:4E:47all work. - Text is searched as UTF-8, so
éor an emoji finds the bytes that character takes. Capital and small letters match each other unless Match case is on; this applies to the letters A to Z, while other characters always match exactly. - Press Enter or the arrow button to search. The first match at or after the selected byte is selected and its bytes are marked; the Match field says which match it is and how many the file holds, or that there are none. While a large file is searched, it shows how far the search has got.
- Press Enter again, or the down arrow, for the next match, and the up arrow for the previous one. Both go on from the selected byte and wrap around at the ends of the file. Matches may overlap:
AAis found three times inAAAA.
Little-endian and big-endian
Numbers longer than one byte can be stored with their lowest byte first (little-endian) or their highest byte first (big-endian), so the inspector shows both. Intel and most ARM processors, and formats like ZIP, BMP and WAV, use little-endian. Network protocols and formats like PNG and JPEG use big-endian. The bytes 01 02 are 513 as a little-endian 16-bit number and 258 as a big-endian one.
Examples of file signatures
Many formats start with a fixed run of bytes, so the first row tells you what a file is:
- PNG:
89 50 4E 47 0D 0A 1A 0A(".PNG" and two line endings) - PDF:
25 50 44 46("%PDF") - ZIP, and formats built on it like DOCX, XLSX, EPUB and APK:
50 4B 03 04("PK") - JPEG:
FF D8 FF - A text file saved with a UTF-8 byte order mark:
EF BB BF - Line endings:
0D 0Aon Windows,0Aon Linux and macOS
How it works
The file is read in small pieces as you scroll, so even a very large file opens at once and the page only holds the part you look at. A search reads the file piece by piece too, overlapping the pieces so a match across two of them is still found. The file never leaves your device: nothing is uploaded.
Features
- Offsets, hex bytes and text side by side
- Opens any file, large ones too, without uploading it
- Go to an offset in decimal or hex
- Search for text or hex bytes, with next and previous match
- Byte selection with the mouse or the keyboard
- An inspector with integers, floats and the UTF-8 character at the selected byte, in both byte orders
- Runs in your browser