GT GetToolsFree
Free · No sign-up · Runs in your browser

Diff Checker

Compare an original and a modified text and see exactly which lines were added, removed, or left unchanged.

Ad space — 728×90 banner
Original lines
0
Modified lines
0
Added
0
Removed
0
Unchanged
0

How to use the Diff Checker

  1. Paste the original text on the left and the modified version on the right.
  2. Click "Compare" to see the differences.
  3. Added lines are highlighted green with a + marker, removed lines are highlighted red with a - marker, and unchanged lines have no marker.
  4. Click "Copy result" to copy the annotated diff, or "Clear" to start over.

How it works

This uses a longest-common-subsequence (LCS) diff, the same family of algorithm behind tools like Git's diff and Unix diff — it finds the longest sequence of lines that appears in both texts, in the same order, and treats everything else as added or removed around that shared backbone. For example, comparing "Line one / Line two / Line three" against "Line one / Line 2 changed / Line three" reports "Line one" and "Line three" as unchanged, "Line two" as removed, and "Line 2 changed" as added — a single real edit, not three false ones. For large documents, the exact LCS comparison only runs on small chunks: matching lines at the start and end are trimmed off first, and if a large differing region remains, the tool finds a long run of matching lines somewhere inside it and splits the comparison there, recursing until every remaining chunk is small — so a document with edits scattered every few thousand lines stays fast, rather than forcing one enormous comparison over the whole thing.

Frequently asked questions

Is my text uploaded anywhere?

No — the comparison runs entirely in your browser using JavaScript. Nothing is sent to a server.

How does this compare to a naive line-by-line comparison?

A naive comparison (checking if line 1 equals line 1, line 2 equals line 2, and so on) falls apart the moment a single line is inserted or deleted — every line after that point looks "different" even though nothing about it actually changed. This tool instead finds the longest matching sequence of lines shared between both texts, so a single inserted or deleted line is reported as exactly that, without cascading false differences through the rest of the document.

How is a modified line shown?

As a removed line (the old version) immediately followed by an added line (the new version) — the same convention used by most diff tools, since a line changing is really "the old line is gone, a new line is here instead."

Can this handle a large document with changes scattered throughout it?

Yes. Rather than only trimming matching text at the very start and end, this tool recursively finds a long run of matching lines anywhere in the remaining text and splits the comparison around it — so a 10,000-line document with a handful of edits spread across it stays fast, since each small changed region is diffed on its own instead of forcing the whole document through one huge comparison.