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.