CSV ⇔ JSON Lines (JSONL) Converter

Convert between CSV files and JSON Lines (JSONL, one JSON object per line). Choose your delimiter, and rows with inconsistent keys are merged automatically. Conversion runs entirely in your browser; nothing is sent to a server.

How CSV rows map to JSONL lines

CSV header row + data row name,age,city
Alice,30,Tokyo
Resulting JSONL (one object per line) {"name": "Alice", "age": "30", "city": "Tokyo"}

Each CSV data row becomes one JSON object keyed by the header row, output as a single line of JSONL. Going the other way (JSONL → CSV), the header row is the union of every key seen across all lines, and rows missing a given key are left blank in that column.

Tips

  • When converting JSONL to CSV, lines do not need matching keys or key order — the tool builds the header row from the union of every key it sees and aligns the columns automatically.
  • Blank or duplicate header cells are automatically replaced with col{n} or name_2 style keys so no value is lost or silently overwritten.
  • Values that are numbers, booleans, or nested objects/arrays are written out as text in the CSV cell, so the result opens cleanly in Excel or any spreadsheet app.
  • Pair this with the CSV → JSON and JSONL ⇔ JSON array tools to move freely between CSV, JSON arrays, and JSON Lines.
  • The CSV side uses an RFC 4180-compliant parser that correctly handles commas and line breaks inside quoted cells, so complex exports from Excel convert without errors.

Frequently Asked Questions

CSV is convenient for opening in a spreadsheet and eyeballing the data, while JSON Lines can be streamed and parsed one line at a time, which is why it is common for machine-learning datasets and log pipelines. This tool bridges the gap so you are not stuck converting by hand.

Each data row (excluding the header) becomes exactly one JSONL line, and the header row supplies the key names for the resulting JSON object.

Yes. When converting JSONL to CSV, the tool collects every key that appears across all lines into one combined header row; any line missing a particular key simply gets an empty cell for that column.

Yes — select "Tab" as the delimiter and both directions work with tab-separated data instead of commas.

No. All conversion happens locally in your browser using JavaScript, so nothing you type or paste is ever transmitted anywhere.
ツールくん

Side Note — Why JSON Lines became the common language of ML and log processing

One of the biggest drivers behind JSON Lines (JSONL) adoption is machine-learning dataset distribution. Fine-tuning data for large language models often consists of millions of input/output pairs, and packing them into a single JSON array means nothing can be read until the entire file has been loaded and parsed into memory. JSONL sidesteps this by treating each line as one self-contained record, so huge datasets can be streamed and processed incrementally.

Log processing tools have embraced JSONL for a similar reason. Platforms like Elasticsearch and Logstash are built to ingest events one at a time as they are produced, and a format where each line stands on its own fits that append-and-parse model far more naturally than a JSON array, which only makes sense as a single, indivisible structure.

CSV, meanwhile, remains firmly entrenched wherever data needs to be handed off between teams or eyeballed in a spreadsheet. By bridging these two very different formats directly, this tool lets you feed CSV data straight into a machine-learning pipeline, or open a JSONL log file in Excel, in a single step.

→ Browse all trivia