Binary File Comparer

Compare any two files byte for byte: see whether they are identical, where the first difference is, how many bytes differ and where, with the bytes side by side in hex. Works on files of any size, in your browser.

Tool Media & Files Updated Oct 16, 2026
How to Use
  1. Drop the first file on box A and the second on box B, or drop both at once on either box. Click a box to choose a file instead.
  2. Read the verdict: Identical, Different, or one file is a prefix of the other (the same start, but shorter).
  3. Look at the strip between the two bars: red marks where bytes differ, hatching where only the longer file has data.
  4. Step through the differences with the arrows (or the n and p keys) and compare the bytes of A and B in hex, with changed bytes highlighted.
  5. Check Show Work for the offsets, the runs of changed bytes and, for files up to 512 MiB, the SHA-256 of both.
Input
Drop or click
First file
Drop or click
Second file
Any type, any size — compared on your device, never uploaded. Drop two files together to fill both boxes.
Presets (sample file pairs)
Where the Files Differ
Verdict
—
First difference
—
Bytes different
—
Match
—

Worked Example

One byte changed. A 10,000-byte save file and an edited copy of the same size. The comparison finds a single differing byte at offset 8,000, which is 0x1F40 in hex (8,000 = 1 × 4,096 + 15 × 256 + 4 × 16 + 0). Match = (10,000 − 1) ÷ 10,000 × 100 = 99.99%. The hex window shows the byte in A and in B one above the other.

Cut short. An installer of 10,000 bytes and a download of the same file that stopped at 6,000 bytes. All 6,000 shared bytes match, so the short file is a prefix of the long one: nothing was altered, 4,000 bytes are simply missing. Match = 6,000 ÷ 10,000 = 60%.

The common mistake: reading “99% different” as “a different file”. Insert 3 bytes at offset 4,096 (0x1000) of the same 10,000-byte file. The copy is now 10,003 bytes, and every byte after the insertion has moved 3 places, so of the 5,904 shifted bytes compared, about 255 in 256 now differ (5,904 × 255 ÷ 256 ≈ 5,881) — for a 3-byte edit. The tool tests for exactly this and reports “3 bytes inserted at 0x1000”. Windows fc /b and Unix cmp do not resynchronise either.

Show Work

Choose two files, or press a preset, to see where they differ.

How It Works

Byte comparison
A[i] ≠ B[i] for 0 ≤ i < min(sizeA, sizeB)
Same offset in both files; nothing is realigned
Identical
sizeA = sizeB and no A[i] ≠ B[i]
Then their SHA-256 values are equal too
Match
match = (common − differing) ÷ max(size) × 100%
Bytes only one file has count as not matching
Offset in hex
8,000 = 0x1F40
cmp numbers bytes from 1 and would say 8,001
Shift test
B[f + d + i] = A[f + i], i = 0 … 1,023
d bytes inserted into B at the first difference f (d up to 128)
Chance match after a shift
1 ÷ 256 ≈ 0.39%
For random data, so about 99.6% of shifted bytes differ

Background: cmp, fc and Why Bytes Are Not Lines

Comparing files byte for byte is what the Unix cmp command does: it reports the first byte and line where two files differ, or that one file is a prefix of the other, numbering bytes and lines from 1 (cmp -l lists every differing byte). On Windows, fc /b compares two files in binary mode, byte by byte, and Microsoft’s documentation notes that it does not try to resynchronise the files after a mismatch. This tool does the same comparison, then adds the map, the runs, the hex window and a check for a shift.

Text comparison tools such as diff work differently: they look for the longest run of matching lines and report insertions and deletions, so one added line shows as one added line. That is the right approach for documents and source code, but most binary formats have no lines, and in many of them (executables, disk images, databases) a byte that moves position means something different. When both files are text, use a text diff; when the exact bytes matter, compare bytes.

About This Tool

This tool compares two files of any type and size byte by byte. It tells you whether they are identical, where the first difference is, how many bytes differ and in how many runs, whether one is a cut-short copy of the other, and whether a few inserted or deleted bytes explain the rest. A map shows where the differences sit and a hex window shows the bytes themselves. It also gives the SHA-256 of both files.

Both files are read from your disk in 4 MiB slices and never uploaded. It is useful for checking copies and downloads, for seeing what an editor or patch changed in a binary file, and for comparing firmware or disk dumps.

Related tools: Binary Explorer, File Inspector and Image Diff.

Frequently Asked Questions

How is this different from comparing checksums?

A checksum such as SHA-256 only tells you whether two files are the same. This tool also shows where they differ, how many bytes differ and what those bytes are, which tells you whether a file was slightly edited, cut short or replaced. It shows the SHA-256 of both files as well, so you can match them against a published checksum.

Why does inserting one byte make almost every byte different?

A byte-by-byte comparison checks offset 0 against offset 0, offset 1 against offset 1, and so on. After an insertion everything later sits one place further on, so nearly every later byte compares unequal: in random data 255 out of 256 do. The tool spots this and tells you how many bytes were inserted and where. For text files, where you want changed lines rather than bytes, use Text Diff.

Why is the offset one less than the byte number cmp reports?

Offsets count from 0, the way hex editors and file formats count: the first byte is at offset 0 (0x00000000). The Unix cmp command numbers bytes from 1, so a difference at offset 8,000 (0x1F40) is reported by cmp as byte 8,001. Show Work gives both.

Can it compare very large files?

Yes. Both files are read 4 MiB at a time and compared 4 bytes at a time, with a pause between slices so the page never freezes, so two multi-gigabyte disk images compare at roughly the speed your disk reads them. The SHA-256 of both is computed automatically for files up to 512 MiB and on request above that.

Are my files uploaded anywhere?

No. Both files are read by your browser from your own disk and compared there. Nothing is sent to a server, so you can compare private documents, firmware or backups safely.

How do I use the Binary File Comparer?

Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Does it cost anything or need an account?

No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.

Is anything I type uploaded?

No. The tool works entirely on your device, so the values you enter never leave your browser.

Common Use Cases

Checking a copy or backup

Confirm that a 4 GB video on a USB stick matches the original byte for byte before deleting the original.

What did an editor change?

A save-game editor changed one byte at offset 0x1F40: the hex window shows the old and new value side by side.

Interrupted downloads

A 6,000-byte installer that matches the first 6,000 bytes of the real 10,000-byte one was cut short, not tampered with.

Firmware and ROM dumps

Two dumps of the same 8 MiB chip that differ in 3 bytes point to a bad read, not to different firmware.

Last updated: