Skip to content
Trexmi
Converter Ready

JSON Merge

Merge 2 JSON documents online with recursive object merging, selectable conflict priority and replace, append or unique array strategies.

Recursive object merge Left or right conflict priority Conflict error mode Array replace
Objects are merged recursively. Scalar conflicts and arrays follow the selected strategies.
INPUT Developer source value *
0 chars0 words0 lines
Paste the base JSON document. Object properties are merged recursively with the second document. Example: {"name":"Trexmi","settings":{"theme":"dark"},"tags":["json"]}
Merged JSON Combined JSON using the selected conflict and array strategies.
About the tool

What JSON Merge does

JSON Merge combining two JSON documents

JSON Merge combines two valid JSON documents into one result. It is designed for configuration overlays, API fixture preparation, localization files, environment settings and other tasks where a base document must be combined with an update. Objects are merged recursively, while scalar conflicts and arrays follow the options selected in the workspace.

This free JSON Merge tool makes the merge rules explicit. You can prefer values from the second document, keep values from the first document or stop when incompatible values meet. Arrays can be replaced, appended in order or appended with duplicate values removed. The result remains valid JSON and is displayed separately from both sources so it can be reviewed before copying.

JSON Merge table of contents

How to use

  1. Paste the base JSON into the first source field. This can be an object, array or another valid JSON value.
  2. Paste the update JSON into the second source field and confirm that both documents are valid.
  3. Choose whether conflicts should use the second value, keep the first value or stop with an error.
  4. Select Replace, Append or Append unique for arrays, then run JSON Merge.
  5. Review the merged output with JSON Compare or format it with the JSON Formatter before deployment.
Built for the task

Why use JSON Merge?

Focused controls, predictable output, and a workflow designed around this exact transformation.

01

Merge nested objects recursively

Nested object properties are combined at each level instead of replacing the entire parent object unnecessarily.

02

Control every value conflict

Choose right priority, left priority or error mode so the merge behavior matches a configuration or data workflow.

03

Choose how arrays are combined

Replace arrays, append both arrays in order or append only values that are not already present.

04

Review output before using it

The merged JSON remains separate from the two sources and can be copied only after you inspect the result.

Useful answers

Questions about JSON Merge

Practical details about input, output, privacy, limits, and the best way to use this tool.

Answer 01

What does JSON Merge do?

JSON Merge combines two valid JSON values. Objects are merged recursively, while value conflicts and arrays follow the selected options.

Answer 01

What does JSON Merge do?

JSON Merge combines two valid JSON values. Objects are merged recursively, while value conflicts and arrays follow the selected options.

How JSON value conflicts are handled

A conflict occurs when the same property path exists in both documents and the values cannot be recursively combined as objects. Right-priority mode uses the value from the second JSON and is useful for overrides. Left-priority mode preserves the original value. Error mode stops instead of choosing automatically, which is safer when silent replacement could hide a configuration problem.

Replace, append or uniquely append arrays

Array replacement treats the second array as the complete new value. Append mode concatenates both arrays and preserves duplicates. Unique append adds values from the second array only when an equivalent value is not already present. Arrays of complex objects may still require domain-specific identity rules, so review them carefully rather than assuming that two objects with different key order represent different records.

Common JSON Merge errors

Both sources must be complete valid JSON. JavaScript object syntax with unquoted keys, comments, single-quoted strings or trailing commas is not valid JSON. Error conflict mode can also stop a valid pair of documents intentionally when scalar values disagree. Large differences may be easier to understand after formatting both inputs first.

JSON Merge best practices

Keep a copy of the original documents, define the conflict rule before merging and avoid using array append when order or duplicates carry business meaning. Validate the final document with the JSON Validator. Use JSON Diff Viewer to inspect changes, and consult the official JSON specification RFC 8259 when input syntax is unclear.