Skip to content

JSONL explained: the format for datasets and fine-tuning

What JSONL is, how it differs from a JSON array, why data pipelines and LLM fine-tuning use it, and how to convert and validate it without surprises.

Open the JSONL Converter →

What is JSONL?

JSONL — JSON Lines, sometimes called NDJSON — stores one JSON value per line, separated by newlines. There are no surrounding brackets and no commas between records:

{"role":"user","content":"Hi"}
{"role":"assistant","content":"Hello!"}

JSONL vs a JSON array

A JSON array wraps everything in [ … ] with commas between items, so a parser must read the whole file at once. JSONL has no wrapper, so you can read or append a single record without loading the entire file — ideal for large or streaming datasets.

  • JSON array — one document; easy to load whole; needs full parse.
  • JSONL — many independent records; streams and appends; one bad line doesn't break the rest.

Why fine-tuning uses JSONL

Training sets can be gigabytes. JSONL lets a data loader read one example at a time with constant memory, and most fine-tuning APIs expect exactly one training example per line — commonly a messages object with a user turn and an assistant turn. The converter validates each line and reports the exact line number of any malformed record, so you can fix a dataset before uploading it.

Using the tool

  • JSONL → JSON array — wrap your records into a single array (pretty or minified).
  • JSON array → JSONL — flatten an array into one compact record per line.
  • Validate JSONL — check every line parses, with the first error's line number.
  • Copy or Download the result as .json or .jsonl.

Common pitfalls

  • Trailing commas — valid in some editors but not in JSON; the validator will flag them.
  • Pretty-printed objects spanning multiple lines — JSONL needs each record on one line.
  • A byte-order mark or smart quotes pasted from a document — replace with plain quotes.

Privacy

Datasets often contain proprietary or personal data, so everything here runs locally in your browser — nothing you paste or download is uploaded.

FAQ

What is JSONL?

One JSON value per line, with no enclosing array — great for streaming and appending.

How is it different from a JSON array?

No wrapper or commas; you can read or append one record without parsing the whole file.

Is my data uploaded?

No — conversion and validation run entirely in your browser.

Ready to try it? Open the JSONL Converter →

Related guides