My Tools Garage

JSON Merge

Deep-merge two JSON documents into one.

in-browser

How to use

  1. 1 Paste your base JSON into Document A.
  2. 2 Paste the overriding JSON into Document B.
  3. 3 Choose deep or shallow merge and how arrays should combine.
  4. 4 Copy the merged JSON from the result panel.

About JSON Merge

JSON Merge combines two JSON documents into a single result, with the second document overriding the first wherever they overlap.

It is the operation you reach for when layering a base configuration with environment-specific overrides, merging default settings with user preferences, or stitching together API responses and fixtures.

You decide how the merge behaves.

Deep merge walks into nested objects and combines them key by key, so a change to one field deep inside a structure does not wipe out its siblings; turning deep merge off gives you a shallow override where a top-level key is replaced wholesale.

Arrays get their own control: "Replace" swaps the base array for the override's, while "Concatenate" appends the two together, which is handy for accumulating lists.

Scalar values always follow the last-wins rule.

Each document is parsed and validated as you type, and if one is malformed you get a precise message naming which document failed and why, instead of a silent wrong answer.

The merged output is pretty-printed and ready to copy.

Everything runs locally in your browser — no JSON is uploaded or stored — so it is safe for configuration files and payloads that contain sensitive values, and it keeps working without a connection.

FAQ

Which document wins when keys conflict?

Document B, the override, always wins for conflicting keys. With deep merge on, only the overlapping nested keys are replaced; other keys are preserved.

How are arrays handled?

You choose. "Replace" uses the override's array in place of the base array, while "Concatenate" joins both arrays end to end.