Text compare (diff)
Compare two texts line by line and see what was added, removed or changed, down to the word.
How to use
Paste the original text in the first box and the changed text in the second. The comparison runs as you type: removed lines are marked − in red, added lines + in green, and inside a changed line the words that differ are highlighted. Long runs of unchanged lines fold away, with three lines of context kept around each change.
Lines are compared with the algorithm Eugene Myers published in 1986, which Git uses by default. It finds the shortest set of removed and added lines that turns one text into the other, so a single edited line shows as one removal and one addition rather than as a cascade of changes.
Ignore case treats A and a as equal, and Ignore extra spaces treats any run of spaces or tabs as one space and ignores those at the ends of a line. Both only affect the comparison: the lines are always shown as they were typed. Copy puts the result on the clipboard as plain text, with - before removed lines, + before added ones and two spaces before the rest.
Everything runs in your browser and nothing is uploaded, so drafts, contracts and code can be compared without sending them anywhere. The comparison follows the order of the lines; to compare lists where order does not matter, List compare is the better fit.
Example
Compares two short shopping lists: “bread” became “brown bread” and “eggs” was added at the end. Lines in both stay unmarked.
bread → brown breadOne removed and one added line, with the new word “brown” highlighted.A line added at the endShown in green with + and only the changed text’s line number.Hello · helloDifferent, unless Ignore case is on.Same text, extra spaces at line endsReported as the same once Ignore extra spaces is on.
Frequently asked questions
Is my text uploaded?
No. The comparison runs in your browser and nothing is sent anywhere, so it is safe for private documents.
Why is a moved paragraph shown as removed and added?
A line comparison keeps the order of the lines. A block moved elsewhere breaks that order, so it appears as removed at its old place and added at the new one.
How large can the texts be?
Long texts work as long as they mostly match, because the work grows with the number of differences. When more than 3,000 lines differ, the tool says so instead of showing them.
How is this different from List compare?
List compare treats each text as a set of items and ignores their order; this tool keeps the order and shows where each change is.