Merge JSON Arrays
Merge two JSON arrays together. Runs entirely in your browser, so your data never leaves your device.
Runs on your device, nothing uploaded
0 chars · 0 lines
0 chars
Output
Merge two JSON arrays together.
Type or paste above to see the result here.
What you paste never leaves this tab
Merge JSON Arrays is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, an API response with live access tokens in it is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.
- No upload
- No length limit
- Works offline once loaded
- Nothing stored or logged
How to use Merge JSON Arrays
- 1. Paste the two arrays. Paste the first JSON array into First and the second into Second, or open a file in either pane. The merged array appears as soon as both are filled.
- 2. Decide on duplicates. Turn on Remove duplicate items if the same value might appear in both arrays and you only want it once in the merged result.
- 3. Pick an indent. Choose 2 spaces, 4 spaces or tabs for the merged array's formatting, matching the convention used by your project.
- 4. Copy or download the result. Copy the combined array or download it as merged.json, ready to replace either source or feed into the next step.
When to use Merge JSON Arrays
Merge JSON Arrays combines two JSON arrays into a single array. It is for whenever data has been split across two exports or sources and the next step needs everything together, whether or not the same value shows up in both.
- Merging exports from two systems. Two different systems each exported a list of the same kind of ID, and you need one combined list to feed into a downstream import job.
- Combining a base fixture with overrides. A base test fixture array needs to be combined with a smaller override array before deduplicating, so the final result reflects both without repeats.
- Joining paginated API exports. You saved two pages of results from a paginated API as separate files and need them combined into a single dataset for analysis.
- Combining allowlists from two configs. Two configuration files each maintain their own array of allowed values, and you need a single merged allowlist that includes everything from both, without duplicates.
Examples
Concatenate two arrays
Input
[1, 2]
Output
[ 1, 2, 2, 3 ]
About the Merge JSON Arrays tool
Merge JSON Arrays runs as plain JavaScript in your browser tab, with no server behind it. Merge two JSON arrays together. Whatever you put in stays on your device from start to finish.
The tool is part of EditSafely's JSON Tools section, 90 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.
You can shape the output with 2 settings, including Remove duplicate items and Indent, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.
That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.
Frequently asked questions
Is Merge JSON Arrays free to use?
Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.
Is it safe to paste sensitive or confidential data?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
How much text can I process at once?
There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.
Do I need to sign up or install anything?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
How do I use the result?
The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.