01 / Writing
Drafts and contracts
See what an editor, a client or the other side changed between two versions.
Free tool
Paste or drop the old version on the left and the new one on the right. Removed lines turn red, added lines green, and inside a changed line the exact words or letters are marked. Jump from change to change, merge a change into either side, ignore case, spaces or blank lines, and save the result as a standard .diff file. Text never leaves your computer.
Need a custom tool, app or website? Contact us →Keys: Cmd Enter compare, Option ↓ and ↑ next and previous change. On Windows use Ctrl and Alt.
Texts are compared in your browser. They are never uploaded.
What people compare
01 / Writing
See what an editor, a client or the other side changed between two versions.
02 / Code
Spot the one changed setting between two config files or two copies of a function.
03 / Lists
Find lines that were added or dropped between two exports, CSV files or subtitle files.
Guide
A diff checker compares two versions of a text and shows exactly what changed between them: lines removed, lines added, and the words that differ inside a changed line. It saves you reading two drafts side by side hunting for edits. This one works line by line and then word by word, shows the result side by side or in one column, and can ignore differences in case, spacing or blank lines so you only see the changes that matter.
Your choices of view, marking and options are remembered in this browser. The texts are not stored.
Say a contract went out with these three lines, and came back with a fourth:
| Line | Original | Changed |
|---|---|---|
| 1 | Notice period: 30 days. | Notice period: 60 days. |
| 2 | Work starts on 3 November. | Work starts on 3 November. |
| 3 | Invoices are due on receipt. | Invoices are due on receipt. |
| 4 | Either side may end this agreement in writing. |
The summary says 1 removed, 2 added, 1 line changed, 2 the same, 2 blocks of changes. Line 1 shows as a changed line, red on the left and green on the right, with only 30 and 60 marked, so you see the edit without rereading the sentence. Lines 2 and 3 are unchanged. Line 4 appears in green on the right with an empty space on the left. The changed line counts once as removed and once as added, which is why the totals are 1 and 2.
The line numbers on each side are the line numbers in that version. They drift apart after an added or removed line, which helps you find the same spot in the original file.
The tool uses Myers' difference algorithm, the same approach behind git diff. It looks for the smallest set of lines to remove and add that turns the original into the changed text, and keeps everything else as unchanged. Where removed lines and added lines sit at the same place, they are paired up in order and shown as changed lines, and then the words, numbers and punctuation inside each pair are compared the same way.
Two things follow from this. A line that was moved somewhere else shows as removed in one place and added in another, because a diff has no idea of moving. And if one line was split into two, you see one changed line plus one added line.
With long texts that differ in many places, the search for the very smallest set of changes can take a long time. The tool first sets aside lines that are the same at the start and end, and if the middle still has too many changes, it lines up the lines that appear exactly once in each version, as the patience diff method does, and compares the parts between them. The result is still a correct list of changes, though in rare cases not the shortest one.
Each block of changes has two buttons. Keep original puts the original lines back into the Changed box, so that change is undone in the new version. Use changed copies the new lines into the Original box, so the original takes the change. Either way the block disappears from the result, because both sides now agree there. Work through the blocks, then press Save above the box you want to keep. Undo merge steps back one merge at a time.
Line endings from Windows and from a Mac are treated the same, so a file saved on another computer does not show every line as changed.
Both give a unified diff, the format of diff -u and code review tools: a line naming each file, then each block of changes with a header such as @@ -5,7 +5,7 @@ (the line number and number of lines in each version), three unchanged lines around each change, a minus in front of removed lines and a plus in front of added lines. A file that does not end with a line break gets the usual "No newline at end of file" note.
The export always compares the exact text, without the ignore options, so it can be applied to the original file with the patch command or git apply. The file names come from the files you opened, or original.txt and changed.txt for pasted text.
Terminal has a built-in diff command. Type diff -u old.txt new.txt, with the paths to your two files, and it prints the changes with minus and plus signs. This page gives the same output with Download .diff, plus the colours, the word and letter marks, and merging, and it works for text that is not saved in a file.
Questions
It finds the smallest set of lines to remove and add to turn the original into the changed text (Myers' difference algorithm, the method behind git diff). Where a removed line and an added line sit in the same place, they are shown as one changed line, and the words inside are compared the same way.
Ignore case treats "Hello" and "hello" as the same. Ignore spaces treats any run of spaces and tabs as one and ignores spaces at the ends of lines. Ignore blank lines leaves empty lines out of the comparison.
Copy the text out of each and paste it here. For a PDF, PDF to text gets the text out first.
Files can be up to 5 MB each, and pasted text has no set limit. Texts of tens of thousands of lines compare in a few seconds or less on a recent computer, since all the work happens in your browser. With very long texts, turn on Only changes so the page shows less at once.
No. Both texts stay in this tab, which matters for contracts, code and anything private.
Yes, as text. Save or export each sheet as CSV, open both files here, and each row is compared as a line. A change in one cell marks that row and highlights the cell's value.
The tool works line by line first, so any edit marks its line as changed. Look inside the line: with Word or Letter chosen, only the words or letters that differ are highlighted. With Line chosen, the whole line is marked on purpose.
Yes. Each block of changes has Keep original and Use changed buttons that copy one side's lines into the other. When you are done, press Save above the box you want to keep.
Yes. Download .diff gives a standard unified diff of the exact texts, which patch and git apply accept.
A diff only knows about removing and adding lines, not moving them. A paragraph moved from the top to the bottom appears as removed at the top and added at the bottom.
Yes. Removed means in Original but not in Changed, and added means the reverse. If the colours look backwards, press Swap sides.