EditSafely

Merge JSON Arrays

Merge two JSON arrays together. Runs entirely in your browser, so your data never leaves your device.

First file

Drop a file here, or click to browse

Files never leave your device

Second file

Drop a file here, or click to browse

Files never leave your device

Output

The result appears here as you type.

Options

How to use Merge JSON Arrays

  1. 1. Add two JSON array files. Drop or browse for the two .json files whose arrays you want combined. Both are read and their elements queued up to be joined into one array.
  2. 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, rather than counted twice.
  3. 3. Pick an indent. Choose 2 spaces, 4 spaces or tabs for the merged file's formatting, matching the convention already used by the files you are combining.
  4. 4. Download the merged file. Download the resulting file containing both arrays' elements combined into one, ready to replace either source file or feed into the next step of your pipeline.

When to use Merge JSON Arrays

Merge JSON Arrays combines two JSON array files into a single array in one file. 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

a.json [1, 2] and b.json [2, 3]

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. The finished file is put together in browser memory and saved with the Download button, so it never touches a server on the way to your disk. 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,658 tools on EditSafely work without an account, a subscription or usage limits.

Are my files uploaded to a server?

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.

Which files does Merge JSON Arrays accept?

It accepts JSON files. There is no file size cap imposed by a server; very large files are limited only by your device's memory.

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 save the output?

Click the Download button once the result is ready. The file is built in your browser's memory and handed straight to your downloads folder, without passing through a server.

Related tools

All JSON Tools