Black Friday: 50% off every paid plan with code BF50. Ends 5 December.

See prices

Free tool

Diff checker, see what changed.

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 
Original
Changed

Texts are compared in your browser. They are never uploaded.

What people compare

Two versions, one clear view.

01 / Writing

Drafts and contracts

See what an editor, a client or the other side changed between two versions.

02 / Code

Code and config

Spot the one changed setting between two config files or two copies of a function.

03 / Lists

Lists and subtitles

Find lines that were added or dropped between two exports, CSV files or subtitle files.

Guide

How to compare two texts, and read the differences.

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.

How to use the diff checker

  1. Paste the older version into Original and the newer version into Changed. You can also press Open file above either box, or drop a text file of up to 5 MB on it. Drop two files at once and the first becomes the original.
  2. Turn on any of Ignore case, Ignore spaces or Ignore blank lines if those differences do not matter to you.
  3. Press Compare, or Cmd+Enter (Ctrl+Enter on Windows). After that, the result follows as you type in either box.
  4. Read the summary line: how many lines were removed and added, how many changed, how many are the same, and how many blocks of changes there are.
  5. Choose Side by side or One column, and mark changes by Line, Word or Letter. Turn on Only changes to fold away long stretches that did not change.
  6. Use the arrow buttons, or Option+Down and Option+Up (Alt on Windows), to jump from one block of changes to the next.
  7. To merge, press Keep original or Use changed on a block. Undo merge steps back.
  8. Press Download .diff or Copy diff to take the differences as a unified diff, or Save above a box to download that side, for example after merging.

Your choices of view, marking and options are remembered in this browser. The texts are not stored.

Reading the result, with an example

Say a contract went out with these three lines, and came back with a fourth:

LineOriginalChanged
1Notice period: 30 days.Notice period: 60 days.
2Work starts on 3 November.Work starts on 3 November.
3Invoices are due on receipt.Invoices are due on receipt.
4Either 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.

How it decides what changed

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.

Line, Word or Letter

  • Word (the default) marks whole words, numbers and punctuation that differ inside a changed line. Best for writing.
  • Letter marks single letters, so a typo fix such as "recieve" to "receive" shows just the swapped letters. Best for names, codes and IDs.
  • Line marks the whole line and nothing inside it. Best for lists, where any change means a different item.

Merging changes

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.

When to use each option

  • Ignore case for text where capitals were fixed, such as headings changed to title case, or for lists of email addresses and file names.
  • Ignore spaces for code that was re-indented, text copied from a PDF with odd spacing, or lines with trailing spaces. It treats any run of spaces and tabs as one space and ignores spaces at the start and end of a line. It does not ignore a space that was added or removed between two words.
  • Ignore blank lines when one version has extra empty lines between paragraphs, which is common after pasting from an email or a web page.

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.

Tips for common jobs

  • Drafts and contracts. Put each sentence on its own line before comparing, or compare paragraph by paragraph. One long paragraph is one line, so a single comma would mark the whole paragraph as changed, though the word marks still show where.
  • Lists and exports. If the order does not matter, sort both lists the same way first with the alphabetize list tool. Otherwise a reordered list shows as a mass of removed and added lines.
  • Code and config files. Tick Only changes to see each change with three lines of context above and below, much like a code review.
  • JSON. Format both versions the same way first with the JSON formatter, so each value sits on its own line and the diff points at the exact key.

What Download .diff and Copy diff give you

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.

On a Mac

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

Good to know.

How does it decide what changed?

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.

What do the options do?

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.

Can I compare Word documents or PDFs?

Copy the text out of each and paste it here. For a PDF, PDF to text gets the text out first.

Is there a size limit?

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.

Is my text uploaded?

No. Both texts stay in this tab, which matters for contracts, code and anything private.

Can I compare two Excel or CSV files?

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.

Why is the whole line marked when I changed one word?

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.

Can I merge the two versions?

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.

Can I use the result with git or patch?

Yes. Download .diff gives a standard unified diff of the exact texts, which patch and git apply accept.

Why does a moved paragraph show as removed and added?

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.

Does the order of the two boxes matter?

Yes. Removed means in Original but not in Changed, and added means the reverse. If the colours look backwards, press Swap sides.

Listed on

Listed on JustMacAppsMotionShine on Mac App IndexMotionShine on ScrollLaunchMotionShine featured on StartupBaseFeatured on FazierFeatured on Twelve ToolsMotionShine - Featured on Smol Launch