Tools

JSON → CSV

Convert a JSON array to CSV format. Input must be an array of objects.

JSON
Ln:1 Col:1
CSV

About JSON to CSV Conversion

Converting JSON arrays to CSV is a common data engineering task — exporting API data to spreadsheets, preparing datasets for data analysis tools (Excel, Google Sheets, pandas), generating reports, or loading data into relational databases that accept CSV imports. Most BI tools and ETL pipelines support CSV as a universal input format.

JSON Array to CSV Reference

For a valid JSON-to-CSV conversion, the input must be an array of objects ([{...}, {...}]) where each object represents a row. The keys of the objects become the CSV headers. Objects with missing keys produce empty cells for those columns. Nested objects or arrays are serialized as JSON strings within the cell.

RFC 4180 defines the widely accepted CSV standard. Key rules: fields containing commas, double quotes, or newlines must be enclosed in double quotes; double quotes within quoted fields are escaped as "" (two double quotes). When opening CSV files in Excel, watch out for auto-formatting of numeric strings — Excel may strip leading zeros from ZIP codes or phone numbers formatted as numbers.

FAQ

How is nested JSON converted to CSV?
CSV is a 2D table format, so nested objects are flattened using dot notation (address.city) or serialized as JSON strings. Deep nesting may cause information loss — simplify the structure beforehand.
How are values containing commas handled in CSV?
Per RFC 4180, values containing commas, newlines, or double quotes are wrapped in double quotes. Double quotes themselves are escaped by doubling ("").
Can JSON with arrays be converted to CSV?
If the top level is an array of objects with identical keys, conversion works well. Nested arrays within values are serialized as JSON strings or split into multiple rows.