How the diff works
Paste the original into the left box and the changed version into the right one. The tool computes the shortest set of edits using Myers' diff algorithm, the one behind git diff, and shows each line as unchanged, removed (red) or added (green). Where a removed line is paired with an added line, the individual words that changed are highlighted too, so a one-word edit in a long paragraph is obvious.
- Ignore whitespace treats runs of spaces and tabs as equal, hiding re-indentation noise.
- Ignore case compares without regard to capitals.
- Show only changed lines hides the unchanged context.
- Copy unified diff produces the standard patch format with three lines of context, ready for a ticket or code review.
Inputs larger than about 60,000 characters are diffed in a background worker so typing stays smooth.
Worked example
Left:
The quick brown fox
jumps over the lazy dog.
Line three stays.
Right:
The quick red fox
jumps over the very lazy dog.
Line three stays.
Result: two lines changed and one unchanged. On the first pair only the word brown is marked removed and red added; on the second, only very is added. The unified diff starts @@ -1,3 +1,3 @@ followed by the changed lines prefixed with - and +.
Choosing the right diff
A line diff is ideal for prose, code, logs and configuration. For JSON, a text diff reports differences caused by key order or indentation that do not change the data, so use the JSON diff, which compares structure instead. If the two versions differ almost everywhere, for example two unrelated files, the result degrades to "everything removed, everything added", and the tool says so rather than running forever. To normalise code before comparing, run both through the JavaScript beautifier first.
Frequently asked questions
Are my texts uploaded to a server?
No. The comparison is calculated by JavaScript in your browser, and both texts stay on your device. Large comparisons run in a Web Worker, also locally.
Can I compare two files?
Yes. Drop a file on each box or use Open file. Text files up to 25 MB are accepted. Binary files are not meaningful here.
What is a unified diff?
The patch format used by git and the diff command. Changed lines are prefixed with - and +, grouped into hunks headed by @@ line ranges. Many tools can apply it.
Why does a moved paragraph show as removed and added?
Line diffs have no concept of moves; a block that appears in a different place is a deletion at one location and an insertion at another. That is how git reports it too.