Convert CSV to NDJSON (JSON Lines)
Choose NDJSON (one per line) under Convert format. Each row becomes a standalone JSON object on its own line, with no wrapping array and no commas between records.
Why NDJSON instead of a JSON array
A JSON array has to be parsed as a single value: the parser cannot finish until it reaches the closing bracket, so a 2 GB array needs 2 GB of memory. NDJSON is read one line at a time with constant memory, and a truncated file still yields every complete line before the break. That property is why it is the expected format almost everywhere data arrives in bulk:
- BigQuery and Snowflake load newline-delimited JSON natively; a JSON array is rejected.
- Log and event pipelines — Elasticsearch bulk, Fluentd, Vector — are line-oriented throughout.
- LLM fine-tuning sets are conventionally
.jsonl, one training example per line. - Unix tooling works again:
grep,headandjq -call operate per line.
.jsonl, .ndjson, JSON Lines — same thing
The names are interchangeable. Output here is .ndjson; rename it to
.jsonl if your tool insists on that extension. The bytes are identical.
Types, as with JSON
Values stay strings, for the same reason described under CSV to JSON — CSV carries no type information and guessing corrupts identifiers. Most loaders let you declare a schema at import, which is the right place to fix types.
Common questions
What is the difference between NDJSON and JSON Lines? Nothing meaningful. NDJSON, JSON Lines and .jsonl all describe one JSON object per line, separated by newlines.
Can BigQuery load this directly? Yes. BigQuery expects newline-delimited JSON for JSON loads and will reject a wrapped array.
Should I use NDJSON or a JSON array? NDJSON for anything large or streamed. A JSON array is friendlier when a person will open the file, or when an API expects one payload.