Merge JSON files online, instantly.
The free, private way to combine multiple JSON files and merge JSON objects into one. Deep merge, array strategies, live validation, and one-click download — everything runs in your browser.
No signup · No uploads · Free forever
Drop JSON files here, or click to browse
Add two or more .json files — reorder to control merge precedence
Result
Why Merge JSON
Everything the other mergers leave out.
Most online JSON mergers give you a single button and hope for the best. Merge JSON gives you the controls real data work needs — without ever touching a server.
Two ways to merge
Drop multiple .json files, or paste snippets into a live editor. Reorder inputs to control which source wins.
Real merge control
Deep or shallow merge, array concat / union / replace / by-key, conflict resolution, de-dupe, and key sorting.
Instant validation
Each input is checked as you type. Syntax errors surface the exact line and column before you merge.
Pretty or minified
Copy formatted JSON, copy a one-liner, or download .json and .min.json — all from the result panel.
100% private
Everything runs in your browser with no uploads, no servers, and no tracking. Your data never leaves the device.
Built for developers
Keyboard shortcut to merge (⌘/Ctrl + Enter), byte counts, node stats, and large-file friendly parsing.
Merge JSON files online — free, fast, and private
MergeJSON is a free online tool to merge JSON files directly in your browser. Whether you need to combine two configuration files, stitch together several API responses, or consolidate translation catalogs, our JSON merger lets you combine multiple JSON files into one clean, valid document in seconds. There is no signup, no software to install, and no upload — because every byte is processed locally, the tool is both the fastest and the most private way to merge JSON files online.
Most people who search for how to combine JSON files end up hand-editing them in a text editor, copying braces around and hoping they did not break the syntax. MergeJSON removes that risk entirely. Drop in your files, choose how they should combine, and download the result. It is a genuinely free way to merge JSON files with no usage limits and no catch.
How to combine JSON files in three steps
Learning how to combine JSON files with our tool takes under a minute:
- Add your JSON. Drag and drop two or more
.jsonfiles into the merge tool, or switch to the code editor and paste your snippets to merge JSON without creating files at all. - Choose your options. Pick a deep or shallow merge, select an array strategy, and decide which file wins when keys conflict — full control over how you combine JSON data.
- Merge and export. Press merge, then copy the
output or download it as
merged.jsonormerged.min.json.
Merge JSON objects with complete control
Combining data is rarely as simple as gluing two files together. When
you merge JSON objects, nested structures and arrays
need real handling. That is why MergeJSON exposes the options other
tools hide: a deep merge recursively combines nested
objects so nothing is lost, while a shallow merge replaces top-level
keys. Arrays can be concatenated, de-duplicated into a union,
replaced, or merged by a key such as id — so you can
combine JSON records intelligently rather than just
appending them. You can also sort keys alphabetically and remove
duplicate array items for a clean, diff-friendly result.
Common reasons to combine JSON data
Developers reach for a tool to merge JSON in all
kinds of situations. Backend engineers layer a base configuration with
environment-specific overrides. Frontend teams combine JSON
data from several feature-flag files. API developers merge
paginated or multi-endpoint responses into a single dataset.
Localization engineers consolidate dozens of language files —
en.json, fr.json, de.json — into
one catalog. QA engineers assemble test fixtures from smaller
fragments, and data analysts combine JSON files before
loading them into a pipeline. Whatever the source, the goal is the
same: turn many JSON documents into one correct, predictable result
without losing data along the way.
Merge JSON in JavaScript, Python, or the terminal
If you would rather script the merge, here are the standard approaches — along with the traps each one hides. The tool above exists because these traps are easy to miss.
JavaScript — the shallow-merge trap. Spread and Object.assign are what most people reach for, and both are shallow:
const a = { db: { host: "localhost", port: 5432 } };
const b = { db: { port: 6543 } };
const merged = { ...a, ...b };
// { db: { port: 6543 } } ← host is GONE
The entire db object was replaced, not combined — host silently vanished. That is the single most common JSON
merge bug. A deep merge walks into nested objects instead:
const deepMerge = (a, b) => {
const out = { ...a };
for (const [k, v] of Object.entries(b)) {
out[k] = v && typeof v === "object" && !Array.isArray(v) &&
a[k] && typeof a[k] === "object" && !Array.isArray(a[k])
? deepMerge(a[k], v)
: v;
}
return out;
};
// { db: { host: "localhost", port: 6543 } } ← correct Python — dict.update() and | are shallow for the same reason:
import json
from collections.abc import Mapping
def deep_merge(a, b):
out = dict(a)
for k, v in b.items():
if isinstance(v, Mapping) and isinstance(out.get(k), Mapping):
out[k] = deep_merge(out[k], v)
else:
out[k] = v
return out
merged = deep_merge(json.load(open("base.json")), json.load(open("prod.json"))) Command line (jq) — note the two different operators:
jq -s '.[0] * .[1]' base.json prod.json > merged.json # * = recursive (deep)
jq -s '.[0] + .[1]' base.json prod.json > merged.json # + = shallow
jq -s 'reduce .[] as $f ({}; . * $f)' *.json # deep-merge every file
None of these de-duplicate arrays, merge array items by id, or
let you choose which file wins per conflict — which is exactly what the
merger above does, with no script to maintain.
Common JSON merge problems (and fixes)
“My nested config got wiped out.” You did a shallow merge. Turn on deep merge (the default here) so nested objects combine level by level instead of replacing each other.
“My arrays doubled up.” The default array strategy is
concatenate, which appends. Switch to union to keep only
unique items, or merge by key to match objects on their id and combine them instead of duplicating them.
“The wrong file won a conflict.” Precedence follows file order. Drag the files to reorder them, or switch from last-wins to first-wins.
“One of my files will not parse.” The tool reports the exact line and column. Fix it with the JSON repair tool — trailing commas and single quotes are the usual culprits — or check it with the JSON validator.
“I need to see what actually changed.” Compare the before and after with the JSON diff tool, which ignores key order and whitespace so you only see real differences.
Why choose our JSON merger?
MergeJSON does more than glue files together — it lets you combine multiple JSON files into one in a single step. Unlike many sites that quietly send your data to a server, MergeJSON runs entirely client-side — so you can merge JSON files free without ever exposing API keys, customer records, or internal configuration. Each input is validated as you type, with the exact line and column of any syntax error surfaced before you merge, so you never end up with broken output. It works on any device with a modern browser, handles large files limited only by your machine's memory, and even keeps working offline once the page has loaded.
Ready to combine JSON files online? Open the merge tool and drop in your first two files, read the full guide to how it works, or explore the JSON guides blog for tutorials on merging, validating, and working with JSON.
FAQ
Questions, answered.
Still curious? The Merge JSON blog goes deeper on JSON merging, structure, and tooling.
How do I merge JSON files online? +
To merge JSON files online, open the merge tool above, drag and drop two or more .json files (or click to browse), choose your merge options, and press Merge JSON. You can then copy the combined result or download it as a single .json file. The whole process runs in your browser and takes just a few seconds.
How do I merge two JSON objects? +
Switch to the Merge code tab, paste each JSON object into its own input, and press Merge JSON. The tool combines the two objects into one — using a deep merge by default so nested properties are preserved rather than overwritten. You can add more inputs to merge several JSON objects at once.
Can I combine multiple JSON files at once? +
Yes. You can combine multiple JSON files in a single operation — there is no two-file limit. Add as many files as you need, drag to reorder them to control precedence, then merge and download the result as one consolidated JSON file.
Is there a way to merge multiple json files without opening them? +
Yes — that is exactly what this tool is for. You never have to open the files in a text editor or read their contents to combine them. Just drag every .json file straight from your folder onto the merge area (or click to browse and multi-select), and the tool parses, validates, and merges them for you in the browser. Reorder the files to control precedence, press Merge JSON, and download a single combined file. It is the fastest way to merge multiple JSON files into one without opening, copying, or hand-editing any of them.
Do I need to install anything or sign up? +
No. Merge JSON is a free online tool that runs entirely in the browser. There is nothing to install, no account to create, and no usage limits. It works on Windows, macOS, Linux, and mobile — anywhere you have a modern browser.
Is my JSON data uploaded anywhere? +
No. Merge JSON runs entirely in your browser using client-side JavaScript. Your files and snippets are parsed and merged locally on your device and are never sent to, stored on, or seen by any server.
What is the difference between deep merge and shallow merge? +
A shallow merge combines only the top-level keys, so a nested object in a later file completely replaces the earlier one. A deep merge walks into nested objects recursively, combining them at every level so no nested data is lost. Deep merge is the default and is best for layering configuration files.
How are JSON arrays merged? +
You choose the array strategy: concatenate joins arrays end to end, union keeps only unique items, replace keeps the last array, and merge-by-key matches array items by an id field and deep-merges the matching objects. This lets you combine JSON arrays exactly the way your data needs.
How are duplicate keys handled when merging JSON? +
When the same key appears in more than one file, you decide which value wins. By default the last file in the list wins (mirroring JavaScript's Object.assign and spread behaviour); you can switch to first-wins and reorder files to fine-tune precedence. With deep merge, nested objects under a shared key are combined rather than discarded.
Can I combine JSON files without coding? +
Yes. The tool is built for exactly that — combining JSON files without writing any Python, JavaScript, or jq. Just drop in your files, pick your options, and export. No scripting required.
Can I download or copy the merged JSON? +
Yes. After merging, you can copy the formatted JSON, copy a minified one-liner, or download the result as either merged.json (pretty-printed) or merged.min.json (minified). Toggle pretty-printing on or off without re-running the merge.
Will merging preserve nested structures? +
Yes. With deep merge enabled, nested objects and arrays are combined level by level, so nested structures are preserved instead of being overwritten. The result panel shows key counts and nesting depth so you can confirm the structure at a glance.
Is there a file size limit? +
There is no hard limit — you are only bound by your device's available memory, since all processing is local. Multi-megabyte JSON files typically merge in milliseconds on a normal laptop.
Is Merge JSON really free? +
Yes. Merge JSON is completely free to use, requires no signup or email, has no file-size paywall, and places no limit on how many files you merge.