Skip to content
JSON Runs offline

JSON to CSV Converter

Flatten JSON records into a spreadsheet.

Input

0 chars

Output

0 chars
Ctrl

Questions

What shape does the JSON have to be?

An array, because a CSV is a table of rows. An array of objects is the usual case and produces a header row from the union of every key, in the order the keys are first seen. An array of arrays is written straight through as rows. Anything else - an object at the top level, an empty array, a row that is a number - is reported as an error naming what was found.

How are nested objects and arrays handled?

By default they are flattened into dotted columns, so {"addr":{"city":"Bandung"}} becomes a column named addr.city and a list becomes tags.0, tags.1 and so on. The alternatives are keeping the nested value as JSON text inside a single cell, or refusing to convert and naming the key path that is nested, which is useful when flattening would hide a structural surprise in the data.

When are cells quoted?

Only when they need to be under RFC 4180: the cell contains the delimiter, a double quote, or a line break. Quotes inside a quoted cell are doubled. Anything else is written bare, which keeps the file readable and diff-friendly.

Which line ending should I choose?

LF is right for Unix tooling, git and most programming languages. Choose CRLF if the file is destined for Excel on Windows or for a system that follows RFC 4180 strictly, since the specification names CRLF as the record separator.

Open JSON Formatter

JSON Formatter

Format, indent and inspect JSON with clear error reporting.

JSON