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. Run both through the matching formatter first — the JSON formatter with Sort keys on is ideal — then compare. 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.

What is the difference between text compare and code diff?

None technically; both compare line by line. Code benefits from the whitespace option and the word-level highlighting.

Related tools