CSV to JSONL

Convert CSV rows into JSON Lines.

The CSV to JSONL converter turns each CSV row into one line of JSON. With a header row, every line is an object keyed by the column names; without one, every line is an array. It can optionally convert numbers and booleans into real JSON types. Use it to prepare spreadsheet exports for tools that read line-delimited JSON.

Converting CSV to JSON Lines

A CSV file stores a table as text with one record per line, while JSON Lines (JSONL) stores one JSON value per line. Going from CSV to JSONL means deciding how to name each value and what type it has. When the first row is a header, its cells become the keys of an object for each following row. When there is no header, each row becomes an array of values. CSV itself has no types, so every cell is text; the Detect numbers and booleans option converts cells that look like numbers, true or false into JSON numbers and booleans, and turns empty cells into null. Turning the option off keeps every value as a string. Quoted CSV values, including those containing the delimiter, are parsed correctly before being written as JSON strings.

How to use CSV to JSONL

  1. Provide the CSV Paste the CSV into the CSV box or load a file with the file button.
  2. Choose the options Pick the Delimiter, and tick or untick First row is header and Detect numbers and booleans.
  3. Review the JSONL Each CSV row becomes one line in the JSONL box.
  4. Copy or download Copy the output or download it as output.jsonl.

Frequently asked questions

What does Detect numbers and booleans change?

With it on, cells like 1 or 9.5 become JSON numbers, true and false (any capitalization) become booleans, and empty cells become null. With it off, every cell is written as a string.

Why do I get an array on every line?

That is what happens when First row is header is unticked. Each row is written as an array of its values.

My file uses semicolons. What do I do?

Set Delimiter to Semicolon. This tool does not auto-detect the delimiter.

What happens if a row has more cells than the header?

The extra cells are added under keys named column_N, where N is the cell's position.

Is my CSV sent to a server?

No. Pasted text and loaded files are parsed in the page and nothing is sent anywhere.