JSON Merge — Deep Merge Two JSON Documents Online
Combine a base JSON document with an overlay using deep or shallow merge. The result updates automatically — control arrays, null handling, and conflict resolution with a live conflict preview.
Developer notes
• Both documents must be valid JSON. • Automatic merge — the result updates when both inputs are valid (debounced) and when you change options; no Merge button. • B wins is the default conflict strategy: overlay values override base scalars. • Error on conflict blocks output and lists conflicting JSON paths. • Union by key merges arrays of objects like a database upsert on `id`. • Ignore nulls skips null values from the overlay — useful for sparse patches. • This is not RFC 7386 Merge Patch — the tool outputs a merged document, not a patch file. • After merging, use JSON diff to verify against your expected baseline.
JSON merge options
When teams pick this route
• Merge environment config (base + staging overlay). • Combine package.json overrides. • Stitch partial API responses. • Apply feature-flag deltas to a defaults file.
Worked examples
Deep merge config
Base (A)
Overlay (B)
Array concat
Base (A)
Overlay (B)
Navigate related JSON tools
Compare merged output in JSON diff. Normalize key order first with JSON sort. Validate with the JSON validator, fix syntax with JSON repair, or browse the JSON tools hub.
JSON merge FAQ
Merge vs diff, arrays, and nulls
Do I need to click Merge?
No. The merged JSON updates automatically when both documents are valid and whenever you change merge options.
How is JSON merge different from JSON diff?
JSON diff highlights differences between two documents. JSON merge produces a single combined document using your depth, array, and conflict rules.
Which document wins on conflicts?
By default the overlay (document B) wins on scalar conflicts. You can switch to base wins or error on conflict.
What is shallow vs deep merge?
Deep merge combines nested objects key by key. Shallow merge replaces entire nested objects and arrays from the overlay.
How are arrays handled?
Choose replace (default), concat, concat unique, or union by key for arrays of objects.
What happens when the overlay contains null?
Ignore nulls (default) skips overlay nulls. Merge nulls writes null; delete on null removes the key from the result.
Do you support three-way merge?
No — this tool merges exactly two JSON documents (base + overlay).
Is this JSON Merge Patch (RFC 7386)?
No. The output is a merged JSON document, not an RFC 7386 patch operations file.
JSON Tools
Validate, format, diff and explore JSON payloads — complementary to minifiers and converters.
Explore other tool categories
Minify
Shrink code and assets for production — minify JavaScript, CSS, HTML, JSON and XML before gzip or CDN deploy.
Beautify
Make code readable with consistent indentation — beautify JavaScript, CSS, TypeScript, SCSS, LESS, Markdown, GraphQL, SQL, YAML and more in your browser.
Unminify
Expand minified or compressed code — unminify JavaScript, CSS, TypeScript, SCSS, LESS, SQL, YAML and other formats when debugging or reviewing.
Conversion
Transform data between JSON, YAML, XML and CSV locally — no server uploads.
CSS preprocessors
Compile SCSS or LESS to standard CSS in the browser — pair with beautify or minify for a full stylesheet workflow.
SVG Tools
Preview, optimize with SVGO, export Data URI, resize, beautify, convert to JSX and validate SVG — all in your browser.
DevOps & Infra
Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.
CI/CD
GitHub Actions and GitLab CI — format YAML and check workflow/job structure in your browser.
Logs & observability
Line-oriented JSON/NDJSON and Nginx/Apache access logs — format, filter, validate, and CSV/TSV.
Kubernetes
Multi-doc manifests, structural validate, Ingress/Deployment starters, and Helm values formatting.
Networking / IP
CIDR, subnets, and IPv4/IPv6 helpers — in your browser.
Security & tokens
JWKS, X.509 certificates, and secrets scan — browser-local.
API & schemas
OpenAPI tools to format, validate, and lint your specs.
Encoding
Encode or decode Base64, URL components and HTML entities — client-side only.
Developer utilities
Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugify, number bases, case, text diff, and chmod — all client-side.
Text & Markdown
Count words, build Markdown TOCs, and clean line lists — all in your browser.
Serialization
Serialize and deserialize PHP data structures beside JSON workflows.