Diff Checker

Paste two versions of a text and see exactly which lines were added, removed or changed, down to the word.

Original text
Changed text

What this diff checker shows

When two versions of a document look almost the same, the eye is bad at spotting what moved. A diff checker reads both versions and reports the smallest set of edits that turns the first into the second: lines that were added, lines that were removed, and lines that were edited in place. Inside an edited line it also marks the exact words that differ, so a changed price, a swapped date or a missing comma stands out instead of hiding in a paragraph.

Typical uses: checking what a colleague changed in a config file before you deploy it, comparing two drafts of a contract clause, confirming that a copied list of GST numbers matches the original, reviewing a SQL query someone tweaked, or finding the one line that differs between a working and a broken .env file.

How to use it

  1. Paste the older version on the left and the newer one on the right, then press Compare.
  2. Read the counts: Added lines exist only on the right, Removed lines only on the left, Changed lines were edited.
  3. Switch between Side by side, which lines the versions up in two columns, and Unified, which lists removed lines with a minus and added lines with a plus, the way git shows a patch.
  4. Tick Ignore whitespace to treat lines as equal when they differ only in spaces, tabs or indentation, and Ignore case when capital letters do not matter. Tick Only changed lines to hide everything that matches.

How it works

The comparison uses the Myers diff algorithm, published by Eugene Myers in 1986 and still the default in git. Picture a grid with the old lines along one side and the new lines along the other. Every path from the top left corner to the bottom right is a way of editing one text into the other: a step right deletes a line, a step down inserts one, and a free diagonal step means the lines match. Myers searches outward one edit at a time, so the first path to reach the corner is guaranteed to use the fewest insertions and deletions. This page uses the linear space version, which works from both corners at once and splits the problem at the point where they meet, so memory stays small even for long files. Lines are first turned into numbers, so comparing long lines costs no more than comparing short ones. The word level view runs the same algorithm again on the words of each changed pair.

A worked example

Load the sample, a weekly delivery schedule. The checker reports one changed line, one removed line and one added line: Tuesday moved from 9 am to 1 pm to 10 am to 2 pm, with only the two numbers marked; the Wednesday closed line was removed; and a new Saturday slot was added at the end. The four lines that did not change are counted as unchanged.

Limits and privacy

The two texts together can hold up to 20,000 lines. Beyond that the page stops and explains, because a very different pair of large files can keep a browser busy for a long time; split the file or use a command line tool for those. A line that was moved elsewhere shows as one removal and one addition, which is how line diffs work. Word marking is skipped on extremely long single lines. Everything runs inside your browser tab, and Ur Next Door never receives either text, so it is safe for private code, contracts and customer lists.

Frequently Asked Questions

How does the diff checker decide what changed?
It uses the Myers diff algorithm, the same approach git uses, which finds the smallest number of line insertions and deletions that turn the original text into the changed one. Removed and added lines next to each other are shown as changed lines, with the differing words marked.
What does Ignore whitespace do?
Lines that differ only in spaces, tabs or indentation are treated as equal, so re-indented code or trailing spaces do not show up as changes. Ignore case does the same for capital and small letters.
Is there a size limit?
The two texts together can have up to 20,000 lines. Above that the tool stops and explains instead of freezing your browser. For larger files, compare them in parts or use git diff.
What is the difference between side by side and unified view?
Side by side lines up the original and the changed version in two columns. Unified shows one list where removed lines start with a minus and added lines with a plus, like a git patch.
Are my texts uploaded?
No. Both texts are compared inside your browser tab. Ur Next Door never receives them, so it is safe for private code and documents.