JSON to JSON Lines Converter

Split a JSON array into JSON Lines: one minified object per line, the format used by log pipelines and bulk import APIs.

JSON array
JSON Lines
Runs locally in your browser

About the JSON to JSON Lines Converter

JSON Lines, also called NDJSON, stores one JSON value per line. Tools can stream it, append to it and process it line by line without parsing the whole file, which is why it is used by Elasticsearch bulk imports, BigQuery loads, OpenAI batch files and most log shippers. This converter takes a JSON array and writes each element as one compact line.

Each line is minified so that no element contains a line break, which is the only rule of the format. The input must be an array at the top level; an object or a primitive has no elements to split and is reported as an error. Elements can be of any type, including nested arrays and objects.

The reverse converter joins lines back into an array and reports the line number of any element that fails to parse.

How to use

  1. Paste a JSON array on the left.
  2. Copy the lines or download a .jsonl file.
  3. Feed the file to your import tool or log pipeline.

Common questions

What is the difference between JSON Lines and NDJSON?
They are the same format under two names: newline-delimited JSON values, one per line.
Why does it require an array?
JSON Lines has one value per line, so there must be a sequence to split. Wrap a single object in square brackets to get a one-line file.
Are the lines pretty-printed?
No, each line is minified. Pretty-printing would introduce line breaks inside a value, which the format forbids.