Free · No sign-up · Runs in your browser

Merge JSON Files Online

Combine two or more JSON files into one. Merge nested objects, append or replace arrays, and decide how conflicting values are handled. Your JSON stays in your browser.

JSON MERGE TOOLCombine JSON files your way—choose how nested fields, arrays and duplicates are handled.
Processed in your browser
2 JSON inputs0.3 KB used · 20 MiB maximum
Input 1
Input 2
Up to 10 inputs · 10 MiB per file · 20 MiB combined
Merge options Choose what happens when your files contain the same fields

Deep Merge combines fields inside nested objects. If all your files contain arrays, choose whether to append or replace them. Append keeps duplicates. When values conflict, choose whether to keep the earlier or later one.

Merged JSON Output.json
Your combined JSON will appear here after you click Merge JSON.
JSON stays in your browser No sign-up required Copy or download merged.json
01

What Is a JSON Merge Tool?

A JSON merge tool combines information from two or more JSON documents into one result. It is useful when you need to bring together configuration files, API responses, exported records or separate data sets without manually copying each property.

This JSON merger lets you choose how nested objects, arrays and fields with the same name are handled. It works with JSON objects and arrays. You can also keep each file as a separate item in one array rather than mixing their contents together.

02

How to Merge JSON Files Online

01

Add your JSON inputs

Paste JSON into the editors, upload .json files, or add more inputs. You can combine up to 10 files at a time.

02

Choose merge rules

Select Deep or Shallow Merge, decide whether arrays are appended or replaced, and choose which input wins when values conflict.

03

Merge and save the result

Click Merge JSON, review the formatted output, then copy it or download merged.json.

03

Merge JSON Objects Example

Use Deep Merge when your files contain different details inside the same nested object. Fields found in only one file are kept. If a field appears in both, choose which value should win.

JSON INPUT 1
{
  "user": {
    "name": "Ada",
    "age": 25
  },
  "tags": [
    "developer",
    "json"
  ],
  "settings": {
    "theme": "dark",
    "notifications": true
  }
}
JSON INPUT 2
{
  "user": {
    "email": "ada@example.com",
    "age": 26
  },
  "tags": [
    "tools"
  ],
  "settings": {
    "language": "en"
  }
}
DEEP MERGE OUTPUT
{
  "user": {
    "name": "Ada",
    "age": 26,
    "email": "ada@example.com"
  },
  "tags": [
    "developer",
    "json",
    "tools"
  ],
  "settings": {
    "theme": "dark",
    "notifications": true,
    "language": "en"
  }
}

In this example, the user and settings objects are combined field by field. The age field takes the value from Input 2 because Right Input Wins is selected. The tags arrays are appended in input order.

04

Deep Merge vs Shallow Merge

Deep Merge looks inside nested objects and combines their properties. Shallow Merge only combines the top-level properties. If a top-level key exists in both inputs, its entire value is kept or replaced as a whole.

Deep Merge

{
  "user": {
    "name": "Ada",
    "age": 26,
    "email": "ada@example.com"
  },
  "tags": [
    "developer",
    "json",
    "tools"
  ],
  "settings": {
    "theme": "dark",
    "notifications": true,
    "language": "en"
  }
}

Nested fields such as user.name and user.email remain together.

Shallow Merge

{
  "user": {
    "email": "ada@example.com",
    "age": 26
  },
  "tags": [
    "developer",
    "json",
    "tools"
  ],
  "settings": {
    "language": "en"
  }
}

The later user object replaces the earlier user object as a whole.

BehaviorDeep MergeShallow Merge
Top-level propertiesCombinedCombined
Nested objectsCombined field by fieldReplaced or kept as one value
Conflicting values (text, numbers or booleans)Uses your selected priorityUses your selected priority
Arrays at the same fieldAppend or replaceAppend or replace
05

How to Merge JSON Arrays

If all your files contain JSON arrays, choose Append to join their items or Replace to keep just one array. This also works for arrays stored under the same field in two objects.

APPEND
Input 1: [1, 2]
Input 2: [3, 4]

Result:  [1, 2, 3, 4]

Preserves all items in input order. Duplicate values are not removed.

REPLACE · RIGHT INPUT WINS
Input 1: [1, 2]
Input 2: [3, 4]

Result:  [3, 4]

Uses the selected conflict rule to keep one of the two arrays.

Append does not match array objects by an id field, merge records with the same ID or remove duplicates. It simply adds the second array's items after the first.

06

How JSON Merge Handles Conflicting Keys

If two files contain the same field with different values, choose which one to keep. Right Input Wins keeps the later value; Left Input Wins keeps the earlier value. Nested objects can still be combined when you use Deep Merge.

InputsRight Input WinsLeft Input Wins
{ "theme": "light" }
{ "theme": "dark" }
darklight
{ "enabled": false }
{ "enabled": true }
truefalse
{ "value": null }
{ "value": 1 }
1null

With multiple inputs, the selected rule is applied in the order the inputs appear. Under Right Input Wins, later inputs have priority. Under Left Input Wins, the first value is retained when a conflict is encountered.

07

Merge JSON Objects vs Combine JSON Arrays

Choose the result that fits your task. Merge into One JSON combines properties from JSON objects, or joins arrays according to your chosen setting. Combine into Array keeps each complete input as one item, even when the inputs have different types of JSON.

Merge into One JSON

{
  "id": 1,
  "name": "Ada",
  "active": true
}

Best when you want one object containing the combined properties.

Combine into Array

[
  { "id": 1, "name": "Ada" },
  { "active": true }
]

Best when you need to preserve each source document as a separate array item.

If your files contain different kinds of JSON, such as an object and an array, choose Combine into Array. Merge into One JSON requires all inputs to be objects or all inputs to be arrays.

08

JSON Merge vs JSON Compare and Merge Patch

JSON Merge and JSON Compare solve different problems. Merge creates one output from multiple inputs. Compare shows what changed between two JSON documents without combining them. Use JSON Compare when you need to inspect added, removed or changed values.

Tool or standardPurposeOutput
JSON MergeCombine JSON documents using merge rulesOne JSON object or array
JSON CompareFind differences between two JSON documentsSide-by-side diff and change report
JSON Merge Patch (RFC 7396)Describe partial updates to a JSON documentA merge-patch document

This page does not generate JSON Patch or JSON Merge Patch documents. It is designed for combining JSON data, not for expressing API update operations.

09

Common JSON Merge Problems and Fixes

If a merge does not produce the result you expected, check the input type and selected rules before changing the data. These are the most common situations:

What happened?Why?What to do
Object and array inputs cannot mergeMerge into One JSON needs files to contain the same kind of JSONChoose Combine into Array to preserve each document
A nested field disappearedShallow Merge treats a matching top-level value as a wholeChoose Deep Merge to combine nested objects
Array items are repeatedAppend keeps duplicates and does not match records by IDRemove duplicates separately, or select Replace when appropriate
An earlier value was replacedRight Input Wins prioritizes later inputsSelect Left Input Wins if earlier values should take priority
An input cannot be parsedJSON requires double-quoted keys and strings, without trailing commasCheck the input with the JSON Validator

Input order matters: with three files, the third file is considered after the first two. Make sure each input contains valid JSON before merging.

10

Missing Fields, Null Values and Type Changes

A missing key and a key set to null are different. A missing key leaves the other input's field available; null is an explicit JSON value that can win or lose a conflict. The same conflict rule applies when a field changes from a string to a number, or from an object to a string.

MISSING FIELD
Input 1: { "name": "Ada", "city": "Paris" }
Input 2: { "name": "Ada" }

Result: { "name": "Ada", "city": "Paris" }

The second input has no city field, so city is retained.

EXPLICIT NULL · RIGHT INPUT WINS
Input 1: { "city": "Paris" }
Input 2: { "city": null }

Result: { "city": null }

Here, null replaces the earlier city value because it is present in Input 2.

Deep Merge combines fields inside two nested objects only when both files contain an object at that position. It does not automatically convert incompatible data types. Review the result when your sources use different types for the same key.

11

When to Merge JSON Files and When Not To

Merge JSON files when you need to combine settings from separate documents, bring together complementary fields in exported records, or join JSON objects that share a common structure. Deep Merge is usually helpful for nested settings; Shallow Merge is useful when an entire property from one source should take priority.

Combining arrays does not join records by a shared ID. For example, appending[{"id":1,"name":"Ada"}] and[{"id":1,"role":"editor"}] produces two array items, not one enriched record. If you need to match records by ID, deduplicate items, or calculate differences before merging, that is a different operation. Use JSON Compare to inspect differences first.

12

Privacy and Input Limits

Your JSON is processed locally in your browser. Your files and merged result are not uploaded to our server. We don't include your JSON contents or file names in usage analytics.

You can merge up to 10 inputs at once. Each file can be up to 10 MiB, with a combined limit of about 20 MiB. Very large or deeply nested files might not merge. If that happens, try smaller files.

FAQ

Frequently asked questions

How do I merge two JSON files online?

Paste your JSON or choose files, select how to combine nested objects and arrays, then click Merge JSON. Copy the result or download it as merged.json. The merge runs in your browser.

Can I merge multiple JSON files into one?

Yes. Add more JSON inputs or select several .json files at once. You can merge up to 10 JSON inputs in one operation. The order matters: later inputs are applied after earlier inputs when Right Input Wins is selected.

How do I merge two JSON objects?

Choose Merge into One JSON, then use Deep Merge to combine fields inside nested objects. If the same field has different values, the selected conflict rule decides which value remains.

What is the difference between deep merge and shallow merge?

Deep Merge combines fields inside nested objects. Shallow Merge only combines the first level, so a nested object from one file replaces the other unless you choose to keep the earlier value.

How are conflicting JSON keys handled?

Right Input Wins is the default: a later value replaces an earlier conflicting value. Choose Left Input Wins to keep the first value. Non-conflicting object properties are retained in either mode.

Can I merge JSON arrays?

Yes. When each file contains an array, Append adds its items in file order. Replace keeps one array according to the conflict rule. For arrays inside objects, the same setting applies when both inputs contain an array at that field. Append does not remove duplicates or match objects by ID.

Does JSON Merge overwrite existing values?

It can. With Right Input Wins, a later conflicting value replaces an earlier value. With Left Input Wins, the earlier value stays. Deep Merge still combines non-conflicting nested object properties.

Is JSON Merge the same as JSON Merge Patch?

No. This tool combines JSON documents using object, array and conflict rules. JSON Merge Patch is a separate standard for describing partial updates to a JSON document, defined by RFC 7396. It is not intended for creating or applying JSON Merge Patch updates.

Why can't I merge a JSON object with an array?

To merge directly, your files must all contain JSON objects or all contain JSON arrays. If one input starts with an object and another starts with an array, choose Combine into Array to preserve both documents as separate items.

Does JSON Merge remove duplicate items from arrays?

No. Append arrays keeps every item, including duplicates and objects with the same ID. Replace arrays keeps one complete array according to the conflict rule; neither option removes duplicate items.

What happens when a field is missing or its value is null?

A missing field does not erase a field in another input. A field explicitly set to null is a value: if the same key exists in both inputs, Right Input Wins or Left Input Wins determines whether null or the other value remains.

Is my JSON uploaded to a server?

No. Pasted JSON and selected files are read and merged in your browser. The contents of your JSON inputs and merged result are not sent to our servers.