Skip to content
Categories
JSON to CSV
Convert a JSON array into CSV format.
Overview
- Converts JSON in the form of an array of objects into CSV format, which is easy to open in spreadsheet software.
- Each object in the array becomes one row of data, and each object key becomes a CSV column (header).
- It also handles patterns commonly seen in practice, such as elements with differing keys or values containing nested objects.
Usage
- Enter the JSON (an array of objects) you want to convert into the text area.
- Click the "Convert" button.
- The result is displayed as CSV, with the header on the first line and data on the following lines.
Example
Input
[{"name":"Taro","age":20},{"name":"Hanako","age":22}]Output
name,age Taro,20 Hanako,22
Use Cases
- Downloading or sharing JSON array data fetched from an API as a CSV that can be opened in Excel
- Creating test or master data in JSON format, then handing it to a system that requires CSV import
- Converting JSON output from logs or reports into CSV format that is easier for non-engineer team members to read
FAQ
What happens if elements in the array have different keys?
Every key that appears in any element is treated as a column. Elements missing a value for that key are left blank.
What if a value contains a nested object or array?
It is output as-is, as a JSON string, inside the cell.
What happens if I enter something other than an array of objects?
An error such as "Please enter JSON in array format." or "All elements of the array must be objects." is displayed.
Notes
- A key that appears in only some elements of the array is still treated as a column; the corresponding cell is left blank for elements missing it.
- If a value contains a nested object or array, it is not expanded and is output as-is, as a JSON string, inside the cell.
- If a value contains a comma, newline, or double quote, it is automatically wrapped in double quotes per the CSV specification.
Related Tools
Validate whether JSON is correctly formatted.
Convert JSON into YAML format.
Generate TypeScript type definitions from JSON.