File Compare
Compare two text, code, JSON or CSV files line by line with syntax highlighting. Ignore whitespace, case or CRLF/LF. 100% in-browser, no upload.
About File Compare Tool
This tool compares two files and highlights the differences. Upload two files and choose between text mode (line-by-line comparison) or binary mode (byte-by-byte comparison). See detailed differences with color-coded additions and deletions. All processing happens in your browser for complete privacy.
How does file comparison work?
Upload two files and click Compare Files. The tool will analyze both files and show you the differences. For text files, it shows line-by-line changes with color highlighting. For binary files, it compares byte-by-byte and shows the positions of differences.
What's the difference between text and binary mode?
Text Mode compares files line by line, showing added, deleted, and modified lines with syntax highlighting. Perfect for code, documents, and text files. Binary Mode compares files byte by byte, useful for any file type including images, executables, and archives.
Can I compare different file types?
Yes! You can compare any two files. For text files of different formats, use text mode. For binary files or different file types, use binary mode which will show if they're identical or different.
What is side-by-side view?
Side-by-side view shows both files next to each other with changes highlighted. This makes it easy to see what changed between versions. Line-by-line view shows changes in a unified format, similar to Git diffs.
What is the file size limit?
The maximum file size is 50MB per file. This ensures smooth performance in your browser. For larger files, consider using desktop diff tools.
Can I compare code files?
Absolutely! This tool is perfect for comparing code files. It supports syntax highlighting for many programming languages and shows line-by-line changes clearly.
Is my data safe?
Yes! All file comparison happens directly in your browser. Your files are never uploaded to any server. Everything stays private on your device.
Can I use this to find file duplicates?
Yes! If the comparison shows 'Files are identical', the files are exact duplicates. This works for any file type in binary mode.

What file types can I compare?
Any plain text: code (.js, .py, .go, .ts, .css, .html), config (.json, .yml, .toml, .ini), data (.csv, .tsv, .xml), docs (.md, .txt) and logs (.log). Up to 50 MB each.
What diff algorithm is used?
Myers diff (the same as Git). It computes the shortest edit script — fewest line additions and deletions — and presents it in a unified or side-by-side hunk view.
Side-by-side vs unified — which to use?
Side-by-side shows old (left) and new (right) — best for code review. Unified packs both with +/- prefixes — best for emailing patches or pasting into bug tickets.
Can I ignore whitespace or case?
Yes — in text mode tick 'Ignore whitespace', 'Ignore case' or 'Ignore line endings (CRLF/LF)'. These feed the jsdiff engine and the identical-file check, so files differing only by Windows vs Unix line endings, indentation or letter case show as identical (the classic CRLF gotcha).
Is the file uploaded anywhere?
No. Both files are read with the File API and diffed in your browser. Nothing leaves your device — safe for proprietary code, contract drafts or personal documents.
Can it compare JSON structurally?
Pretty-print both JSONs first with our JSON Formatter, then compare here. Formatting one line per key means reordered or reformatted fields line up cleanly instead of showing as one giant change.
How big can the files be?
50 MB each. Very large files take a few seconds to diff because Myers is O(N×D) — D being the edit distance. For huge logs, split first or use grep/awk. Files are read as UTF-8; a leading UTF-8 BOM will show as a tiny first-line difference.
Can I export the diff?
The diff renders as Git-compatible unified hunks on screen, which you can select and copy straight into a code review, bug ticket or .patch file. Dedicated one-click .patch download and HTML export are on the roadmap.
