1001Ferramentas
📄 Converters

JSON Lines → CSV

Convert JSONL (NDJSON) file to CSV, deriving headers from the union of all observed object keys.

CSV:

From JSON Lines to a spreadsheet

JSONL, also called NDJSON, is the format with one JSON object per line. It is the standard output of structured logging, of batch database exports and of training datasets, precisely because it can be processed line by line without loading the whole file into memory. The trouble starts when you want to look at that data: nobody analyses ten thousand lines of JSON by eye.

Paste the lines and the page builds the table. It walks every object, collects the set of keys in the order each first appeared and uses that as the header. Objects missing a key get an empty cell in that column, so records with different shapes coexist in the same table. Commas, quotes and line breaks inside a value are escaped the way CSV requires, with doubled quotes.

Two things to know before trusting the output. A line that is not valid JSON is skipped silently — if the record count does not match what you expected, that is where the difference lives. And nested values, such as an object or a list inside a field, go through the default text conversion, which turns an object into [object Object]. For nested data, flatten the keys before pasting.

Frequently asked questions

What determines the column order?
Order of first appearance. The first line defines the opening columns; when a later line brings a key not seen before, it is appended to the end of the header. That keeps the output stable and predictable when records are not homogeneous.
Why did Excel put everything in one column?
Because in some regional settings Excel expects a semicolon as the separator rather than a comma. Two ways out: import through the data wizard and choose the comma, or save the file with a first line reading sep=, which Excel reads as an instruction.
Does it work for ordinary JSON, a single array?
Not directly — the page reads one object per line. If you have a JSON array, it needs breaking into one line per element before pasting. Many exporters offer both formats; look for the line-delimited or ndjson output option.

Related Tools