Diff Checker

Paste the original on the left and the changed version on the right. Added, removed and changed lines are highlighted, with the exact changed words marked inside each line.

Original

Changed

+0 added−0 removed~0 changed0 unchanged

How a diff is found: the longest common subsequence

A diff checker doesn’t compare line 1 with line 1. It looks for the longest sequence of items the two versions share in the same order; everything outside that sequence is an addition or a deletion. Real diffs do this with whole lines — here it’s letters so the table fits. Change the words and step through it.

SKIRTS
0000000
S0
H0
I0
R0
T0

Press “Next cell”. Each cell answers: how many letters do the two prefixes have in common, in order?

Git and this tool use Eugene Myers’ 1986 algorithm, which finds the same answer without filling the whole table — important when files have thousands of lines.

How to compare two files

  1. Paste or drop the original text on the left and the new version on the right.
  2. Press Compare. Removed lines are red, added lines green; changed words inside a line are marked more strongly.
  3. Switch between side by side and unified, and use Ignore whitespace to hide re-indentation noise.
  4. Download the result as a unified .patch that git apply and patch understand.

Comparing JSON or code that was formatted differently

If two files differ only in formatting, every line shows as changed. The code diff checker does this for you: it formats both sides with the same rules before comparing. For JSON data, JSON compare also ignores key order. Only the real changes remain.

Questions

Is the text I compare uploaded?

No. The diff is calculated in your browser with the open-source jsdiff library, which implements the Myers diff algorithm also used by Git.

Can I compare two files?

Yes — drop a file onto either side, or use the Open file buttons. Any text file works: code, CSV, logs, configs.

How do I compare two JSON files?

Use JSON compare: it ignores key order and formatting and lists each changed path.

Can I share a comparison?

The comparison never leaves your browser, so there is no share link. Download the .patch file and send that instead — anyone can apply it with git apply.

What is the difference between text compare and code diff?

Both compare line by line. For source code that may be indented or wrapped differently, the code diff checker formats both sides first so only real edits show.

How do I see only the lines that changed?

Tick Only changes. Unchanged runs are folded down to three lines of context around each change, like git diff.

Related tools