What Is a Diff Checker?
A diff checker compares two pieces of text and highlights the differences — which lines were added, removed or unchanged. Diff tools are essential for code review, document revision tracking, config file comparison, and debugging. Compare any two texts now: Diff Checker
How to Read Diff Output
Our diff checker uses colour coding to show changes:
- Green lines — Added in the modified version (B) but not in original (A)
- Red lines — Present in original (A) but removed in modified (B)
- White lines — Unchanged, present in both versions
How the LCS Algorithm Works
Most diff tools use the Longest Common Subsequence (LCS) algorithm. It finds the longest sequence of lines that appears in both texts in the same order, then identifies everything that is not part of that common sequence as either added or removed. This produces the minimal diff — the smallest number of changes to transform A into B.
Common Use Cases
Code Review
Paste the old version of a function on the left and the new version on the right. The diff instantly shows you what changed — useful when reviewing pull requests or understanding someone else's edits.
Config File Comparison
Comparing nginx.conf, php.ini, .env files before and after changes. Spot accidental deletions or unexpected additions before they cause production issues.
Document Revision
Compare two drafts of a document, contract, or policy to see exactly what was added, removed or changed between versions.
JSON Comparison
Paste two JSON responses from an API to see what changed between versions. Format both with our JSON Formatter first for cleaner diffs.
CSV Data Validation
Compare two exports of the same data source to verify consistency or find rows that changed.
Online Diff vs Command Line
| Method | Best for | Privacy |
|---|---|---|
| Our online tool | Quick one-off comparisons | 100% local, never uploaded |
| git diff | Code in a git repository | Local |
| diff (Unix) | Scripted comparisons, CI pipelines | Local |
| VS Code diff | Comparing files in your editor | Local |
Command Line Quick Reference
Basic Unix diff: diff file1.txt file2.txt
Side by side: diff -y file1.txt file2.txt
Ignore whitespace: diff -b file1.txt file2.txt
Git diff of last commit: git diff HEAD~1
Related Tools
- Diff Checker — Compare any two texts online
- JSON Formatter — Format JSON before comparing
- CSV to JSON — Convert data formats