Skip to content
UniKit

JSON list merger

Merge multiple JSON objects into one array, or deep-merge their top-level keys into a single object. JSON arrays, single objects and NDJSON/JSONL are auto-detected, with optional dedupe and pretty printing — all parsed locally in your browser.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Three shapes are recognized: a JSON array, a single JSON object, and NDJSON/JSONL with one object per line. Array mode collects everything into one JSON array; merge mode deep-merges the keys of all objects into a single object.

Merged output

Copy the result straight into API debugging, config files or test fixtures.

Paste JSON or NDJSON to merge it

Items: 0 · Top-level keys: 0 · Input shape: -

What this tool does

  • Turn an NDJSON/JSONL API log or export (one JSON value per line) into a standard JSON array in one step
  • Deep-merge several config fragments into one object, with later files overriding the same top-level keys
  • Deduplicate while collecting records into an array before pasting them into a test fixture

Example

Input

{"a":1}
{"b":2}

Output

[
  {
    "a": 1
  },
  {
    "b": 2
  }
]

NDJSON input with the default array mode. Switching to deep merge yields {"a":1,"b":2}.

Frequently asked questions

How is the input shape detected?

The whole text is parsed as JSON first: an array becomes the item list, an object becomes a single item. Only when that fails does the tool parse the text line by line as NDJSON/JSONL, where every line must be a complete JSON value. A truncated line (a half-written log entry, for example) therefore raises "some line could not be parsed" instead of silently dropping data.

What is the difference between array and merge mode?

Array mode collects the parsed items into a JSON array unchanged and reports the union of their top-level keys. Merge mode requires every item to be a JSON object and then deep-merges by top-level key: later values override earlier ones, two objects merge recursively, while arrays and primitives are replaced wholesale. Nested objects with the same key are merged rather than overwritten.

How does deduplication compare items?

By their JSON.stringify result, so objects with the same content but different key order ({"a":1,"b":2} vs {"b":2,"a":1}) count as distinct records. Dedupe keeps the first occurrence and only affects the item collection, not merged object keys.

Can it handle large files?

Parsing happens locally, and a few MB to a few tens of MB of NDJSON usually pastes fine. For anything larger, preprocess with a command line tool (jq -s . file.ndjson) or split by line ranges to keep the page responsive. Nothing is uploaded and no network request is made.

Why is the output sometimes not a single compact line?

"Pretty print" is on by default so the result is easy to read and diff; uncheck it to get compact output with no spaces or newlines, which is convenient for the command line or for feeding another program. An empty array prints as [].

Keywords:json list mergendjson merge

Related tools