Binary Hex Editor | View and Edit Files in Hexadecimal
Drag and drop a file to view its contents as a byte-by-byte hex dump. Identify the true file type via magic bytes, edit individual bytes, and download the result. Nothing is ever uploaded to a server.
Common file signatures (magic numbers)
| Format | Leading bytes (hex) | Offset | Note |
|---|---|---|---|
| PNG | 89 50 4E 47 0D 0A 1A 0A | 0 | Image file. All 8 bytes matching confirms PNG with near certainty |
| JPEG | FF D8 FF | 0 | Image file. The 4th byte varies by variant (JFIF, Exif, etc.) |
| GIF | 47 49 46 38 39 61 / 47 49 46 38 37 61 | 0 | The ASCII string "GIF89a" or "GIF87a" |
| 25 50 44 46 2D | 0 | The ASCII string "%PDF-", followed by the version number | |
| ZIP / docx / xlsx / jar | 50 4B 03 04 | 0 | ZIP format. Office Open XML and many archive formats are internally ZIP |
| Windows executable (EXE/DLL) | 4D 5A | 0 | The ASCII string "MZ" - a legacy MS-DOS header still present in the PE format |
| ELF executable | 7F 45 4C 46 | 0 | Executables and shared libraries used on Linux and similar systems |
What is a binary hex editor?
Every file, at its core, is just a sequence of bytes. A hex editor shows you that content one byte at a time as a hexadecimal number, and lets you rewrite it directly when needed. The first few bytes of a file often carry magic bytes that identify its true format, so you can determine what a file actually is without trusting its extension.
This tool loads files by dropping them in, or by typing hexadecimal values directly. Viewing, editing, and downloading all happen entirely in your browser, and nothing is ever sent to a server. For larger files, though, only the first 64KB is processed — anything beyond that is not kept even when you download the result.
How to use the hex editor
- Load a file Drop a file into the area, or paste hexadecimal digits directly. Spaces and line breaks are ignored.
- Check the leading bytes Look at the area near offset 0 and compare it against the table above to identify the file's true format.
- Edit a byte Click any hex cell to change that byte to a value between 00 and FF. The ASCII column updates alongside it.
- Download the result Save the edited content as a file. The original is never touched, so experimental edits are always safe to try.
Tips for getting more out of it
- To unmask a file whose extension was changed, compare its leading bytes (magic bytes) against the table above. An extension is just a label, but magic bytes come from the format itself and are far harder to fake.
- In manual hex mode you can paste byte sequences copied from other tools (space-separated or newline-separated both work) and load them directly.
- If you click the wrong cell while editing, press Esc to cancel that cell's edit without changing the byte.
- When debugging a binary protocol, line up the bytes you expected against what was actually sent or received in this tool to spot exactly where they diverge.
Ways to use the hex editor
Unmask a file with a spoofed extension
Checking the leading bytes reveals whether the extension actually matches the real format — handy for inspecting a suspicious attachment.
Diagnose a corrupted file
The byte sequence can show whether a header is missing or the file was cut off partway through, which helps judge whether recovery is realistic.
Learn a file format's specification
Reading a spec side by side with the actual bytes makes the structure of a header concrete instead of abstract.
Create broken test data on purpose
Deliberately rewriting a few bytes lets you verify how an application behaves when it is handed a malformed file.
Inspect a binary protocol byte by byte
You can look at the raw data sent or received directly, without reaching for a separate packet analyzer.
Binary file terms
- Byte
- A unit made of 8 bits. In hexadecimal it is written as two digits, from 00 to FF.
- Magic bytes
- A distinctive byte sequence placed at the start of a file to identify its format. Also called a file signature.
- Offset
- The position of a byte, counted from the start of the file. Usually written in hexadecimal.
- Header
- The section at the beginning of a file that gathers information such as format and size.
- ASCII display
- A view where each byte is interpreted as a character, useful for spotting embedded text.
- Endianness
- The order in which the bytes of a multi-byte number are arranged. Depending on the format, the most significant byte can come first or last.
Frequently asked questions
FF D8 FF, it is very likely a JPEG image regardless of its extension.
Side Note — Why a file's true identity is in its bytes, not its extension
A file extension is just a hint that tells the operating system which application to open a file with — it is a label that exists independently of the file's actual content. Renaming `photo.jpg` to `notes.txt` does not turn it into text, and stripping the extension from a real image does not erase the image data underneath. Because this label is essentially self-declared, malware has long exploited it to disguise executables as innocuous images or documents.
To work around this, most file formats embed a unique identifier — called magic bytes or a magic number — in their first few bytes. A PNG file, for example, always begins with the exact 8-byte sequence `89 50 4E 47 0D 0A 1A 0A` as defined by the specification. This means an operating system or application can only be truly confident about a file's format after inspecting its actual content, not its name. Unix's `file` command and browsers' MIME-type sniffing both rely primarily on matching these magic bytes rather than trusting the extension.
Some magic byte sequences carry a clever design history. PNG's 8 bytes deliberately include a line-ending sequence (0D 0A) specifically so that file transfers over text-mode channels — which sometimes mangle line endings — can be detected as corrupted. Far from being an arbitrary identifier, it doubles as a built-in corruption check, a small detail that hints at just how much thought goes into binary format design.