DevKit
Tester

3-Way Diff

Compare two versions against a common base and spot merge conflicts.

Last updated: August 2026

Compares two versions against a common base, line by line. A changed, B changed, both same change, conflict.

Share:

Was this tool helpful?

Comparing against a common base

A 3-way diff compares two versions, yours and theirs, against the common ancestor they both started from. That third anchor is what makes merging possible: it tells you not just that the two versions differ, but who changed what relative to the original. This is the model Git uses when it merges branches.

Why the base changes everything

With only two files you cannot tell whether a line is new on the left or deleted on the right. The base resolves that. If a region changed on only one side, the merge takes that side automatically. A conflict arises only when both sides changed the same region in different ways.

Example

Base:  color = red
Mine:  color = blue
Yours: color = green

Conflict: both changed the same line
{'<'}{'<'}{'<'}{'<'}{'<'}{'<'}{'<'} mine
color = blue
=======
color = green
{'>'}{'>'}{'>'}{'>'}{'>'}{'>'}{'>'} yours

Those conflict markers are exactly what Git writes into a file when it cannot merge automatically. The ======= separates the two competing versions.

Reading the outcome

Non-conflicting changes from both sides combine cleanly. The job is to resolve the overlapping regions by hand, choosing one side, the other, or a hand-written blend, then removing the markers. A clean merge has no markers left.

FAQ

Why does a change show as conflict when the result is the same? If both sides edited the same lines, even to identical text, a strict 3-way merge can still flag it because the regions overlap.

Can it merge automatically? It merges the non-overlapping parts and leaves overlapping ones for you. There is no safe way to auto-pick between two conflicting human edits.

What if I do not have the base? Then you are limited to a two-way comparison like a word diff, which shows differences but cannot attribute them.