File diff: compare files without the command line
Developers reach for diff or git diff to compare files, but those need a terminal and the files on the same machine. This file diff tool runs in the browser: load or paste two versions and the differences are highlighted line by line. Tick Collapse unchanged and it keeps three lines of context around each change, just like diff -u, so you can focus on what changed in long files.
Example: two configuration files
Original file Changed file
server: server:
port: 8080 port: 8080
host: 0.0.0.0 host: 127.0.0.1
database: database:
driver: mysql driver: mysql
host: localhost host: localhost
pool: 5 pool: 20
timeout: 30
logging: logging:
level: info level: infoThe tool marks two changed blocks. In the first, the host line is highlighted on both sides. In the second, pool: 5 became pool: 20 and a timeout line was added below it. The summary in the toolbar reads 2 changes +3 −2: two blocks, three lines on the changed side and two on the original side.
Typical file comparisons
- Configuration drift – compare
.env, YAML, INI ornginx.conffiles from staging and production. - Script versions – see what a colleague changed in a shell or Python script sent by email.
- Data exports – compare two CSV exports to find new, deleted or edited rows.
- Documentation – review edits to Markdown or plain-text files.
- Generated files – check what a code generator or dependency update changed in a lock file.
Creating and applying a patch
This page shows the comparison on screen and does not write a patch file. When you need one, the command-line tools create it from the same two files and apply it to the original:
diff -u original.conf changed.conf > changes.patch
patch original.conf < changes.patch
# or, inside a Git repository:
git apply changes.patchIn the patch, lines starting with - exist only in the first file, lines with + only in the second, and lines with a leading space are unchanged context. The @@ header gives the line ranges in each file.
Options
- View – Side by side for reading in two columns, or Unified for one column with each removed line shown above the text that replaced it.
- Collapse unchanged – fold long unchanged stretches and keep three lines around each change, or leave it off to see the whole file.
- Ignore whitespace / Ignore case – hide changes that do not matter, such as re-indentation, trailing spaces or capitalization.
Line endings are normalized, so a file saved on Windows compares cleanly with the same file from Linux.
When a diff looks bigger than it should
- Re-indentation. Switching from tabs to spaces or changing the indent width marks every line as changed. Tick Ignore whitespace to see only real edits.
- A byte order mark. If only the first line differs and it looks identical, one file probably starts with an invisible UTF-8 BOM.
- Reordered lines. A line-based diff reports a moved block as a deletion plus an addition. For lists or CSV rows where order does not matter, sort both files first.
- Different encodings. A file saved as UTF-16 or Windows-1252 may show accented characters as changed. Re-save both files as UTF-8 before comparing.
Which diff tool should you use?
For quick pasted snippets, the diff checker offers the same comparison with plain Original and Changed labels. For JSON documents where key order does not matter, the JSON diff compares structure instead of lines. Files are read and compared locally; nothing is uploaded.