File Compare

Pick two files. You get Identical or Different, the offset of the first byte that differs, both sizes and both SHA-256 hashes. The files are read on your device and never uploaded.

How it works

The two files are read side by side in a background worker, 1 MiB at a time, and compared byte by byte. The read stops at the first byte that differs, so two large files that differ near the start are answered at once.

If one file is the other with more bytes on the end, the difference is where the shorter one stops. Two files are called identical only if every byte matches and the sizes are equal.

After the comparison, each file is hashed with SHA-256. The hashes are the same exactly when the files are, and you can paste them anywhere as proof.

If both files look like text, the page gives the line of the first difference too, and points you to the Diff Checker to see every changed line.

How to use it

  1. 1 Choose the first file.
  2. 2 Choose the second file. The comparison starts as soon as both are picked.
  3. 3 Read the verdict: Identical, or Different with the offset of the first differing byte and the two byte values.
  4. 4 Select a SHA-256 to copy it if you need a record, or follow the Diff Checker link for text files.

Good to know

  • Offsets count from 0, as hex editors do. The page also gives the byte number counted from 1, which is what cmp on Linux and macOS prints.
  • A difference at the very end, with one file one or two bytes longer, is often just a trailing newline or a Windows line ending.
  • Different names and dates do not matter here. Only the contents are compared.
  • To check one file against a published checksum rather than another file, use the File Hash Checker.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Comparing two copies of a file, one byte at a time

The simplest way to see what this page does is with two tiny text files. Make one file containing hello world and a newline, and save it as a.txt. It is 12 bytes. Make a second file with Hello World and a newline in it, save it as b.txt, and pick both here. The verdict is Different, with the first difference at offset 0 (byte 1 counting from 1): 0x68 in the first file and 0x48 in the second. Those are the codes for a small h and a capital H.

Now fix the capital H so b.txt reads hello World. The first byte matches again, and the reading goes on until offset 6, where the first file has 0x77, a small w, and the second has 0x57, a capital W. The page adds that the difference is on line 1, because both files look like text. The sizes are equal at 12 bytes each, so the two SHA-256 rows show two completely different hashes of the same length. One changed letter is enough to change every character of the hash.

Make the files match exactly and the verdict turns to Identical, with the two hash rows the same: a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447 for hello world and a newline. Then add one more newline to the end of b.txt. Now it is 13 bytes and the page reports Different at offset 12, end of file in the first and 0x0A in the second, and says the second file is 1 byte longer. That pattern, a difference exactly where the shorter file ends, almost always means extra bytes at the end, such as a trailing newline.

The same reading works for files of any kind: two copies of a firmware image, a photo before and after a sync, or a backup and its original. The page reads both files in step, a megabyte at a time, so the comparison does not depend on how big the files are. For a binary file the line number would mean nothing, so it is not shown. For two text files that differ, the page suggests the Diff Checker, which shows every changed line side by side.

Some limits are worth knowing. The page shows the first difference only, not every one. The SHA-256 rows need each file in memory whole, so above about 2 GB they may say the file was too big, even though the byte comparison still works. Text detection looks at the first 8 KB of each file, so a text file with a binary header is treated as binary. And the comparison is of contents only: names, dates and permissions are not compared.

Frequently asked questions

Are the files uploaded?

No. The browser reads both files from your disk, and a worker on your own device compares and hashes them. Nothing about the files is sent anywhere.

Is there a size limit?

Not for the comparison: it reads both files a piece at a time. The SHA-256 hashes need each file in memory whole, which in most browsers means up to about 2 GB. Past that, the page still compares the files and says the hash was too big to make.

Why does it only show the first difference?

For binary files, the bytes after the first difference are often all shifted, so a full list would be long and mostly noise. The first offset is the useful fact. For text, the Diff Checker shows every changed line.

Do two equal hashes prove the files are the same?

Yes, in practice. No two different inputs with the same SHA-256 have ever been found. And this page does not rely on the hash alone: it compares every byte first.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.