CSV to JSON Lines
Turn a CSV file into JSON Lines, one object per row with the header row as keys. The delimiter is detected, quoted fields are handled, numbers and booleans can become real JSON types while values like 01234 stay text, empty cells become null or are left out, and columns named like plan.tier can be nested into objects.
- Runs in your browser
- No sign-up
- Free to use
How to use CSV to JSON Lines
- Paste CSV or open a .csv file with a header row.
- Choose typing, empty-cell and nesting options.
- Check the record count and warnings.
- Copy or download the .jsonl file.
CSV to JSON Lines features
Header as keys
Every row becomes an object keyed by the column names.
Smart typing
Numbers and booleans typed; leading zeros and huge numbers stay text.
Empty cells
null, an empty string, or the key left out.
Nesting
plan.tier and plan.seats become {"plan": {"tier", "seats"}}.
Robust parsing
Detected delimiter, quotes, embedded delimiters and line breaks.
Local
Converted in your browser.
When to use CSV to JSON Lines
- Preparing a dataset for a machine-learning or embedding pipeline.
- Loading spreadsheet data into a log or search system that ingests NDJSON.
- Streaming CSV rows into an API one record at a time.
- Converting exports for BigQuery or Elasticsearch bulk loading.
CSV to JSON Lines FAQ
Why JSON Lines instead of a JSON array?
Each line is a complete record, so large files can be streamed, split and appended without parsing the whole file. Many data tools prefer it for that reason.
Why does 01234 stay a string?
Converting it to a number would drop the leading zero, which matters for postcodes, IDs and phone numbers. Only values that convert without loss become numbers.
What if a row has fewer cells than the header?
Missing cells are treated as empty, and the number of such rows is reported.
What does nesting do?
Columns whose names contain dots are combined into nested objects, the reverse of flattening.
Can I convert JSON Lines back to CSV?
Yes, with the JSON Lines to CSV tool.
Is my data uploaded?
No. The conversion happens in your browser.
CSV rows as JSON records
CSV is the lingua franca of spreadsheets and exports, while JSON Lines is the preferred input of many data pipelines, search engines and machine-learning tools. Converting CSV to JSON Lines gives each row a self-describing form: an object whose keys are the column names, written on a line of its own.
Parsing follows RFC 4180, so quoted fields may contain delimiters, quotes and line breaks. The delimiter is detected by checking which of comma, semicolon, tab or pipe appears consistently on every line, which handles European exports that use semicolons. Duplicate or missing column names are reported, because they would produce ambiguous keys.
Every CSV value is text, but JSON distinguishes numbers, booleans and null. With typing on, values that are clearly numbers become JSON numbers and true or false become booleans, while values that would change when converted, such as numbers with leading zeros or integers too large for JavaScript, stay strings. Turning typing off keeps every value as text exactly as written.
Empty cells can mean “no value” or “empty text” depending on the data. They can be written as null, as an empty string, or left out of the object entirely, which keeps records small when many fields are optional. Columns named with dots can be nested back into objects, which suits data that was flattened for a spreadsheet.
The output has exactly one record per line with a final newline, as JSON Lines readers expect. Validate or tidy JSON Lines files with the JSON Lines Validator and Formatter.