Code Beautify / Guides

JSONL to CSV for Excel: convert records without losing data

A JSONL file has one JSON value per line. Excel expects columns. This walkthrough joins the records into an array, creates CSV, and checks what the spreadsheet actually imports.

Check that the lines can form a table

JSONL, also called JSON Lines, stores a separate valid JSON value on each line. For a spreadsheet, each value should be an object representing one row, with field names that can become column headings. Our example has two records: an id, a name and an amount. The first name contains a comma, the second contains an accented character, and the second amount is null. Those details expose errors that a two-row file of plain words would hide. Inspect a small sample before converting a large export. If some lines contain arrays, bare numbers or nested objects, decide how to reshape them first; a flat CSV table cannot express all of that structure faithfully. Keep a copy of the original JSONL.

Join the records, then create CSV

Paste the example into the embedded JSON Lines to array tool. It should return one JSON array containing exactly two objects, in the original order. Copy that complete array into the JSON to CSV tool linked below. This second step creates the header id,name,amount and two data rows. The cell Ana, Ltd is quoted because its comma belongs inside the name; a simple split on commas would corrupt the row. MultiVerto uses the keys encountered in the records to choose columns. If later records introduce extra keys, the output gains extra columns and earlier missing cells are blank. Review the resulting header rather than assuming every input record had the same schema. Each line must be valid JSON; a blank line within the file or a missing quote is an input error, not an empty row.

Three checkpoints from line-oriented records to a verified spreadsheet.
  1. JSONL: one object per line
  2. JSON array: same two objects together
  3. CSV: headers and quoted fields
  4. Excel: inspect types and row count

Decide what empty and typed values mean

CSV contains text fields, not JSON types. In this example, the JSON string "001" becomes the CSV cell 001, the JSON number 12.5 becomes 12.5, and null becomes an empty cell. A missing amount property would also produce an empty cell, so the CSV alone cannot distinguish missing from null. A genuine empty string is another possibility. If that distinction matters, create an explicit status column or agree on a documented marker before export. The converter also rejects nested objects and arrays because a single ordinary CSV cell has no agreed way to represent them. Flatten such fields with a defined naming scheme, or retain JSONL when the nested structure must survive. Do not silently stringify a nested object and call the result a faithful table.

Import into Excel with deliberate column types

Save the CSV as a UTF-8 text file and import it through Excel’s Data → From Text/CSV flow. Check the delimiter and character preview so Zoë is still readable. Set id to Text before loading; automatic number conversion can turn 001 into 1. Long account numbers and codes that resemble dates also need explicit text handling. Inspect the preview for three columns and two data rows, then compare the first and last record with the JSONL source. Your regional settings can affect how a spreadsheet interprets decimal points and delimiters, even when the CSV syntax itself is correct. If the importer expects a semicolon-separated file, arrange that as a separate, documented step instead of changing the JSONL parsing. Keep the original records so a spreadsheet display change is not mistaken for a change in source data.

Validate the result and handle untrusted cells

Count the input lines, array elements and CSV data rows; all three counts should match for this example. Check that id 001 survives as text, Ana, Ltd stays in one cell, Zoë keeps its accent, and the blank amount has the intended meaning. The CSV to JSON tool can help inspect the final columns, but its values are strings, so a round trip cannot restore JSON numbers or null automatically. If records come from users or another untrusted source, review cells that a spreadsheet might interpret as formulas before anyone opens the file. Quoting a CSV cell is a parsing rule, not a complete formula-safety policy. Follow the receiving organization’s import and security rules for such data. For repeated jobs, document the chosen columns, type rules, encoding and expected row count alongside the export.

Try the converter

Join the two JSONL records into an array before creating CSV.

Combine one JSON value per line into a JSON array.

Open full converter

More guides

Conversion guides

Explore guides