Diff Checker

Compare two texts online line by line, highlighting additions, deletions and modifications in different colors. The longest-common-subsequence (LCS) algorithm runs locally in your browser — ideal for code, config and document comparison.

0 lines
0 lines

How to use

  1. Paste the original text into the left box and the modified text into the right box; each line is treated as one comparison unit.
  2. Click "Compare" to diff the texts line by line, or tick "Live compare" to re-run the diff automatically whenever either side changes.
  3. In the result, unchanged lines are muted, added lines are green, removed lines are red with a strikethrough, and replaced (changed) lines are highlighted in yellow.
  4. The summary above the result totals the added, removed and changed lines, so you can gauge the scale of the changes at a glance.
  5. For JSON or source code, remove trailing whitespace differences or format both sides first for a cleaner result.

FAQ

Which algorithm does this use and how accurate is it?
The tool implements a line-level longest-common-subsequence (LCS) diff itself — no third-party libraries and nothing uploaded. It finds the common lines that stay unchanged between the two texts and classifies the rest as additions, deletions or replacements.
What is the difference between "changed" and "removed + added"?
When a run of old lines is replaced by a run of new lines of the same length, the new lines are shown as changed (yellow). When only one side gains or loses lines, they are reported as additions or removals, keeping the summary intuitive.
How do the lines map back to the original texts?
The diff keeps the original order: unchanged lines stay in place, removed lines appear at their original position, and added lines are inserted with a + marker next to the matching context, so you can compare against both panels.
Will huge or completely different inputs freeze the page?
The algorithm is optimized for typical sizes. If an input has too many lines (several thousand per side), the tool falls back to a simpler line-aligned mode and says so — it still completes entirely in your browser.

Related Tools