Skip to content
Toolwright

JSON Merge (Three-Way)

JSON Merge combines two edited copies of a JSON file with the original they came from, the way git merges code. Changes to different keys combine, key order is kept and conflicts are listed with their paths. Nothing is uploaded.

Tool 057 · Developer
Outside requests …How to checkRuns on this deviceWorks offline once opened

How to use JSON Merge (Three-Way)

  1. Paste the original JSON into Base, then your edited copy and the other person's copy.
  2. Choose which side wins a conflict, and how arrays should be treated.
  3. Copy the merged JSON, and read the conflict list for anything both of you changed.

Frequently asked questions

Why does it need the original (base) as well as the two edits?

With only two versions you cannot tell who changed what. The base shows which side touched each value, so a change made by one person is simply accepted, and only values both of you changed differently are conflicts.

Is my JSON uploaded?

No. It is merged in your browser, and this tool keeps it out of shareable links, since configuration files often hold secrets.

How are arrays merged?

Your choice. “Treat as one value” takes whichever side changed the array and reports a conflict if both did. “Combine as a set” keeps additions from both and drops anything either side removed. “Match items by a property” pairs up objects with the same id (or another property) and merges each pair.

Does key order matter?

It is kept. If only one side reordered the keys of an object, that order is used. If both did, the side you choose wins. Keys added by the other side go right after the key that precedes them there.

What are the limits?

It reads standard JSON, so comments and trailing commas are errors. Numbers beyond JavaScript's precision (above 9 quadrillion) lose digits, and if a key appears twice in one object the last one is used.

Next step

Just need to see the differences? Compare the two files. Open JSON Diff.

  1. 055

    JSON Diff

  2. 056

    JSON Formatter & Validator

  3. 062

    JSONPath Tester

  4. 058

    JSON Schema Generator