Boneyard Tools

JSONL to CSV Converter

Paste JSONL, one JSON object per line, and get a CSV whose header is the union of every key across all rows in first-seen order. Rows that lack a key get an empty cell, nested objects and arrays are written as compact JSON in a single cell, and any value with a comma, quote or newline is quoted per RFC 4180. Flip the direction to turn a CSV back into JSONL.

How to convert JSONL to CSV

  1. Leave the JSONL to CSV button selected at the top of the tool.
  2. Paste your JSONL into the input box, with one JSON object per line and blank lines ignored.
  3. Read the CSV in the output box; an error names the first line that is not a valid JSON object.
  4. Click Copy to grab the CSV, or switch to CSV to JSONL to reverse the conversion.

Examples

Two records to CSV

{"name":"Ada","city":"London"}
{"name":"Alan","city":"Bletchley"}
name,city
Ada,London
Alan,Bletchley

Union header fills a missing key with an empty cell

{"name":"Ada","city":"London"}
{"name":"Alan","city":"Bletchley","role":"cryptanalyst"}
name,city,role
Ada,London,
Alan,Bletchley,cryptanalyst

Commas and quotes get RFC 4180 quoting

{"note":"Hello, world","q":"say \"hi\""}
note,q
"Hello, world","say ""hi"""

Frequently asked questions

What is JSONL?

JSONL, also called NDJSON or JSON Lines, stores one complete JSON object per line separated by newlines. It is common for logs, database exports, and streaming data because each line can be read and written independently.

How is the CSV header built?

The header is the union of every key seen across all lines, kept in the order each key first appears. If a later record introduces a new key, that column is appended to the right, and earlier rows leave it blank.

How are commas, quotes and newlines handled?

Any cell that contains a comma, a double quote, or a line break is wrapped in double quotes, and each inner quote is doubled. Cells without those characters are left unquoted. This follows RFC 4180 so spreadsheets read it correctly.

What happens to nested objects or arrays?

A nested value is serialized as compact JSON inside its cell, so a value like an array of two numbers becomes the text [1,2] in that column. If that JSON contains a comma it is quoted like any other special value.

How are null and missing values shown?

A JSON null and a key that a row simply does not have both render as an empty cell. Numbers and booleans are written as their plain text, so true stays true and 42 stays 42.

Can I convert CSV back to JSONL?

Yes. Click CSV to JSONL and the first row becomes the keys, then each following row becomes one JSON object per line. Every cell comes back as a string, since CSV does not record whether a value was a number or text.

Does the round trip preserve types?

Structure survives but types do not. Going JSONL to CSV and back leaves numbers, booleans and nested JSON as plain strings, because CSV has no type information to restore them from.

What line endings does the CSV use?

The generated CSV joins rows with CRLF, the carriage return plus line feed pair that RFC 4180 specifies, which is what Excel and most spreadsheet tools expect on import.

Is my data uploaded anywhere?

No. Both conversions run in your browser, so your JSONL and CSV never leave your device and nothing is logged or stored.

Learn more

Related tools