All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Audio Tools Font Tools Image Tools Subtitle Tools Video Tools
Archive Tools Document Tools Ebook Tools File Management Tools PDF Tools Presentation Tools
Config Tools Database Tools Dataset Tools JSON Tools Parser Tools Spreadsheet Tools XML Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

JSON Merge Tool

Merge two or more JSON object or array documents locally with explicit shallow or recursive deep-merge rules - choose precedence for conflicts, a null policy, and array handling (replace, concatenate, union, or merge by key) globally or per path. Every conflict and the full output tree are shown before export.

Drop JSON files here

or (two or more required)

.json - each file must be a single valid JSON object or array

2. Merge rules

Per-path array overrides (optional)

Path uses dot notation from the root, e.g. items or a.b.list (no index needed - the override applies to the whole array at that path).

PathHandlingKey field (for "merge by key")

How to merge JSON files

Add at least two valid JSON documents, choose the root type, and set the rules for conflicts, nulls, and arrays. The result appears in the Output tree. Every recorded conflict includes its candidate values and the rule that selected the result.

How to merge JSON files with the controls

  1. Drop JSON files here or click browse files. Add two or more .json files, each containing one valid object or array.
  2. Paste another document into the text area, optionally fill Document name (optional), and click Add document.
  3. Select Object root (merge as key/value maps) or Array root (merge as top-level arrays). The documents must match the selected root type.
  4. Choose Deep (recursive merge at every level) or Shallow (top-level keys only), then set Precedence for scalar & type conflicts and Null policy.
  5. Set Global array handling. If you choose Merge by key, enter Global array merge key field. Add a path override when one array needs a different rule.
  6. Review the Output tree and Every conflict & resolution. Then click Export merged JSON or Export merge report (JSON).

What deep merge JSON changes

Deep mode combines nested objects key by key. Shallow mode combines top-level keys, then treats a conflicting nested object as one value. With Last document wins, these inputs produce different results:

Document 1: {"profile":{"name":"Mina","role":"editor"}}
Document 2: {"profile":{"role":"admin","team":"data"}}

Deep:    {"profile":{"name":"Mina","role":"admin","team":"data"}}
Shallow: {"profile":{"role":"admin","team":"data"}}

How JSON array merge options work

Global array handling supplies the default for every array. A per-path override takes precedence at its exact dot-notation path, such as items or a.b.list. The tool does not validate that the path exists before merging.

  • Replace keeps the array chosen by precedence.
  • Concatenate appends arrays in source order.
  • Union removes duplicates by deep value equality.
  • Merge by key combines object items that contain the configured field. Items without that field stay in source order.

When Merge by key has no key field, the tool falls back to Replace and records an array-key-merge-missing-key conflict.

JSON merge errors and edge cases

Malformed JSON is rejected when it is added. The error can include a line and column. A top-level scalar is rejected because each source must be an object or array. A root-type mismatch blocks the merge, and the tool does not wrap the document. At least two valid documents are required.

Null is a value includes null in normal conflict resolution. Null means absent ignores null when another source has a real value, then keeps null when every source has null. Candidate values longer than 200 characters are shortened in the conflict display and report.

Examples of JSON Merge Tool use

  • A developer combines base settings with an environment document. Deep mode keeps non-overlapping nested keys while precedence resolves repeated values.
  • A data analyst combines record arrays with Merge by key, checks matched objects in the Output tree, and exports the merged JSON.
  • A reviewer uses the conflict report to inspect candidate values before sharing the exported merge report.

Choose rules before exporting

Use JSON Merge Tool when object or array documents need named merge rules and conflict inspection. The parent JSON Merge Tools category lists other JSON merging workflows. Files are read in the browser, and the merged JSON and report are created as downloads.

Frequently asked questions

How do I merge two JSON files?

Add two valid JSON documents with Drop JSON files here, browse files, or the paste area. Choose the root type and merge rules. The merge runs automatically when at least two documents are valid and their root types match the selected mode.

Should I use deep or shallow JSON merge?

Use Deep (recursive merge at every level) when nested objects should combine by key. Use Shallow (top-level keys only) when a conflicting nested object should be selected as a whole by precedence.

Can I merge JSON arrays?

Yes, choose Array root (merge as top-level arrays) when every document has an array root, or select an array rule for arrays inside object documents. Replace, Concatenate, Union, and Merge by key produce different results.

How does JSON Merge Tool handle null values?

Null is a value lets null compete in normal conflict resolution. Null means absent ignores null when another document supplies a real value and keeps null only when all sources have null at that path.

Does JSON Merge Tool upload my files?

The page makes no upload request for the documents. Files are read in the browser, and the merged JSON plus merge report are created as local downloads.

Related Tools

45 views