Side by Side Diff

Paste the old and new versions. Lines line up in two columns with numbers, and the exact characters that changed are highlighted inside changed lines.

Worked examples

A code change

Original: const total = price * qty; console.log(total); return total; Changed: const total = price * quantity; console.log(total); console.log("done"); return total;

--- original +++ changed @@ -1,3 +1,4 @@ -const total = price * qty; +const total = price * quantity; console.log(total); +console.log("done"); return total; Lines changed: 1 Lines added: 1 Lines removed: 0 Lines unchanged: 2 2 lines differ.

One line is edited and one is added. In the columns, qty and quantity are marked inside the edited line.

Ignoring spaces and capitals

Original: Name: Ann City: Leeds Age: 31 Changed: name: Ann City: Leeds Age: 32

--- original +++ changed @@ -1,3 +1,3 @@ Name: Ann City: Leeds -Age: 31 +Age: 32 Lines changed: 1 Lines added: 0 Lines removed: 0 Lines unchanged: 2 1 line differs.

With both options on, only the age line counts as a change.

About Side by Side Diff

This side by side diff checker lays two versions of a file next to each other. The original is on the left and the changed version on the right, with line numbers for both. Lines that were removed, added or edited are shaded, and inside an edited line the exact characters that changed are marked, so you can tell a one letter fix from a rewrite at a glance.

You can ignore spaces at the end of lines and differences in capital letters, and show every line or only the changes with a few lines of context around them. Below the table you get the same differences as a unified diff, the plain text patch format that version control tools use, which you can copy or download.

How to use Side by Side Diff

  1. Paste the original into the left box and the changed version into the right box.
  2. Choose whether to ignore spaces at line ends or capital letters, and how much to show.
  3. Read the two columns, or copy the unified diff.

Common uses

  • Reviewing what changed between two versions of a script or config file
  • Checking a document edit line by line
  • Finding the one character that differs between two similar values
  • Creating a patch to share in an email or a ticket

Frequently asked questions

How is this different from the text diff checker?

The text diff checker shows one list of added and removed lines. This tool shows two aligned columns with line numbers, highlights the changed characters inside edited lines and can output a unified diff.

How does it pair up changed lines?

Lines that differ are matched in order inside each changed block, so the first removed line is shown against the first added line, and so on. Extra lines on either side show as pure additions or removals.

Is there a size limit?

Very large inputs are refused, because comparing every line against every other line needs a lot of memory. Compare smaller parts if you see the message.

What does the unified diff contain?

A header and hunks that begin with @@, with removed lines starting with a minus sign, added lines with a plus sign and three lines of context around each change.