Convert JSON Array to CSV
A JSON array of objects where each object has the same keys is the standard format for tabular data returned by REST APIs, and it maps directly to a spreadsheet structure: the keys become column headers, each object becomes a row. This conversion is one of the most frequently needed tasks when working with API data — business stakeholders almost always want to see data in a spreadsheet, while APIs almost always return JSON. This example shows a five-user array with consistent id, name, email, role, and active fields. When you convert this to CSV, the first object's keys become the header row and each subsequent object becomes a data row. Boolean values like active are converted to the strings "true" and "false", and numbers like id remain unquoted in the CSV output. When to use this conversion: exporting user data from your SaaS application's admin API to send to a customer success team; downloading product inventory from an e-commerce API to build a pricing spreadsheet; pulling analytics data from a reporting API to generate a monthly executive summary; feeding API response data into a business intelligence tool that accepts CSV uploads. Key parts of the example explained: the id field is a number, which the CSV converter handles correctly by leaving it unquoted. The email field is a string that won't contain commas or newlines in this example, so it doesn't need quoting. The active boolean field becomes the string "true" or "false" in CSV output — watch for this if downstream tools expect 1/0 or Yes/No instead. Edge cases to be aware of: if objects have different keys (sparse data), the converter uses the union of all keys as columns and leaves cells empty for missing values. Nested objects (like {"address": {"city": "Berlin"}}) get serialized as JSON strings within the CSV cell rather than being flattened — use the JSON tree viewer to flatten the structure first if you need individual columns for nested properties. Tips: after downloading the CSV, verify that numeric columns weren't turned into text by Excel's import wizard by checking that they right-align in cells. If you're piping this data into a database, consider using the JSON-to-SQL tool instead for a direct INSERT statement.
[
{ "id": 1, "name": "Alice", "email": "[email protected]", "role": "admin", "active": true },
{ "id": 2, "name": "Bob", "email": "[email protected]", "role": "user", "active": true },
{ "id": 3, "name": "Carol", "email": "[email protected]", "role": "user", "active": false },
{ "id": 4, "name": "Dave", "email": "[email protected]", "role": "editor", "active": true },
{ "id": 5, "name": "Eve", "email": "[email protected]", "role": "user", "active": false }
]FAQ
- What happens if objects have different keys?
- The converter uses the union of all keys as columns. Objects missing a key will have an empty cell in that column.
- Are nested objects flattened?
- Nested objects are serialized as JSON strings in the CSV cell. Use the JSON tree viewer to flatten the structure first if you need individual columns.
- Can I download the CSV?
- Yes. The tool provides a download button that saves the result as a .csv file you can open directly in Excel or Google Sheets.
Related Examples
REST APIs return compact, minified JSON to save bandwidth, but that makes the re...
Explore Deeply Nested JSONDeeply nested JSON is one of the most common sources of confusion when working w...
Format a CSV User ListUser data exports are one of the most frequently created and consumed CSV files ...