Direct answer
How does the Diff Anything three-way merge tool work?
Diff Anything Pro provides a local three-way merge workspace for text sources on macOS and Windows. Text merges line-based, also combining edits to separate words of the same line, and JSON, YAML, TOML, and INI files merge by their data, value by value. A file that already contains conflict markers opens straight into the workspace with Resolve, and git mergetool can open the merge in Diff Anything's window, on Windows directly and on a Mac through the free command-line helper. The current left source becomes Ours, the right source becomes Theirs, and you select their common Base. Focused diff views show each side against Base. Independent changes combine automatically; competing edits offer Ours, Theirs, Ours then Theirs, Theirs then Ours, and Base choices.
color: bluecolor: greencolor: redWhy three sources
A two-way diff shows disagreement. A three-way diff explains where it came from.
A two-way diff can show that two files disagree, but it cannot reliably tell which side changed a line. Three-way merge adds the shared Base, so each side can be compared with the version it started from.
That extra source lets Diff Anything combine independent line changes automatically and reserve explicit conflicts for overlapping edits that need a decision.
Base, Ours, Theirs
Know which source is which before merging.
Base is the common starting text. Ours is the current left source. Theirs is the current right source. These labels describe the three inputs to this standalone workspace; Diff Anything does not infer a Git branch or choose the common ancestor for you.
Selecting the wrong Base can turn independent changes into misleading conflicts or hide the history needed to understand an edit. Confirm the source roles before running the merge.
Conflict resolution
Overlapping edits stay explicit until you resolve them.
When both sides change the same line region differently, Diff Anything creates a structured conflict and shows the relevant Ours, Base, and Theirs content. You can accept Ours, accept Theirs, combine both with Ours first and Theirs second, return to Base, or edit the result directly.
The result editor uses conventional conflict markers. Diff Anything disables Replace right with merged result while any marker remains, including a marker entered manually.
Exact scope
What the merge workspace does—and what it does not do.
Three-way merge is a Pro desktop feature for text sources. Text merges line-based rather than syntax-aware; JSON, YAML, TOML, and INI files merge by their data, with conflicts only where both sides changed the same value differently. Each of Base, Ours, and Theirs is limited to 500,000 lines.
Using the clean merge places it into the current right source in memory; it does not silently write the file. Comparison stays on the computer. Signed store builds may contact the Mac App Store or Microsoft Store for product, purchase, and entitlement checks, but the compared text is not sent to a cloud comparison service.
- macOS and Windows desktop app
- One-time Pro purchase required
- Text sources; JSON, YAML, TOML, and INI merged by their data
- 500,000 lines per source
- Explicit save after using the merged result
- git mergetool window on Windows, and on a Mac through the free command-line helper
Best for
Where this workflow fits.
- Merging two text versions that descended from the same common Base
- Reviewing automatically combined edits before accepting the result
- Resolving private source or configuration text without pasting it into a web service
No accounts, cloud comparison service, analytics, or telemetry.
Relevant capabilities
What Diff Anything brings to the job.
Practical workflow
From setup to a reviewed result.
Open Ours and Theirs
Open the two text sources in the normal comparison workspace. The current left source becomes Ours and the current right source becomes Theirs.
Select the common Base
Open Tools, choose Three-way merge, and select the text file that both versions started from.
Run and review the merge
Independent line insertions, replacements, and deletions combine automatically. Review those automatic choices as well as any conflicts.
Resolve each overlapping edit
Navigate the remaining conflicts, then choose Ours, Theirs, Ours then Theirs, Theirs then Ours, or Base—or edit the merged result directly. All ours, All theirs, and Reset handle bulk decisions without hiding what changed.
Use and save the result
Replace right with merged result stays unavailable while conflict markers remain. When the result is clean, it becomes the right source in memory; save that modified source explicitly when ready.
Useful in practice
Direct answers
Questions about three-way merge tool.
How does the Diff Anything three-way merge tool work?
Diff Anything Pro provides a local three-way merge workspace for text sources on macOS and Windows. Text merges line-based, also combining edits to separate words of the same line, and JSON, YAML, TOML, and INI files merge by their data, value by value. A file that already contains conflict markers opens straight into the workspace with Resolve, and git mergetool can open the merge in Diff Anything's window, on Windows directly and on a Mac through the free command-line helper. The current left source becomes Ours, the right source becomes Theirs, and you select their common Base. Focused diff views show each side against Base. Independent changes combine automatically; competing edits offer Ours, Theirs, Ours then Theirs, Theirs then Ours, and Base choices.
What is the difference between a two-way diff and a three-way merge?
A two-way diff compares Ours with Theirs. A three-way merge also uses their common Base, which identifies changes made independently on each side and exposes overlapping edits as conflicts.
Which file is Base, Ours, and Theirs in Diff Anything?
The selected common ancestor is Base, the current left text source is Ours, and the current right text source is Theirs. Diff Anything does not infer Git branch roles or select the Base automatically.
Does three-way merge work with JSON, folders, images, or PDFs?
JSON, YAML, TOML, and INI files are merged by their data, value by value, keeping your side's comments and formatting; Merge by data switches to a line merge. Other text is merged by lines. Folders, images, and PDFs use separate two-source comparison modes and cannot be inputs to the interactive three-way merge.
Can I resolve a file that Git left with conflict markers?
Yes. Open the file, choose Resolve, and its conflicts open in the merge workspace with every other line as Git merged it. Save resolved file writes it back in its own encoding and line endings. git mergetool can also open each conflicted file in Diff Anything's merge window.
Can I use it as git mergetool on a Mac?
Yes, with Pro and the free command-line helper. The Mac App Store version runs in Apple's App Sandbox and cannot read the files Git names on its own; the helper reads them, opens the merge in a window of the app, and writes the merged file when you choose Save & Close. On Windows, the Microsoft Store version is the merge tool itself.
Can Diff Anything save a merge with unresolved conflicts?
Not from the standalone workspace: Replace right with merged result is disabled while conventional conflict markers remain. After the result is clean, it replaces the current right source in memory and can then be saved explicitly. When resolving a file with conflict markers, or in the merge tool window, unresolved conflicts are saved with their markers only after a confirmation.
Is three-way merge free?
No. Three-way merge, resolving conflict markers, and the Git merge driver and merge tool are included with the one-time Diff Anything Pro purchase. Seeing how many conflicts a file has is free. Free desktop use can preview every comparison engine within the published size, collection, PDF-page, and daily-session limits; the free CLI supports text, JSON, and notebooks.
Does the merge upload source files?
No. The merge runs locally without an account, cloud comparison service, analytics, or telemetry. Signed store builds may contact the platform store for product, purchase, and entitlement checks.
Go deeper
Choose sources, understand automatic detection, and select the engine that answers the question you are actually asking.
Read Choose the right comparison modeFree & Pro: what’s included
Available on the Mac App Store and Microsoft Store. Free desktop use lets you try every comparison engine for files up to 5 MiB per side and 10 new comparison sessions per local day; collection previews show the first 100 items, binary comparisons the first 100 byte differences, and PDF previews the first 3 pages. Plain text, JSON, and Jupyter notebook comparison are complete, and opening files from Finder or File Explorer, diffanything:// links, and AppleScript are free. The free CLI supports text, JSON, and notebooks, and the command-line helper that brings the CLI to the Mac App Store version is a free download that uses the Pro purchase made in the app. A one-time Pro purchase removes the preview and session limits and unlocks larger sources within technical limits, saved profiles and history, saving folder snapshots, report export and printing, JSON Patch export, applying patches, three-way merge and conflict resolution, the Git merge driver and merge tool, folder synchronization, batch manifests, every CLI mode, and, on Windows, trusted preprocessors.