Diff Checker
Compare two texts with line-by-line and character-level diff highlighting. All processing runs locally in your browser.
?Tips
- Highlighted characters within changed lines show exact character-level differences.
- Use Swap to quickly reverse the diff direction.
- Works with any text: source code, config files, SQL, JSON, XML, or prose.
- Copy Diff outputs the diff in standard unified format (+/- prefix).
Understanding Text Diffs
A text diff compares two versions and shows exactly what was added, removed, or unchanged. Diff algorithms power version control (Git), code review tools, and document comparison. Understanding diffs is essential for collaborative software development.
This tool uses the Longest Common Subsequence (LCS) algorithm, the same foundation as Git and GNU diff. LCS finds the longest sequence of lines appearing in both versions in order. Lines in the LCS are unchanged; others are additions or deletions.
Character-level diffing goes further by highlighting exactly which characters changed within modified lines. This catches typos, variable renames, and single-character errors that are easy to miss when reviewing line-level diffs alone.
The unified diff format uses + for additions and - for deletions. Our tool combines this with dual line numbers showing the original and modified line positions, giving you the compactness of unified diff with the clarity of side-by-side comparison.
When reviewing diffs in code review, focus on the intent of changes rather than just syntax. Check for bugs in changed logic, verify edge case handling, ensure tests cover modified paths, and confirm changes align with the stated purpose.