Compare

Compare two texts

Left against right, line by line.

The comparison is a longest-common-subsequence over lines, the same basis editors use: unchanged lines stay in place, removed lines are marked with a minus and added ones with a plus.

It compares whole lines, not characters, so a changed word makes that line show as one removal and one addition. That is the right granularity for prose and configuration, and the wrong one for two versions of a minified file, where every line differs anyway.

Both sides are capped at 2000 lines. The work grows with the two lengths multiplied together, and a cap that says so is better than a tab that stops responding halfway through a comparison you were waiting for.

Questions

Does it ignore whitespace?

No. A line with a trailing space is a different line. Trim first if that is what you want to compare.

Why does one changed word show as two lines?

The comparison is line-based, so the whole line is removed and a new one added. Character-level detail is a different view.

Can I compare two files?

Paste their contents. Both boxes take text, up to the line cap.

Is either text uploaded?

No. Both stay in the page and are gone when it reloads.

More text and code