Data formats
JSONL vs JSON: differences and when to use each
Quick answer
JSON stores one document — often a single array holding every record. JSONL stores one record per line. Use JSON for small payloads and APIs; use JSONL for large datasets, logs and anything you stream, append to or split.
By SourceX Editorial · Updated
Side by side#
| JSON | JSONL | |
|---|---|---|
| Structure | One document, e.g. [ {...}, {...} ] | One JSON value per line |
| Reading | Usually parsed whole | Parsed line by line |
| Appending | Rewrite the array | Add a line |
| One bad record | Whole file fails to parse | Only that line fails |
| Best for | APIs, config, small files | Datasets, logs, streaming, sharding |
When JSON is the better choice#
When a program expects one object, when the data is small, or when records need to sit inside a larger structure with metadata.
When JSONL is the better choice#
When files are large, when you process records one at a time, when you append over time, or when you need to split data into training, validation and test sets.
Converting between them#
To turn a JSON array (or an array nested inside an object) into JSONL, use the JSON to JSONL converter. To go back, the JSONL to JSON converter wraps every line into one array. Both run in your browser.
Try it in your browser
Free tools. Your file is processed in this browser and not uploaded.
Frequently asked questions
Is JSONL smaller than JSON?
About the same: JSONL drops the outer brackets and commas but adds newlines. The real difference is how it can be processed, not size.
Can I open JSONL where JSON is expected?
Usually not directly, because the file is not one JSON document. Convert it to a JSON array first.
Sources
Related
Tell us what your models need
Share scope, volume, language, format, timing and licensing requirements.