Start a project

Tool 109 of 194 · Code

Three-Way Merge

Paste the original and two edited versions, and get a merge that keeps both sets of changes, with any real clashes clearly marked to resolve.

Three-Way Merge at a glanceIllustration: 1, Base, yours, theirs; 2, processed in your browser; 3, Merged, with conflicts.Three-Way Merge1Base, yours, theirs−++3Merged, with conflicts2In yourbrowser
1 Base, yours, theirs 2 processed on your device 3 Merged, with conflicts

Three-Way Merge

Base (the common ancestor)

Yours

Theirs

Merged

Where each line came from (Y yours, T theirs, = both)

    Merged file

    01

    What it does

    Merges two edited versions against their common base, auto-takes one-sided changes and marks true conflicts git-style.

    • diff3 merge of base, yours and theirs
    • One-sided changes taken automatically
    • Git-style or diff3-style conflict markers
    • Or resolve every conflict as yours, theirs or both

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Merged text with conflict markers, with a Copy and a Download button on every result.

    • Merge
    • diff3
    • Git

    Why it matters

    When two people edit the same file, comparing just the two versions can't tell who changed what. A three-way merge also looks at the original, so a line only you changed is taken from you, and a line only they changed is taken from them.

    Only when both of you changed the same lines differently is there a real conflict. This tool runs the same diff3 approach Git uses, shows each conflict with both sides, and lets you pick yours, theirs or both, which is handy for config files, content and code outside a repository.

    How it works

    1. InputThe original and two edited versions
    2. In your browserLines matched against the base, both sides compared
    3. OutputA merged file, Git-style conflict markers and a resolver

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Combining two people's edits to config or copy.

    By the numbers

    What the merge did with the sample nginx configUnchanged regions: 4; Merged automatically: 1; Conflicts to resolve: 2Unchanged regions4Merged automatically1Conflicts to resolve2
    Run with this tool's own three-way merge on its sample (9, 9 and 10 lines). A change made on only one side is taken automatically; a region both sides changed differently becomes a conflict, shown with the same markers Git uses. Source: GNU diff3.
    Show the numbers as a table
    RegionCount
    Unchanged regions4
    Merged automatically1
    Conflicts to resolve2

    How to use it

    1. Paste the original (base) text.
    2. Paste your version and their version.
    3. Choose how to show or resolve conflicts.
    4. Copy or download the merged result.

    FAQ

    Is it the same as git merge?

    It uses the same idea (diff3 on lines). Git adds rename detection and history; for a single file the result is the same.

    What counts as a conflict?

    Lines changed on both sides, differently. If both made the same change, it's merged without a conflict.

    Which marker style should I pick?

    Git style shows yours and theirs. diff3 style also shows the base, which makes it easier to see what each side changed.

    Is my text uploaded?

    No. The merge runs in your browser.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk