An API gave you JSON and someone wants it in a spreadsheet. This guide shows how to turn a JSON array of objects into a real Excel workbook, what happens when objects do not all match, and how nested data is handled.
The short version: paste your JSON array, check the column mapping, and download an .xlsx. The JSON to Excel converter does it on your device, so the data never leaves your browser.
The JSON shape that maps cleanly to a sheet
The natural fit for a spreadsheet is an array of flat objects, exactly what most REST APIs return:
[
{ "name": "Apples", "quantity": 12, "price": 3.50 },
{ "name": "Pears", "quantity": 8, "price": 2.25 }
]
Each object is a row. The keys (name, quantity, price) become the header row. The result is a tidy table:
| name | quantity | price |
|---|---|---|
| Apples | 12 | 3.5 |
| Pears | 8 | 2.25 |
Because JSON carries types, numbers come through as numbers and booleans as booleans, so the spreadsheet is ready to sort and total without any cleanup.
What happens when objects do not match
Real API data is rarely uniform. Some records have fields others lack. A converter handles this by gathering the union of all keys across the array and using that as the header row. Any object missing a particular key just leaves that cell blank.
So this:
[
{ "name": "Apples", "price": 3.5 },
{ "name": "Pears", "price": 2.25, "organic": true }
]
produces a sheet with three columns (name, price, organic), where the first row’s organic cell is empty. Nothing is dropped, and the columns line up. This is far safer than keying off only the first object, which would silently lose every field that object happened not to have.
Nested data is the one thing to watch
A spreadsheet is two-dimensional: rows and columns. JSON is not; it nests. When an object value is itself an object or an array, there is no clean cell to put it in, so it is written as readable text rather than being lost.
If your JSON is deeply nested, you will get better results by flattening it to one level of keys before converting. For example, reshape {"user": {"name": "Sam"}} into {"user_name": "Sam"} in code first. The flatter the JSON, the cleaner the spreadsheet.
How to convert JSON to a workbook
Step 1: Add your JSON
Paste an array of objects into the converter, or drop in a .json file.
Step 2: Check the columns
The header row and row count are shown so you can confirm the mapping looks right before downloading. If the JSON is malformed, you get a clear message pointing at the problem rather than a broken file.
Step 3: Download the workbook
Download a real .xlsx, ready for Excel, Numbers or Google Sheets.
Common mistakes to avoid
- Feeding it a single object instead of an array. The converter expects
[ {...}, {...} ]. Wrap a lone object in an array, or it has only one row to work with. - Expecting nested objects to spread into columns. Flatten nested JSON first for a clean table.
- Pasting JSON with a trailing comma. That is invalid JSON and will not parse. Most “almost JSON” errors are a stray comma or a missing bracket.
Need the reverse, pulling a sheet out as JSON for your code? See how to convert Excel to JSON.