Skip to content

JSON Lines to CSV converter

JSONL to CSV runs through our table engine, reading one object per line and skipping blank lines.

  • Converted with Table engine · nothing stored
  • Free: 5 conversions a day · 5 MB each
  • Higher limits →

From real runs

What you get — and what changes

  • Line records Kept

    Each non-blank line must contain one JSON object and becomes one CSV row.

  • Blank lines Changed

    Blank lines are skipped so trailing newlines or log spacing do not create empty records.

  • Nested objects Changed

    Flattening matches JSON to CSV: nested objects become dot.path columns.

  • Arrays Changed

    Arrays are written as JSON strings or indexed columns using the same array handling as JSON to CSV.

  • Streaming friendliness Kept

    JSONL is easier to process line-by-line than one giant JSON array, especially for logs and exports.

  • Union header Changed

    Keys found across all parsed objects form the CSV header; missing keys become empty cells.

  • Bad lines Changed

    A malformed JSON line is reported with its line number so you can fix or remove that record.

Sample conversions

Application events

Input
JSONL: {"event":"signup","user":{"id":"u1","plan":"Starter"}}\n\n{"event":"purchase","user":{"id":"u1"},"amount":29.95}
Output
CSV columns: event,user.id,user.plan,amount. The blank line is skipped and the purchase row has an empty user.plan cell.

Products stream

Input
{"id":"p-100","variants":[{"sku":"H-S"},{"sku":"H-M"}]}\n{"id":"p-200","variants":[]}
Output
CSV can keep variants as JSON strings or expand variants.0.sku and variants.1.sku when indexed array mode is selected.

Malformed line isolation

Input
{"ok":true}\n{"ok":false,}\n{"ok":true,"line":3}
Output
The converter identifies line 2 as invalid JSON instead of hiding the error inside one large array parse.

A real JSON Lines → CSV run

We converted our JSON Lines sample (411 B) with Table engine on 2026-09-11. It took 1 ms and produced a 225 B CSV file, 45% smaller than the input. The engine raised no warnings.

Input · sample.jsonl · 411 B

4 JSON objects, one per line; keys: company, stage, arr, owner, close_date

Records
4
Keys
company, stage, arr, owner, close_date

Output · sample.csv · 225 B

4 data rows × 5 columns; header: company,stage,arr,owner,close_date

Rows
4
Columns
5
Header
company,stage,arr,owner,close_date

First lines of the output

csv
company,stage,arr,owner,close_date
Northwind Traders,Proposal,48000,R. Ayers,2026-10-14
Contoso Ltd,Negotiation,120000,P. Ng,2026-09-30
Fabrikam,Qualified,22500,R. Ayers,2026-11-02
Tailspin Toys,Won,64000,M. Okafor,2026-09-03

Options and when to change them

flatten
Turn on for log analytics tools that expect scalar columns; leave nested values stringified when context is more important.
arrayMode
Use JSON strings for variable arrays in event payloads; indexed columns work for small fixed arrays.
skipBlankLines
Keep enabled for pretty-printed exports or logs with blank separators.
bom
Enable only when the CSV goes to Excel users who need Unicode to open correctly.

Do it yourself

jq streaming lines

bash
jq -s -r '
  (map(keys) | add | unique) as $cols |
  $cols, map([.[ $cols[] ]])[] | @csv
' in.jsonl > out.csv

This top-level example slurps all lines and does not flatten nested objects.

pandas lines=True

bash
python - <<'PY'
import pandas as pd
pd.read_json("in.jsonl", lines=True).to_csv("out.csv", index=False)
PY

Use pd.json_normalize after reading when nested dictionaries need dot.path columns.

JSON Lines to CSV by API or MCP

The HTTP API and the MCP server run the exact engine this page uses (Table engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=jsonl&to=csv.

curl
curl -X POST https://filetypeconverters.com/api/v1/convert \
  -H "Authorization: Bearer $FTC_API_KEY" \
  -F "file=@input.jsonl" -F "from=jsonl" -F "to=csv" \
  -F 'options={"encoding":"utf-8"}' \
  --output output.csv

Options this engine accepts for JSON Lines → CSV

KeyApplies toTypeDefault
encodingReading JSON Linesutf-8 · latin1utf-8
flattenSeparatorReading JSON Linesstring.
arrayModeReading JSON Linesjson · explodejson
delimiterWriting CSVstring,
newlineWriting CSV ·
API reference

When this is the wrong conversion

  • If the file is a single JSON array, use JSON to CSV instead of JSONL to CSV.
  • If event payload arrays are the primary data, flattening to CSV may hide relationships; keep JSONL or write Parquet.
  • For truly unbounded streams, use a command-line pipeline rather than a conversions with file-size limits.

JSON Lines to CSV questions

What is the expected JSONL input shape?

Each non-blank line should be one JSON object. Blank lines are skipped during conversion.

Does JSONL to CSV flatten nested data?

Yes. It uses the same flattening behavior as JSON to CSV, with dot.path columns for nested objects.

Why use JSONL instead of JSON for CSV conversion?

JSONL is streaming-friendly: each line is its own record, so log exports and append-only data are easier to validate and repair.