File Compare

File Compare

0 lines added, 0 lines removed
Copied!
PropertyFile AFile B
Filename--
Size--
MIME type--
Last modified--
SHA-256--

What Is File Compare?

File Compare lets you upload two files and instantly see exactly how they differ - without installing any software or uploading anything to a server. If both files are plain text (source code, config files, logs, CSV, JSON, markdown, and similar), it renders a familiar line-by-line diff showing what was added and removed.

If either file isn't text - an image, archive, executable, or any other binary format - a full line diff wouldn't make sense, so the tool instead shows a comparison summary: filename, size, MIME type, last-modified date, and a SHA-256 hash for each file, with a clear Identical/Different verdict.

How the Comparison Decides Text vs. Binary

Each uploaded file is read as raw bytes. The tool first scans for a null byte - a strong signal of binary content - then attempts a strict UTF-8 decode; a file with neither problem counts as text immediately, no matter what its extension is. Only if that strict decode fails does the file's extension get checked against a list of common text formats (.txt, .md, .json, .csv, .js, .css, .html, .xml, .log, .yml, .py, .java, .c, .sql, and more) - a matching extension earns the file one more attempt with a more lenient decode.

Only when both files pass as text does the tool run its longest-common-subsequence line diff, the same underlying technique used by Git and other version control diffing. Otherwise it falls back to the byte-level summary table, computed with the browser's native crypto.subtle.digest SHA-256 implementation, so you still get a reliable way to confirm whether two files are truly identical.

Why Use This File Compare Tool

100% Client-SideYour files are read locally with the File API - nothing is ever uploaded to a server, so it works with sensitive or private files too.
Handles Text AND BinaryGet a real line-by-line diff for text files, or a hash-based Identical/Different verdict for images, archives, and any other file type.
SHA-256 VerificationEvery comparison includes a SHA-256 digest of each file, so you can trust the verdict even for files that look identical at a glance.
No Install, No LimitsDrag, drop, and compare - no desktop diff tool, browser extension, or account required.

Frequently Asked Questions

Does File Compare upload my files anywhere?

No. Both files are read locally using the browser's File API and never leave your device - there is no upload, no server processing, and no storage.

How does it decide between a line diff and a summary table?

It scans each file for a null byte and attempts a strict UTF-8 decode; a file with no null byte that decodes cleanly counts as text right away. If the strict decode fails, the file's extension is checked against a common text-file list as a fallback. Only when both files come back as text do you get a line-by-line diff - otherwise you get a summary table with hashes.

How is Identical vs Different decided for binary files?

Each file's full contents are hashed with SHA-256 using the browser's native Web Crypto API. If the two hashes match exactly, the files are byte-for-byte identical; if they differ at all, the files are different.

Can I compare a text file against a binary file?

Yes. Since both files must decode cleanly as text for a line diff to run, mixing a text file with a binary one automatically falls back to the summary table view instead.