JSON to JSONL

Convert a JSON array into JSON Lines and back.

The JSON to JSONL converter turns a JSON array into JSON Lines, with one JSON value per line, and converts JSONL back into a normal JSON array. Use it to prepare data for log pipelines, BigQuery-style loads and machine-learning datasets that expect line-delimited JSON.

What is JSONL?

JSON Lines (also called newline-delimited JSON or NDJSON) is a text format where each line is one complete JSON value, usually an object, and lines are separated by a newline. Unlike a single JSON array, a JSONL file has no outer brackets and no commas between records, so a program can read it one line at a time, append new records by adding a line, and process files too large to load whole. Many data tools accept it, including log shippers, bulk-import APIs and training-data formats. Each line must be valid JSON on its own, and values must not contain raw line breaks (newlines inside strings are written as the escape sequence \n).

How to use JSON to JSONL

  1. Choose a direction Click JSON array to JSONL or JSONL to JSON array above the panes.
  2. Paste the input Paste the source into the Input box.
  3. Check the result The Output box fills automatically. If there is a problem, a message under the panes explains it.
  4. Copy or download Copy the output or use Download to save it as output.jsonl.

Frequently asked questions

What is the difference between JSONL and NDJSON?

They describe the same idea: one JSON value per line, separated by newlines. The file extensions .jsonl and .ndjson are both used.

Can a JSONL record span several lines?

No. Each record must fit on one line. Pretty-printed JSON with line breaks inside a record is not valid JSONL.

Are blank lines allowed?

When converting JSONL to JSON, blank lines are skipped. Some other tools do not accept them, so avoid blank lines in files you share.

Does it keep the key order?

Yes. Each value is written in the order it was parsed, and the order of the array is preserved.

Is my data sent to a server?

No. The conversion runs in the page and nothing is sent anywhere.