JSON 3-Way Merge
Merge two edited JSON versions against a common base and resolve conflicts.
- 100% client-side · your data never leaves your browser
- Instant, no rate limits
- Free, no sign-up
Paste three versions — the common base, your edits, and theirs. Non-conflicting changes from both sides are combined automatically.
Overview
JSON 3-Way Merge Online — Base, Mine & Theirs
Merge two edited versions of a JSON document against their common ancestor, exactly like a version-control merge. Paste the base (the original), mine (your edit), and theirs (someone else's edit), and JsonDrift combines every non-conflicting change automatically, flags real conflicts where both sides changed the same key to different values, and lets you resolve each conflict by choosing a side. It is the tool for merging config files, translation bundles, and API fixtures that two people — or two branches — edited in parallel. As with every JsonDrift tool, all three documents stay in your browser.
What is a three-way merge?
A two-way merge only sees the final versions, so it can't tell whether a differing value is a deliberate change or untouched original. A three-way merge adds the common ancestor (the base), which lets it reason about intent: if only one side changed a key, that change wins automatically; if both sides made the same change, they agree; only when both sides changed the same key to different values is there a genuine conflict.
This is the same algorithm Git uses for source files — but Git merges text lines, which is noisy and error-prone for JSON. Reordered keys, re-indented blocks, or one-line documents produce spurious line conflicts. Merging structurally, key by key, eliminates that noise entirely.
How JsonDrift resolves changes
- Changed on one side only — applied automatically, no conflict
- Same change on both sides — applied once, no conflict
- Added on both sides with equal values — kept, no conflict
- Changed to different values on both sides — flagged as a conflict
- Deleted on one side, modified on the other — flagged as a conflict
- Per-conflict resolution: pick 'mine' or 'theirs' for each conflicted path
- Result preview updates instantly as you resolve
When you need a JSON three-way merge
Git merge conflicts in JSON files: package.json, tsconfig.json, translation files (en.json and friends), and CI config are the classic offenders. Copy base, mine, and theirs out of your merge tool, merge structurally here, and paste the clean result back.
Parallel config edits: two environments or two teammates edited the same deployment config from a shared original. A three-way merge combines both sets of changes without anyone's work being overwritten.
Content and data workflows: two exports of the same dataset were edited independently — merge them against the original export instead of manually reconciling.
Three-way merge vs deep merge
JsonDrift's JSON Merge tool performs a deep merge of two documents: the second document's values win wherever both define a key. That is the right tool for layering overrides — defaults plus environment config, for example.
A three-way merge is different: neither side automatically wins. The base version arbitrates, so both sides' intentional changes survive and only true collisions need a human decision. Use deep merge for layering; use three-way merge for reconciling parallel edits.
Getting the base, mine, and theirs from Git
During a conflicted merge, Git keeps all three versions in the index. Extract them with: git show :1:path/to/file.json > base.json (common ancestor), git show :2:path/to/file.json > mine.json (your branch), and git show :3:path/to/file.json > theirs.json (incoming branch). Paste each into the matching pane, resolve any conflicts, and copy the merged result back into the file.
Private, like every JsonDrift tool
All three documents are parsed and merged locally in your browser. Nothing is uploaded, so merging production configuration or customer data is safe.
FAQ
Frequently asked questions
What counts as a conflict in a JSON three-way merge?
A conflict occurs when both sides changed the same path to different values relative to the base — including one side deleting a key the other side modified. Changes that only one side made are merged automatically without a conflict.
How is this different from Git's merge?
Git merges text lines, so reordered keys, re-indentation, or minified JSON cause spurious conflicts. JsonDrift merges the parsed structure key by key, which ignores formatting entirely and only conflicts on real value collisions.
How do I resolve a conflict?
Each conflicted path is listed with both values. Choose 'mine' or 'theirs' per conflict and the merged result updates instantly. When every conflict is resolved, copy or download the result.
Can it merge arrays?
Yes. Arrays are compared as values: if only one side changed an array it wins automatically, and if both sides changed it differently the array is flagged as a conflict for you to resolve. For element-level array edits, generate and apply a JSON Patch instead.
Is my JSON uploaded during the merge?
No. The base, mine, and theirs documents are all processed in your browser. Nothing is sent to a server.
Continue with a related tool
All tools- JSON Patch Applier
Apply an RFC 6902 JSON Patch or RFC 7396 Merge Patch to a document and get the result.
- JSON Patch Generator
Generate RFC 6902 JSON Patch or RFC 7396 merge patch between two JSON documents.
- JSON Compare & Diff
Compare two or more JSON files and spot structural and value differences instantly.
- JSON Merge Tool
Deep-merge two JSON objects — nested keys combine, arrays and scalars override.
- AI JSON Cleaner
Smart cleanup — remove nulls, empty strings, trim whitespace, drop empty objects.
- AI JSON Explainer
Human-readable summary of JSON structure and field meanings from naming patterns.