JSON Merge Tool
Deep-merge two JSON objects — nested keys combine, arrays and scalars override.
- 100% client-side · your data never leaves your browser
- Instant, no rate limits
- Free, no sign-up
Paste two JSON documents to merge.
Overview
JSON Merge Tool — Deep Merge Two JSON Objects
Merge two JSON documents with deep (recursive) object combining. Nested keys merge instead of replacing the whole branch; scalar and array values from the second document override the first. Perfect for layering config defaults with environment overrides, combining feature flags, or prototyping patch semantics — all locally in your browser.
How deep merge works
When both sides are objects at the same key, merge recurses into children. When types differ or the second value is not an object, the second document wins. Arrays are replaced entirely rather than concatenated — matching common config-overlay patterns.
Config defaults and overrides
The classic use for deep merge is layering configuration: start with a base document of defaults and merge an environment-specific overlay on top. Keys present only in the base are kept, keys in the overlay win, and nested sections combine instead of being wiped out — the same model used by Helm values, application settings, and feature-flag layering.
Merge vs JSON Patch
Merge is a declarative overlay: paste a base and an overlay and get the combined result. JSON Patch (RFC 6902) is operation-based — add, remove, replace — and is designed for versioned API updates. Use merge for quick config composition; generate a patch from the Compare tool when you need an auditable list of changes.
How arrays are handled
Arrays are replaced whole, not concatenated or merged element-by-element. This matches how config overlays usually behave: if an override specifies a list, it means 'use exactly this list.' If you need element-level array changes, use the Compare tool's JSON Patch output instead.
FAQ
Frequently asked questions
How do I merge two JSON objects?
Paste a base document and a second document; JsonDrift deep-merges them so nested objects combine and the second document's values win on conflicts.
Are arrays merged element-wise?
No. The second JSON's array replaces the first at that key, matching common config-overlay semantics.
Which document takes priority?
The second (overlay) document wins wherever the two conflict; keys unique to the base are preserved.
What if one input is invalid?
Both documents must be valid JSON. Run them through the JSON Validator or JSON Repair tool first.
Continue with a related tool
All tools- JSON Editor
Write, edit, format, minify, and validate JSON in a fast full-screen or embedded editor.
- JSON Escape & Unescape
Escape or unescape strings for code, logs, and API payloads.
- JSON Flattener
Flatten nested JSON into a single-level object with dot or underscore keys.
- JSON Formatter & Beautifier
Format, prettify, and beautify messy JSON with configurable indentation and key sorting.
- JSON Key Sorter
Sort object keys alphabetically — recursively for stable, readable JSON.
- JSON Minifier
Compress JSON by removing whitespace to shrink payloads and speed up transfers.