JSONL to CSV Converter
JSON Lines (JSONL), also called NDJSON, stores one JSON value per line. Log exporters, BigQuery loads, OpenAI fine-tune datasets, and many ETL dumps use this shape because it streams well and never needs a closing array bracket. Spreadsheets still expect a flat table. This free JSONL to CSV converter reads each line in your browser, flattens objects into columns, and downloads RFC 4180 CSV.
Paste a .jsonl / .ndjson excerpt or upload a file. Empty lines are skipped; every non-empty line must be valid JSON on its own. Nested objects become dotted columns, matching the JSON to CSV converter on this site so round-trips stay predictable.
Key features
- Parses one JSON value per line with clear line-number errors on invalid JSON.
- Builds a union header set across all lines before writing rows.
- Flattens nested objects with dot notation.
- Runs entirely in the browser — file contents are not uploaded for conversion.
About the JSONL / NDJSON to CSV format
JSONL is not a single JSON array. Each line is an independent document — typically an object — terminated by a newline. That makes append-only exports and partial reads easy, but Excel cannot open the file directly as a table.
Conversion walks every parsed object, unions all keys into a stable header row, flattens nested objects with dot notation, and joins primitive arrays with semicolons so each line becomes one CSV row.
How it works
The converter splits input on newlines, skips blanks, and JSON.parse’s each remaining line. Failures report the 1-based line number so you can fix the dump quickly.
Every object is flattened; keys are collected into an ordered header list. Each line becomes one CSV row with RFC 4180 escaping.
Common use cases
- Opening a BigQuery or Snowflake NDJSON export in Excel or Google Sheets.
- Flattening application log streams that emit one JSON event per line.
- Preparing OpenAI or Hugging Face JSONL datasets for spreadsheet review.
- Spot-checking API dump files before loading them into a warehouse.
How to use this tool
- Paste JSONL or upload a .jsonl / .ndjson file.
- Confirm the preview row count matches the number of non-empty lines.
- Check flattened nested fields, then download CSV.
Example
Input JSONL
{"name":"Ada","city":"London"}
{"name":"Grace","city":"Arlington"}Output CSV
name,city
Ada,London
Grace,ArlingtonTips for best results
- Validate that every line is complete JSON — a trailing comma on one line fails only that line’s parse.
- Prefer consistent keys across lines for the narrowest CSV.
- Use CSV to JSONL when you need to go back to streaming JSON.
- Keep IDs as strings in the source if Excel must preserve leading zeros.
Common errors and how to fix them
- Invalid JSON on line N.
- Open the file at that line and ensure it is a single complete JSON value. Pretty-printed multi-line objects must be collapsed to one line each.
- Only one column named value appears.
- Lines may be primitives or arrays instead of objects. Prefer one object per line with named keys.
Frequently asked questions
Is JSONL the same as NDJSON?
Yes for practical purposes. Both mean one JSON value per line. This tool accepts either extension and either name.
Does conversion upload my file?
No. Parsing and flattening run in your browser. Download happens from a local blob URL.
For more background on data formats and conversion workflows, read our format guides or browse the converter blog for step-by-step walkthroughs linked to each tool.