Binary Diff

Compare two binary files byte-by-byte.

Open tool

Overview

The binary diff utility compares two arbitrary files byte-by-byte and reports every offset where they disagree, along with the differing values in hexadecimal and printable ASCII. Unlike a text diff, it makes no assumption about line breaks, encoding, or structure — it simply walks both byte streams in lockstep.

Reverse engineers, firmware developers, and forensic analysts reach for this when comparing two builds of the same executable, two snapshots of a saved-game file, or a clean and tampered copy of a document. Long-tail searches that lead here include "compare two binary files online", "byte-level file diff", and "find changed bytes between two firmware images".

How it works

The tool reads both files into memory and emits a compact difference report. Each differing offset is shown as a hexadecimal address followed by the byte from the left file and the byte from the right file, with a printable-ASCII column for sanity. Runs of consecutive differences are coalesced into a single region so a small patch produces a small report.

When the files differ in length, the longer tail is reported as a single appended region. The comparison is O(n) in the size of the smaller file, with an early-exit when a hard limit on reported differences is reached so a totally different pair of files does not flood the output.

Examples

  • Confirm that two builds of the same binary differ only in their embedded build timestamp.
  • Spot a single flipped bit between a known-good and corrupted save file.
  • Verify that a patched binary differs from the original only inside a known function range.
  • Compare two .docx files (which are ZIPs underneath) byte-for-byte to detect repackaging.

FAQ

How large can the inputs be?
Both files are loaded into memory, so practical limits depend on available RAM in the browser tab. Multi-gigabyte firmware images are best diffed with a desktop tool; this is tuned for files up to a few hundred megabytes.

Does it understand file structure?
No. A binary diff is intentionally structure-agnostic — it will not skip over a PDF's xref table or align on ZIP record boundaries. Use a format-aware tool when you need semantic comparison.

Why are most reported diffs near the start of the file?
Many container formats (PDF, ZIP, ELF) have headers and tables of contents near the start. A small content change can ripple through offset tables, producing many byte-level diffs even when the payload itself barely changed.

Can it produce a binary patch?
The report is human-readable, not a bsdiff or xdelta patch. For patching workflows, capture the differing regions and apply them with a dedicated patch tool.

What if the two files are identical?
You will see a single message confirming equality, including the matched byte count.

Try Binary Diff

An unhandled error has occurred. Reload ×