JSONL (NDJSON) ⇔ JSON / CSV Converter
Convert JSONL (one JSON value per line, also called NDJSON or JSON Lines) to and from a JSON array or CSV. It is handy for preparing log data, machine-learning datasets and BigQuery imports. If you only need JSON and CSV, try the CSV to JSON Converter.
🔒 Runs in your browser · Your data is never sent to a server
Notes
- JSONL has one JSON value per line. Blank lines are skipped, and an invalid line is reported with its original line number.
- JSONL to CSV requires every line to be an object. Columns are the union of all keys in order of first appearance, and missing keys leave the cell empty. Nested values are placed in the cell as JSON strings.
- CSV to JSONL uses the first row as the header (keys), and every value is output as a string. Numbers and booleans are not converted.
- JSON array to JSONL only works when the top level of the JSON is an array.
- Numbers are read as JavaScript numbers, so very large integers (IDs beyond about 16 digits) lose precision and 1.0 is written as 1.
Glossary
JSONL (JSON Lines)
A text format with one JSON value per line, separated by newlines. It can be processed line by line without loading the whole file and is easy to append to, so it is used for logs and large datasets.
NDJSON
Short for Newline Delimited JSON, essentially the same format as JSONL: one JSON value per line, separated by a newline (\n).
JSON array
A JSON value wrapped in [ ] with comma-separated elements. The whole file is a single JSON value, so it is not suited to stream processing.
FAQ
What is JSONL (NDJSON) and how does it differ from JSON?
It stores one JSON value per line, separated by newlines. Also called NDJSON or JSON Lines, it can be processed line by line without loading the whole file, so it is common for logs, machine-learning datasets and BigQuery imports.
Can it convert JSONL that contains blank lines?
Yes. Blank lines are skipped. If a line is invalid, the error reports its original line number (blank lines included) so you can find it in your source data.
What happens to JSONL to CSV when the keys differ between lines?
Columns are the union of all keys in order of first appearance, and cells for keys a line does not have are left empty. Nested objects and arrays go into the cell as JSON strings. If a line is not an object, an error is shown.
Are numbers kept as numbers in CSV to JSONL?
No. Every CSV value is output as a string. Convert types on the consuming side if you need numbers or booleans.
Share this page
