Skip to content

3-Way Diff & Merge Tool

Merge Base, Theirs and Mine versions of a text with a diff3 three-way merge, resolve each conflict by side, and copy or download the result.

3-Way Diff & Merge Tool

Mode:
2 conflicts+12 unchanged
10 lines
11 lines
10 lines
Merged output
function calculateTotal(items, taxRate = 0.1) {
let total = 0;
CONFLICT #3
<<<<<<< THEIRS
for (let i = 0; i < items.length; i++) {
total += items[i].price * (1 + taxRate);
=======
for (const item of items) {
total += item.price * item.quantity;
>>>>>>> MINE
}
return total;
}
CONFLICT #5
<<<<<<< THEIRS
const cart = [];
const totalWithTax = calculateTotal(cart);
console.log("Total with tax:", totalWithTax);
=======
const cart = [{price: 10, quantity: 2}];
console.log(calculateTotal(cart));
>>>>>>> MINE
Change summary
Conflicts:2
Changes:1
Unchanged:2
Resolve conflicts:
Conflict #3
Conflict #5

Need a simpler 2-way diff?

Use our Diff Checker →

Updated . Provided as is. Check the output before you rely on it in production.

How to use 3-Way Diff & Merge Tool

  1. 1

    Input three versions

    Provide the original (base) version, your version, and the incoming version. Paste each into its labeled section. The tool highlights changes, conflicts, and matches automatically.

  2. 2

    Identify conflicts

    Areas where all three versions differ are marked as conflicts. Blue sections show changes from the base, red shows conflicting edits. Green sections are merged cleanly.

  3. 3

    Resolve conflicts manually

    For each conflict, decide whether to keep your changes, accept the incoming changes, or manually combine them. Click through conflicts systematically, reviewing the context in each section.

  4. 4

    Export the result

    Once all conflicts are resolved, copy the merged version or download it as a file. Use this for code merges, document updates, or configuration reconciliation across branches.

  5. 5

    Use for non-code merges

    This tool is useful beyond git: merge YAML configs, JSON data structures, or documentation where git doesn't handle 3-way merging well.

Questions and answers

What is 3-Way Diff & Merge Tool?
A three-way merge combines two edited versions of a file using their common ancestor, so a change made on only one side applies automatically and only overlapping edits conflict. This tool runs a diff3 merge of Base, Theirs and Mine, lets you pick a side per conflict, and leaves Git-style markers on the rest.
When should I use 3-way merge instead of a regular 2-way diff?
Use 3-way merge when you have a common ancestor (Base) and two diverged versions. This is the standard scenario in Git merge conflicts. The Base version provides context about what each side actually changed, leading to more accurate and safer conflict resolution than a 2-way comparison.
For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/diff-merge-tool/

For automation planning, fetch the canonical contract at /api/tool/diff-merge-tool.json.