Boneyard Tools

NDJSON to JSON Array Converter

NDJSON (also called JSONL) stores one self-contained JSON value per line, which is great for streaming and logs but awkward to read or feed to tools that expect a single array. Paste your lines here to wrap them into a pretty-printed JSON array with two-space indentation, or flip the direction to turn an array back into newline-delimited records. Everything runs in your browser, so large log dumps and sensitive payloads never leave your machine.

How to convert NDJSON to JSON

  1. Set the Direction menu to 'NDJSON to JSON' (or 'JSON to NDJSON' to go the other way).
  2. Paste your newline-delimited records into the input box, or click 'Load sample' to see the expected shape.
  3. Watch the output update instantly as a two-space indented JSON array.
  4. If a line is malformed, read the error naming the exact line number and fix that record.
  5. Click the Copy button above the output to grab the result.

Examples

Wrap two log lines into an array

{"id":1}
{"id":2}
[
  {
    "id": 1
  },
  {
    "id": 2
  }
]

Records with several fields

{"id":1,"name":"Ada"}
{"id":2,"name":"Linus"}
[
  {
    "id": 1,
    "name": "Ada"
  },
  {
    "id": 2,
    "name": "Linus"
  }
]

Array back to NDJSON (JSON to NDJSON direction)

[{ "id": 1, "name": "Ada" }, { "id": 2, "name": "Linus" }]
{"id":1,"name":"Ada"}
{"id":2,"name":"Linus"}

Frequently asked questions

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser using local JavaScript, so log files, API dumps and sensitive records never touch a server.

What is the difference between NDJSON and JSONL?

They describe the same format: one complete JSON value per line, separated by newlines. This tool treats NDJSON, JSONL and line-delimited JSON identically, so paste whichever you have.

Are blank lines a problem?

No. Blank lines and whitespace-only lines are skipped, so trailing newlines at the end of a file or spacing between records will not break the conversion or add empty entries.

What happens if one line is invalid?

Conversion stops and the message names the 1-based line number where parsing failed, counting every line including blank ones, so you can jump straight to the record that needs fixing.

Does the output preserve my key order and types?

Yes. Each line is parsed with the standard JSON parser and re-serialized, so key order within an object, numbers, booleans, null, nested objects and arrays all carry through unchanged.

What does the JSON to NDJSON direction expect?

A single top-level JSON array. Each element is written compactly on its own line in array order. If the input is valid JSON but not an array (an object or a bare value), you will get an error explaining that a top-level array is required.

Will the array output stay minified?

No. The NDJSON to JSON direction always pretty-prints with two-space indentation for readability. If you need a compact single-line array, run the result through a JSON minifier or formatter afterward.

Can each line be a value that is not an object?

Yes. Any valid JSON per line works, including numbers, strings, booleans and nested arrays. For example a file of bare numbers becomes a numeric array, since each line is parsed on its own.

Is there a size limit?

There is no hard cap. Because the work happens locally, the practical ceiling is your device memory. Very large files may briefly pause the browser tab while they parse, but nothing is sent over the network.

Learn more

Related tools