Convert JSON to CSV Online – Export JSON Arrays as Spreadsheet
Analysts, marketers, and data engineers frequently receive data in JSON format from APIs or database exports but need it in CSV to open in Excel, Google Sheets, or to import into data tools like Tableau or Power BI. The conversion isn't trivial when JSON objects contain nested sub-objects or arrays within arrays — decisions must be made about how to flatten that structure into flat table rows. This tool handles the most common case: a JSON array of objects where each object becomes a row and each unique key becomes a column. It automatically discovers all unique keys across all objects in the array (handling sparse arrays where some objects have fields others don't), maps values to the correct columns, and outputs standard comma-separated CSV ready for spreadsheet import. Paste your JSON, hit convert, and download or copy your CSV in seconds.
Open JSON Formatter →What Is Convert JSON to CSV Online – Export JSON Arrays as Spreadsheet?
JSON to CSV conversion transforms a JSON array of objects into a tabular format where each array element becomes a row and each object key becomes a column header. Nested objects are typically flattened using dot notation, and arrays within objects are often joined or serialized. The result is a CSV file compatible with Excel, Google Sheets, and most data tools.
How to Use the JSON Formatter
- Step 1: Ensure your JSON is an array of objects (starts with `[` and contains objects `{...}` as elements).
- Step 2: Paste the JSON array into the input area above.
- Step 3: Click 'Convert to CSV' — the tool scans all objects to build the complete column list.
- Step 4: Review the CSV output to confirm columns and values are correctly mapped.
- Step 5: Check that nested object values are flattened correctly (e.g., `address.city` as a column name).
- Step 6: Click 'Download CSV' or copy the output to paste directly into your spreadsheet application.
Example
// Input JSON array:
[
{ "id": 1, "name": "Alice", "city": "London", "score": 92 },
{ "id": 2, "name": "Bob", "city": "Toronto", "score": 87 },
{ "id": 3, "name": "Yuki", "city": "Tokyo", "score": 95 }
]
// Output CSV:
id,name,city,score
1,Alice,London,92
2,Bob,Toronto,87
3,Yuki,Tokyo,95
Pro Tips
- Values containing commas must be wrapped in double quotes in the CSV output — the converter handles this automatically, but verify that your spreadsheet application interprets quoted fields correctly.
- If your JSON has deeply nested objects, the converter flattens them using dot notation — `address.city` becomes a column. Decide whether this suits your analysis needs before converting.
- Arrays within objects (e.g., a `tags` field that is a list) are typically serialized as a semicolon-joined string in CSV — verify this matches how you want to analyze that field.
- Google Sheets accepts CSV pasted directly into the first cell if you use File > Import or paste with Ctrl+Shift+V — using regular paste may not split into columns correctly.
- For large datasets, download the CSV file rather than copying — very large CSV strings can cause browser performance issues when pasted into a text editor.
Ready to Try It?
Free, browser-based, no signup required.
Launch JSON Formatter Free →FAQ's
CSV conversion works best with a JSON array of flat objects — each object has the same keys and only simple values (strings, numbers, booleans, null). Deeply nested objects and arrays within objects require flattening decisions that may not suit all use cases.
Nested objects are typically flattened with dot notation — `{ "address": { "city": "London" } }` becomes a column named `address.city`. Some tools instead serialize the nested object as a JSON string in a single column. Check your output to confirm the behavior.
Yes — most CSV to JSON converters (available online) will parse CSV headers as keys and each row as an object. However, type information is lost in CSV (everything becomes a string), so numbers and booleans need to be re-typed if the round-trip matters.
Use Excel's Data > From Text/CSV import wizard rather than double-clicking the file. This lets you specify UTF-8 encoding, the delimiter character, and per-column data types — preventing issues with numbers stored as strings or special characters being garbled.
The converter scans all objects to build the complete column list, then populates each row's cells — leaving cells empty for missing keys. This produces a sparse CSV where not every row has values for every column, which is standard behavior and accepted by all spreadsheet tools.
A single JSON object can be represented as one row of CSV, with keys as columns. However, most CSV workflows expect multiple rows. Consider whether a key-value format (two columns: key and value) or wrapping the object in an array `[{ ... }]` better suits your use case.
CSV is a text format with no type system. Numbers appear as digit strings, booleans as 'true'/'false' strings, and null as an empty cell or the string 'null'. Spreadsheet apps may auto-detect numbers, but type precision depends on the importing application.