Text compare and diff checker
Paste two versions of a text to see exactly what changed: every added, removed and changed line, with the changed words marked. Use this text compare tool on writing or code, and read the result side by side or inline.
- Free
- No sign-up
- Runs in your browser
- 500,000 characters a side
Paste or open two texts to see every difference here.
How to use it
- 1Paste the original text in the first box and the changed version in the second, or open a file in each.
- 2Read the comparison under the boxes: removed text in red, added text in green. Next and Previous jump from one change to another.
- 3Turn on Ignore case, spaces or blank lines to stop marking differences that don’t matter. Copy diff and Download .diff still give you every change.
How the comparison works
A difference checker lines the two texts up so that as much as possible matches, then shows what’s left over: lines only in the original were removed, and lines only in the changed text were added. This page uses the Myers algorithm, the one git diff uses by default, so it finds the fewest changed lines that explain the edit.
The comparison code is jsdiff 9.0.0, an open-source library that loads from this site, under the BSD 3-Clause License.
Inside a changed line, the page compares the two versions again, word by word or, with Characters, character by character, and marks only the text difference. When less than 40% of the two lines matches, the whole line is marked instead, because a few shared words would only be noise.
The comparison runs in a background thread of your browser, so a long comparison doesn’t hold up the page. Each box takes up to 500,000 characters, or a text file up to 0.5 MB. A text with hundreds of thousands of short lines takes the browser itself a few seconds to show in a box, longer on a phone. If two long texts differ almost everywhere, the line comparison stops after 3 seconds, and the page says so.
How to compare text in Word, Excel and VS Code
- Word: on the Review tab, choose Compare, then Compare Documents (just Compare on some versions). Pick the original and the revised document, and Word opens a new copy with the differences shown as tracked changes, leaving both files as they were.
- Excel: =EXACT(A2,B2) gives TRUE only when two cells match exactly, capital letters included. =A2=B2 ignores case. Neither says where two cells differ; paste both cells here for that.
- VS Code: select two files in the Explorer, right-click and choose Compare Selected, or run code --diff first.txt second.txt in a terminal.
- Notepad++ has no compare command of its own. Install a compare plugin from Plugins > Plugins Admin.
To compare documents that aren’t in the same app, such as a PDF and an email, copy the text out of each and paste the two versions above.