JSON to JSONL Converter

Convert a JSON array to JSON Lines (one record per line) or turn a JSONL / NDJSON file back into a pretty-printed JSON array. Handy for OpenAI fine-tuning and Batch files, BigQuery loads and log processing. Runs 100% in your browser.

JSON array input

JSONL output

3 records from top-level array

How the conversion works

  • JSON → JSONL: each element of the top-level array is minified onto its own line. Objects, arrays, strings and numbers are all valid records.
  • If your JSON is wrapped in an object such as {"data": [...]}, the tool lists the array properties so you can pick one.
  • JSONL → JSON: every non-blank line is parsed and collected into an array. Blank lines are ignored; invalid lines are reported with line numbers (or skipped if you choose).
  • Need to validate or inspect a JSONL file first? Use the JSONL formatter. Coming from a spreadsheet? Try CSV to JSONL.

What is JSONL (JSON Lines / NDJSON)?

JSON Lines — also called NDJSON (newline-delimited JSON) — is a text format where every line is one complete, self-contained JSON value, usually an object. There are no commas between records and no surrounding [ ]. Files typically use the .jsonl or .ndjson extension.

{"id": 1, "event": "signup", "plan": "free"}
{"id": 2, "event": "upgrade", "plan": "pro"}

JSONL vs a JSON array

A JSON array must be parsed as a whole, so a single missing bracket breaks the entire file. JSONL can be streamed, appended to, split and processed line by line (head, grep, wc -l), and a corrupt line only affects that one record. Use a JSON array for small API payloads and config; use JSONL for large datasets, logs and anything written incrementally.

Where JSONL is used

  • OpenAI fine-tuning datasets and Batch API input/output files (one request or example per line).
  • BigQuery, Snowflake, Redshift and Athena bulk loads (NEWLINE_DELIMITED_JSON).
  • Structured logs from Docker, Kubernetes, Bunyan, Pino and most log shippers.
  • Elasticsearch / OpenSearch bulk API, MongoDB mongoexport, Hugging Face datasets.
  • Data pipelines with jq -c, Spark, pandas read_json(lines=True) and DuckDB.

All JSONL tools on DevToolsDaily run 100% in your browser — your data is never uploaded. See also the JSONL formatter, JSON ⇄ JSONL converter and CSV ⇄ JSONL converter.

FAQ