JSONL is a simple format that puts one JSON object on every line of a file. It is popular for logs and large batches of records. Here is how it differs from regular JSON and how it relates to tables.
What JSONL looks like
JSON Lines is a text file where each line is a complete JSON object. There are no commas between the objects and no surrounding square brackets. The line break itself marks the boundary between items.
For example, a first line {"id": 1, "name": "A"} and a second line {"id": 2, "name": "B"} make a JSONL file with two items. Any single line can be cut out and is still valid JSON on its own.
One line equals one JSON object
No commas between items and no outer brackets
File extensions are usually .jsonl or .ndjson
How it differs from regular JSON
A regular JSON list is one big block that starts with [ and ends with ]. The whole file must be closed correctly to be read, so a file cut off in the middle or partly damaged may not be readable at all.
JSONL lines are independent, so if one line is broken the others can still be read. Adding a new record only means appending a line to the end of the file.
JSON: the whole file is a single block
JSONL: every line stands alone
Appending means writing one more line at the end
When JSONL is the better choice
JSONL is handy for logs, events and big exports where records keep piling up. A program can read and process one line at a time, so even a large file does not need to be loaded all at once.
It is also easy to split or join by lines. To cut a file in half, just cut by line count. On the other hand, for something like a settings file that people read as one structure, regular JSON is the better fit.
Logs and event records that keep growing
Processing or splitting a big file line by line
Regular JSON for settings that must be read as one block
Moving between JSONL and CSV
One JSONL line corresponds nicely to one table row. If every line has the same keys, the keys become column names and the values become cells, which gives a clean CSV. If the keys vary between lines, take the union of all keys as columns and leave missing cells empty.
You can build a list of objects with the CSV to JSON tool on this site and write it out one object per line, or feed a list of objects into the JSON to CSV tool to get a table. After converting, always check the first and last rows.
Keys are column names, lines are rows
Inconsistent keys lead to empty cells
Check how nested values look once flattened
Cautions when writing and reading
JSONL is simple but comes with a few rules. An object must not be spread over several lines, and line breaks inside text must be escaped as \n. One empty line at the end is usually fine, but empty lines in the middle can cause errors.
Using UTF-8 everywhere is the safest choice. It is also worth checking whether the program reading the file trips over a different line ending style, such as the one used on Windows.