Simple inputs. One clean result.

Merge {JSON} files into one

Bring two JSON values together. Review exactly what changed.

  1. 1Add JSON A + B
  2. 2Merge
  3. 3Result

Add your JSON

Merge

If both have the same key, the second JSON wins.

Add valid JSON to both inputs to continue.

Ctrl / ⌘ + Enter to merge

Advanced options

Objects combine their keys. Other value types use the second input. Arrays follow the selected rule.

Result

Your merged JSON will appear here.

Your JSON stays in this tab. Loading a URL contacts that source directly; no inputs are saved.

How to merge JSON

Merging JSON means bringing two structured values together using a consistent rule for conflicts. It is useful when you have a base configuration and an environment override, two exports containing related information, or a small update that needs to be applied to an existing document. JoinJson gives you a place to inspect both inputs and the result before you copy anything back into your project. Start by keeping untouched copies of your source files: a merge can be valid JSON without being the right data for your application.

1. Choose the order of your inputs

Put your base document in First JSON and your update in Second JSON. Order matters because the second input wins when values conflict. For example, if the first document sets a user’s role to “Designer” and the second sets it to “Developer”, the result uses “Developer”. Keys that exist only in the first object are retained when the containing objects are combined, and new keys from the second object are added. Use Swap A ↔ B if you need to reverse that priority, then merge again to see the new result.

2. Add each document using one input method

The Paste tab is the simplest choice for a short snippet. Paste a complete JSON value into the editor, rather than a JavaScript variable declaration or a Markdown code fence. JSON object keys and string values need double quotes, and trailing commas are not allowed. The Upload tab reads a local .json file when you drop it onto the zone or browse for it. File contents are read in your browser; selecting a file does not upload it to a JoinJson processing server. The filename and size help you confirm you selected the intended document.

The From URL tab fetches a document from a public HTTPS address. The source must allow browser access through Cross-Origin Resource Sharing, usually called CORS. Loading a URL contacts that source host, which may receive your IP address and the requested address. Avoid links containing passwords, access tokens, or confidential query parameters. Imports are limited to 20 MB. If loading fails, check the source URL and its access settings; downloading the file yourself and using Upload is an alternative when the host does not permit browser requests.

3. Resolve validation errors before merging

Each input has a live status badge. Empty means no document has been supplied, Valid JSON means the text can be parsed, and an error identifies a line to inspect. An error may originate just before the reported line, such as a missing comma or an unclosed string. The Format icon helps make a valid document easier to read, while Find locates a key or value and Wrap reduces horizontal scrolling. Validation checks JSON syntax, not your business rules: it cannot tell whether a product price or account identifier is correct.

4. Pick the right merge rules

Open Advanced options if you need to change how nested objects or arrays behave. Deep merge is enabled initially, so matching nested objects are combined recursively. With deep merge disabled, a nested value supplied by the second object replaces the first value as a whole. Arrays are replaced by the second array by default. Concatenate appends the second array to the first when the array rule is applied; it does not deduplicate items or match records by identifier. With shallow object merging, nested arrays are replaced along with other nested values.

5. Merge, inspect, and export

Select Merge JSON once both badges are valid, or press Ctrl/Cmd+Enter. Review the full-width Result panel rather than assuming a successful parse guarantees a suitable output. Subtle colors identify added keys and overridden values compared with the first document. Check important nested fields, list lengths, and any deliberately changed values. Very large documents have a bounded preview to keep the page responsive, but Copy and Download include the complete serialized result. Download .json saves a new file; it does not edit either original source.

After exporting, validate the result with any schema or application checks your project normally uses. JavaScript numbers can lose precision for very large integer identifiers, so keep such identifiers as strings where appropriate. Changing an input or a merge option clears the previous result so it cannot be mistaken for a current merge. Clear all removes the working inputs from the interface. The homepage does not save your JSON in app storage, but clipboard history, downloaded files, and browser extensions remain outside the tool’s control.

How deep merge works

A deep merge combines matching objects one level at a time. A second value replaces a conflicting first value unless both are objects being combined or both are arrays handled by the selected array rule. Missing keys are preserved; null is a value, not an instruction to delete a key.

Before: base and update

First JSON:
{"profile": {"name": "Ana", "theme": "light"}, "active": true}

Second JSON:
{"profile": {"theme": "dark"}, "city": "Chennai"}

After: deep merge enabled

{
  "profile": {"name": "Ana", "theme": "dark"},
  "active": true,
  "city": "Chennai"
}

The name survives because it has no conflicting update. The theme changes because the second value wins. With deep merge disabled, the entire profile becomes {"theme": "dark"}, so the nested name is no longer present. Read the deep versus shallow merge guide for more context.

Frequently asked questions

Are pasted or uploaded JSON files sent to a server?

No. Parsing, validation, merging, and result rendering run in your browser. Load from URL contacts the source host to obtain the document. Copy and Download export data only when you request them. See the Privacy Policy for hosting and advertising disclosures.

What happens when both documents contain the same key?

The second JSON wins a conflicting value. With deep merge enabled, matching objects are combined recursively first. Keys unique to the first object remain, and keys unique to the second are added. Swap the inputs to reverse priority.

Can I combine arrays without losing their existing items?

Yes. Select Concatenate both in Advanced options. When the array rule applies, items from the first array are followed by items from the second. Duplicates remain; this is not a join by ID. In shallow object mode, a conflicting nested array is replaced.

Why does a JSON URL fail even when it opens in another tab?

A browser can display a page while still blocking another website from reading it. The source needs to permit CORS access, use HTTPS, return valid JSON, and stay within the 20 MB limit. Private endpoints requiring cookies are not supported. You can upload a downloaded .json file instead.

Does a highlighted change mean the result is incorrect?

No. Colors explain differences from the first input: added keys and overridden values. They are not schema validation or an assessment of correctness. Review the changes against your intended update and run your project’s normal checks before using the output.