Skip to content

NDJSON to JSON array converter

Paste NDJSON, one JSON value per line. A JSON array is written beside it.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

JSON output
NDJSON
JSON array

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste log lines, a BigQuery or MongoDB export, or a .jsonl file, or load the sample.
  2. Read the array. Each line becomes one item, in the same order.
  3. Copy or download the array, or choose compact output for a single line.

Supported formats and limitations

  • Each line must be one complete JSON value. A pretty-printed object that spans several lines is not NDJSON.
  • Blank lines are skipped.
  • Integers beyond 2^53 lose precision, as they do in JavaScript. A notice gives the line and column.
  • The whole file is converted in the browser, so very large exports can be slow.

Examples

Two lines

Two objects on separate lines become an array with two items.

{"id": 1}
{"id": 2}

Mixed values

Lines can hold any JSON value, such as numbers or strings.

1
"two"
{"three": 3}

Common errors and solutions

Line 2: Expected double-quoted property name
The message names the line that failed. A trailing comma is the usual cause.
starts a JSON array that spans several lines
The input is already pretty-printed JSON, not NDJSON. Use the JSON formatter instead.

FAQ

Are NDJSON and JSON Lines the same?
For this tool, yes. Both mean one JSON value per line, separated by line breaks.
Why is my log line rejected?
Some loggers add a timestamp or level before the JSON. Remove the prefix so each line starts with { or another JSON value.
Is the data uploaded?
No. It is converted in your browser.

Related tools

  • JSON formatter

    Validate JSON, then pretty-print it with 2 or 4 spaces or minify it. Invalid JSON produces an error and leaves the output empty.

  • JSON validator

    Check JSON syntax in the browser. Errors give a line and column, and duplicate keys that JSON.parse would silently drop are reported.

  • JSON to CSV converter

    Convert a JSON array of objects or arrays to CSV in the browser. Nested values are rejected instead of being encoded.