🔧 View Mode
⚙️ Comparison Options
Both normalisations affect comparison only — rendered lines stay verbatim.
📄 Side A — original
Max 1 MB. The file is read locally, never uploaded.
📄 Side B — modified
Max 1 MB. The file is read locally, never uploaded.
📊 Stats
⚠️ Inputs were capped to keep the diff responsive — comparison is over the first lines only.
🔀 Side-by-Side
📋 Unified Diff
{{ unifiedText || '(no differences)' }}
📤 Summary
ℹ️ About File Comparer
What this tool does
The File Comparer takes two text inputs — loaded from local
files or pasted into the textareas — and produces a line-by-line
diff between them. You can view the result as a side-by-side
comparison (two columns with additions in lime and deletions
in coral) or as a standard unified diff
(--- / +++ / @@ headers, - for
deletions and + for additions). The diff is
computed entirely in your browser; nothing crosses the
network and there is no API endpoint for this tool.
How it works
Each side's text is split on CRLF / LF / CR into a list of lines. The browser builds a Longest Common Subsequence table comparing the two line arrays and backtracks through it to label each line as equal, delete (present only in A), or insert (present only in B). The unified-diff view groups consecutive changes into hunks with three lines of surrounding context, matching the GNU Diffutils unified format.
Options
- Ignore whitespace — drops all whitespace from each line before comparison (matches the
diff -wbehaviour). Useful when comparing reformatted or re-indented files. - Ignore case — lower-cases each line before comparison. Useful for prose / heading checks where casing changes are not meaningful.
- View mode — toggle between side-by-side (default) and unified-diff text.
Both normalisations only affect comparison — the rendered lines are still shown verbatim so you can see the exact original text.
Limits
- 1 MB per side. Files larger than 1 MB surface an inline error; trim them first or paste an excerpt.
- Line-oriented. Sub-line (word / character) diffs are out of scope — this is a classic LCS line diff, identical to what
diffproduces by default. - Text-only. Binary inputs may decode as garbled UTF-8 and produce meaningless diffs. Use a hex viewer for binaries.
- No semantic understanding. A reordered line counts as one delete and one insert, never as a "move".
Privacy
The file contents are read with the browser's FileReader.readAsText API; the diff itself is a few hundred lines of JavaScript running in your tab. No upload, no telemetry, no API endpoint — this is one of a small set of tools on the site that intentionally ship without a public API because uploading the files would defeat the privacy guarantee.
References
- Wikipedia — diff (history and output formats).
- GNU Diffutils — Unified Format.
- POSIX
diffutility specification. - Longest Common Subsequence problem (Wikipedia).
- For pasted-text-only comparison (no file picker), see the Online Diff Tool.