One object per line
A JSONL file is deceptively simple: take your records, encode each as JSON, and put exactly one on each line separated by a newline. There is no surrounding array and no trailing commas between records, which is precisely the point. Because each line stands alone, a program can read the file line by line, parse one record, do something with it and move on, never holding the whole dataset in memory. That is impossible with a conventional JSON array, where the parser must consume the closing bracket before it can trust anything inside.
This line-independence gives JSONL its three signature strengths: streaming, appending and resilience. You can pipe a JSONL file through tools that work a line at a time, you can append a new record by simply writing another line to the end, and if one line is corrupted you lose that record rather than the entire file. Those properties make it the default for application logs, machine-learning training sets, data exports and event streams.
Relationship to ordinary JSON
Every line of a JSONL file is valid JSON, but the file as a whole is not — feeding it to a standard JSON parser will fail at the second line. Tools therefore treat the newline as the record boundary and parse each line separately. The convention is one record per physical line, so a JSON value must not contain a raw, unescaped newline; pretty-printed, multi-line JSON is not allowed. In return you get a format that scales to millions of records and remains greppable, tailable and easy to split across workers — qualities a monolithic JSON document simply cannot offer.
Strengths
- Each line parses independently, so huge files never need loading whole.
- Append-only friendly — adding a record is just writing one more line.
- A single corrupt line damages one record, not the entire file.
- Works naturally with line-oriented tools, streaming and parallel processing.
Limitations
- The whole file is not valid JSON, so it confuses naive parsers.
- No pretty-printing — each record must sit on one physical line.
- No place for top-level metadata or a shared schema across records.
- Records can drift in shape over time since nothing enforces consistency.
When to use JSON Lines
Use JSONL for logs, event streams, large dataset exports and anything you append to incrementally or process one record at a time rather than loading all at once.
JSON Lines FAQ
- What is an NDJSON file?
- NDJSON (newline-delimited JSON) is the same idea as JSON Lines — one JSON value per line separated by newlines. The names NDJSON and JSONL are used interchangeably, and the .jsonl extension is the most common label.
- What is the difference between JSONL and JSON?
- A JSON file is one document, often an array, that must be read in full to be valid. A JSONL file is many independent JSON records, one per line, which lets you stream, append and recover from errors at the record level rather than the whole-file level.
- Can Morphr turn JSONL into a single JSON array?
- Yes. Morphr can gather the per-line records into one JSON array, or go the other way and split an array into JSONL, all on your device. It can also flatten the records into CSV or TSV columns if you need a tabular target.