Updated September 1, 2026
JSONL Format Reference
JSONL, also called JSON Lines or NDJSON, stores one complete JSON value on each line. It is common for logs, AI dataset rows, exports, and streaming data because each row can be parsed independently.
Core rules
Each physical line is parsed as a separate JSON value. Pretty-printed multi-line JSON is not JSONL.
| Rule | Why it matters | Example |
|---|---|---|
One JSON value per line | A reader can parse each record independently. | {"id":1,"text":"hello"} |
Use UTF-8 | Keeps text portable across tools and platforms. | {"language":"en","text":"Plain UTF-8 text"} |
No trailing commas | Each line must be valid JSON, not JavaScript object syntax. | {"id":1,"ok":true} |
No blank lines | A blank line is not a valid JSON value. | {"id":2,"ok":false} |
Objects are common | Datasets and logs usually need named fields per row. | {"prompt":"Write title","completion":"Short title"} |
Valid JSONL
{"id":1,"title":"First row","status":"ready"}
{"id":2,"title":"Second row","status":"draft"}
{"id":3,"title":"Third row","status":"ready"}Not JSONL
This is pretty-printed JSON. It may be valid JSON, but it is not one complete JSON value per line.
{
"id": 1,
"title": "First row"
}AI dataset rowsFor AI workflow data, object rows with consistent keys are usually easier to validate, filter, and convert later. That is a workflow rule, not a universal JSONL requirement.
References
Questions
Is JSONL the same as JSON?
No. JSON can contain one full value across many lines. JSONL contains one full JSON value on each line.
Can JSONL rows be arrays or strings?
They can, because each line may be any JSON value. In practice, logs and AI datasets usually use object rows.
Are blank lines allowed in JSONL?
No. A blank line is not a JSON value. Some tools tolerate blanks, but strict JSONL validation should flag them.