Diff and merge tool

Paste two versions of a file to see every change side by side. For each change, choose the left version, the right version or both, and build a merged result as you go.

How to diff and merge tool

  1. Paste the original version on the left and the changed version on the right, or open two files.
  2. Go through the list of changes. For each one, choose Left, Right or Both.
  3. Copy or download the merged result. Switch to Patch to get a unified diff instead.

What it is for

  • Combining two edits of the same file, for example a config file changed on two servers, when you want some lines from each.
  • Resolving a conflict by hand when a Git merge leaves you with two versions.
  • Reviewing changes to code, SQL, JSON or prose before you accept them.
  • Creating a patch to send to someone, or to apply with git apply or patch.

Reading the changes

Lines that are the same in both versions are shown in gray, with long unchanged stretches folded away. Each difference appears as a pair: the left side in red is what the original has, and the right side in green is what the changed version has. An empty side means the lines exist in only one version.

ChoiceThe merged result gets
LeftThe original lines, so the change is rejected
RightThe changed lines, so the change is accepted
BothThe left lines followed by the right lines

Every change starts on Right, so with no clicks the result equals the changed version.

What a unified diff looks like

--- original
+++ changed
@@ -1,4 +1,4 @@
 server {
-    listen 80;
+    listen 8080;
     server_name example.com;
 }

Lines starting with - are removed, lines starting with + are added, and the others are context. The @@ line gives the line numbers in each file.

Only need to see the differences, down to the word? Use Text Compare. For Git commands, see the Git cheat sheet.

Private by design

This tool runs entirely in your web browser. Nothing you type or paste is sent to a server, logged or stored, so it is safe to use with internal addresses, configuration files and other work data. There is no sign-up and it keeps working offline once the page has loaded.

Frequently asked questions

How do I merge two files online?

Paste one into each box, choose Left, Right or Both for every change, then copy or download the merged result.

Can this resolve Git merge conflicts?

It helps with the manual part. Paste “ours” and “theirs”, pick what to keep for each change and paste the result back into the conflicted file.

How do I create a patch file?

Switch the output to Patch. The unified diff can be saved and applied with git apply or the patch command.

Is there a size limit?

Files with tens of thousands of lines work. Very large files with thousands of changes may be slow.

Are my files uploaded?

No. The comparison runs in your browser.