Diff Checker
Compare two texts and see line-by-line differences with color highlighting. Free, private, in-browser.
Diff Checker
Compare two texts and see line-by-line differences with character-level highlighting.
How to Use Diff Checker
- 1
Paste your texts
Paste the original text in the left field and the modified text in the right field.
- 2
Click Compare
Click the Compare button to generate the diff. Added lines appear in green, removed lines in red, and modified lines show both.
- 3
Review differences
Scroll through the results. Modified lines show character-level highlighting so you can see exactly what changed within each line.
Frequently Asked Questions
Related Tools
How Diff Algorithms Work
The core of every diff tool is the Longest Common Subsequence (LCS) algorithm. Given two sequences of lines, LCS finds the longest sequence of lines that appear in both texts in the same order. Everything not in the LCS is either an addition (present only in the new text) or a deletion (present only in the old text). The classic algorithm runs in O(n*m) time and space, where n and m are the line counts — fast enough for typical files but potentially slow for very large inputs.
Line-Level vs. Character-Level Diffs
Line-level diff tells you which lines changed. Character-level diff (also called word diff or inline diff) shows exactly what changed within a modified line — highlighting the specific characters that were added or removed. This is especially valuable for code review, where a single-character typo in a long line is easy to miss in a line-level diff but immediately visible with character highlighting.
Diff in Professional Workflows
Git uses a variant of the Myers diff algorithm by default, with optional patience and histogram algorithms for better results on certain code patterns. Code review tools like GitHub show unified diffs (additions and deletions interleaved) rather than side-by-side diffs, because unified format uses less vertical space. Understanding diff output is a fundamental developer skill — every pull request, merge conflict, and deployment changeset is expressed as a diff.