Diff Checker

Paste the original on the left and the changed version on the right. The differences appear below as you type, line by line or word by word.

How it works

In Lines mode the two texts are compared line by line with Myers' diff algorithm, the same one git uses by default. Removed lines are marked − and added lines +, each with its line number in the original and in the changed text.

When a line was edited rather than replaced, the removed and added versions are shown one after the other and the words that differ are picked out inside them, so a changed number or a typo stands out in a long line.

Words mode is for prose, where a re-wrapped paragraph would make every line look different. It compares the whole text word by word and shows removed words struck out and added words highlighted. Both texts stay on this page.

How to use it

  1. 1 Paste the original text into Original and the new version into Changed.
  2. 2 Pick Lines for code, data and config files, or Words for prose.
  3. 3 Turn on Ignore spacing or Ignore case if those differences do not matter to you.
  4. 4 Read the differences below. In Lines mode, Copy as unified diff copies them as text.

Good to know

  • Ignore spacing treats lines as equal when they differ only in indentation or in the number of spaces between words. It is the quickest way to see real changes after a reformat.
  • If every line shows as changed, the two texts may be indented differently, such as tabs in one and spaces in the other. Try Ignore spacing, or check them in the Whitespace Visualizer.
  • The summary line counts removed, added and unchanged lines, so you can see the size of a change at a glance.
  • For two spreadsheets, compare them as tables with Spreadsheet Compare instead: a moved column is not a change of every line.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

How a diff decides what changed: the shortest list of edits

Comparing two texts sounds simple: walk down both and mark the lines that differ. That fails the moment a line is inserted near the top, because every line after it is now one place out and would be marked as changed. A diff tool answers a better question: what is the smallest set of lines to remove from the first text and add to get the second? The lines that are left over, in the same order in both, are the ones that did not change.

Take a three line snippet. The original is const a = 1;, const b = 2;, return a + b;. The new version changes only the middle line to const b = 3;. A diff finds that two lines are shared and in order, so the shortest edit is to remove const b = 2; and add const b = 3;. That is what Lines mode shows: line 1 unchanged, a − line for the old line 2, a + line for the new one, and line 3 unchanged. Because the removed and added lines sit next to each other, the tool also compares them word by word and picks out the 2 and the 3. Paste the two versions above to see it.

Finding the smallest set of edits is the work of an algorithm published by Eugene Myers in 1986, the same one git uses by default. It explores the possible edit paths in order of how many edits they need, so the first path that reaches the end of both texts is a shortest one. Before it starts, the tool skips the lines the two texts share at the start and the end, which makes the common case, a few changes in a long file, fast. The search also has a limit: past about 2,000 differences it stops and shows the whole differing middle as removed and then added. That is still a correct diff, only a longer one, and it keeps the page responsive on two very different texts.

Lines are the right unit for code and data, but the wrong one for prose. If someone edits one word in a paragraph and their editor re-wraps it, every line of the paragraph is different, and a line diff marks them all. Words mode ignores line breaks and runs the same algorithm over words and punctuation instead. "The quick brown fox jumps." against "The slow red fox jumps." shows quick brown struck out and slow red added, and nothing else.

A few limits are worth knowing. The copied unified diff has no hunk headers or file names, so tools such as git apply cannot use it, though people can read it. The comparison does not detect moved blocks: a function moved to the end of a file shows as removed in one place and added in another. Ignore spacing works within a line, so an added or removed blank line still counts as a change. And the two texts are compared as you paste them, in your browser, so nothing is uploaded, but a very large pair of files will take a moment to show.

Frequently asked questions

What is the difference between Lines and Words?

Lines treats each line as a unit and is right for code, CSV and config files, where a line is a statement or a record. Words ignores line breaks and compares word by word, which suits prose: a paragraph that was re-wrapped shows only the words that really changed.

Can I get the result as a diff file?

Copy as unified diff gives every line with a space, a - or a + in front, which reads well in a ticket or a chat. It has no @@ hunk headers or file names, so git apply and patch cannot apply it.

How large a text can it compare?

Files of several thousand lines compare in a moment. When the two texts differ in more than about 2,000 places, the tool stops searching for the shortest set of changes and shows the differing block as removed and then added. The result is still correct, just less tidy.

Are my texts uploaded?

No. The comparison runs in your browser. Nothing you paste is sent anywhere, which matters when the text is a contract, a config file with secrets or private code.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.