About the JSON to JSONL
JSON Lines, also written JSONL or NDJSON, puts one complete JSON value on each line with nothing wrapping the file. A reader can process a hundred gigabyte export with a few kilobytes of memory, an interrupted download still yields every complete line before the cut, and appending a record is a single write. BigQuery loads, OpenAI fine tuning files, Elasticsearch bulk bodies and most log pipelines all expect this layout.
Point the tool at the right list before converting. A top level array is used as it stands. An object with exactly one array value uses that array automatically, which covers the usual {"events": [...]} envelope. When several arrays sit side by side the error names them and you type one path, for example $.events, into the array path box.
An object with no arrays at all is treated as a lookup table: each top level key becomes a record with the key stored in a field you name, so a dictionary of settings becomes a stream of rows without losing the identifier. Sorting keys inside every record helps when the file will be diffed or hashed later.
Records are always written compact, because a pretty printed record would break the one line per value rule. To go the other way, use JSON Lines to JSON, and for spreadsheet shaped output see JSON to CSV.
How to use
- Paste the JSON document, or press Sample to load an event export.
- Leave Array path empty for automatic detection, or type a path such as
$.events. - Tick Sort keys in every record when the file will be compared or hashed.
- Check the status line for the record count, then download
records.jsonl.
Common questions
- Is JSONL the same thing as NDJSON?
- In practice yes. Both names mean one JSON value per line separated by newlines, and tools that read one read the other.
- Why can records not be pretty printed?
- A reader splits the file on newlines, so a record spread over several lines would be read as several broken records.
- What happens to an object that holds no array?
- Each top level key becomes one record, with the key kept in the field you name under Key field name, so nothing is lost.
- Should the file end with a newline?
- Most loaders accept either, but a trailing newline is the safer default because line based readers then see the last record as complete.