Text Compare
Compare two texts and see the differences.
How to Compare Two Texts
Paste both versions
Put the original in the left panel and the modified version in the right.
Differences are computed locally
Additions and deletions are highlighted line by line in your browser.
Review the changes
Spot every insertion, removal and modification at a glance.
What a diff actually computes
A comparison finds the longest sequence of content common to both texts and reports everything else as added or removed. That is a mathematical operation on characters, not an understanding of meaning โ the algorithm has no idea what changed conceptually, only which parts of the two inputs line up.
This explains the behaviour that frustrates people most. Move a paragraph from the top of a document to the bottom and a diff reports it as one deletion and one addition, because that is literally what happened to the sequence. Nothing was 'moved' as far as the comparison is concerned.
Line, word and character comparison
Line-level comparison is what version control uses: it is fast and it suits code, where a line is a meaningful unit. Its weakness is prose, where a single reworded sentence marks the whole paragraph as changed if the text is stored as one long line.
Word-level comparison shows exactly which words differ and is far more useful for documents, contracts and translations. Character-level is finer still and best reserved for short strings, where you are hunting a single wrong digit or letter.
Invisible differences
Two texts that look identical can differ in ways the eye cannot see: trailing spaces at the end of lines, tabs where spaces are expected, Windows line endings against Unix ones, non-breaking spaces pasted in from a web page.
These produce diffs that appear to mark unchanged lines as changed, and they are maddening until you know to look for them. Comparing text copied from a PDF or a word processor is where they appear most often, because both introduce characters that are not the ones they resemble.
Unicode makes 'identical' complicated
The same accented character can be stored as one code point or as a base letter plus a combining mark. The two render identically and are different byte sequences, so a comparison reports a difference where a human sees none. Text from different sources โ one from a Mac, one from Windows โ hits this regularly.
There are also characters that are genuinely invisible: zero-width spaces and direction marks that survive copying and paste. A diff that insists two identical-looking strings differ is usually right, and one of these is usually why.
Reading a diff well
A large number of changes usually means the comparison granularity is wrong rather than that the document changed enormously. Switching from line to word comparison collapses a wall of red and green into the handful of real edits.
Comparison runs entirely in your browser. Contracts, drafts and code are exactly the material people compare, and none of it is transmitted here โ worth noting, since comparing two versions of a confidential agreement on a server-side tool means uploading both.
Which version goes on which side
A diff is directional. Put the old version on the left and the new one on the right and the additions are what was added; reverse them and every addition reads as a deletion. The comparison is correct either way and the interpretation is inverted, which is easy to do and surprisingly hard to notice.
The habit that prevents it is labelling before comparing rather than after. When reviewing someone's changes to a contract, the version you received is the new one โ even though the version you wrote feels like the primary document.