Convert JSON to Excel
Paste JSON or drop a .json file and see the sheets it will make, then download the workbook. It is built in this tab, so the data stays on your machine.
The sheets appear here once there is JSON to convert.
How to use it#
- Drop a .json file on the box, or paste the JSON into it.
- Check the sheets listed under it, and choose whether to write a header row and flatten nested objects.
- Press Download .xlsx to build the workbook and save it.
A real workbook, not a CSV with a new name#
The file this page makes is a genuine .xlsx workbook, the format Excel, Numbers, Google Sheets, and LibreOffice all open directly. That matters for more than the icon. Each cell keeps its type, so 36 is a number you can sum and true is a boolean, while text stays text: a postcode like 01234 keeps its leading zero instead of being turned into 1234, which is what happens when Excel guesses the types in a CSV.
The header row is bold and frozen, so it stays in view as you scroll, and each column starts wide enough for its contents. If you want a plain text file instead, for a database import or a script, the JSON to CSV converter writes one.
Which JSON makes which sheets#
An array of objects is the usual shape, and it becomes one sheet: a column for every key that appears in any object, in the order they first appear, and a row per object. A key missing from one object leaves that cell empty. A single object becomes a sheet of one row, an array of arrays is written as a grid with no header, and an array of plain values becomes one column.
An object whose every value is an array becomes one sheet per key, named after it, so {"users": [...], "orders": [...]} gives a workbook with a users sheet and an orders sheet. That is also exactly what the Excel to JSON converter writes when it reads every sheet of a workbook, so the two convert back and forth.
Sheet names follow Excel's rules. They are cut to 31 characters, the characters : \ / ? * [ and ] become underscores, and a name used twice gets a number after it.
What Excel cannot hold exactly#
Excel keeps 15 significant digits of any number. A 16 digit order ID stored as a number would come back with its last digit changed to 0, so any number longer than that is written as text, exactly as the JSON has it, and the page says how many it wrote that way.
Dates in JSON are only ever strings, such as 2024-03-01, and they are written as text rather than guessed at. Excel converts text that looks like a date when you edit the cell, so format the column as a date there if you want to sort or filter on it.
A single sheet holds at most 1,048,576 rows and 16,384 columns, and a cell holds at most 32,767 characters. JSON that breaks one of those limits is refused with a message saying where, rather than producing a file Excel would reject.
Frequently asked questions#
What happens to nested objects?
#
By default each nested object stays in one cell as JSON text, which keeps the data but is hard to read in a spreadsheet. Tick Flatten nested objects and each leaf gets its own column named by its path, so {"address": {"city": "Paris"}} becomes a column called address.city. Arrays inside an object always stay as JSON text, since a column per item would depend on the longest list.
How do I get several sheets?
#
Give the JSON a key per sheet, each holding an array: {"customers": [...], "invoices": [...]}. Each key becomes a sheet of that name. The list under the box shows the sheets the workbook will have before you download it.
Does it open in Google Sheets and Numbers?
#
Yes. The .xlsx format is the standard spreadsheet format, and Google Sheets, Apple Numbers, and LibreOffice Calc all open it, with the types and the bold header row intact. In Google Sheets, use File, Import, and upload the workbook, or drop it into Google Drive and open it from there.
Can Excel open a JSON file on its own?
#
Excel can import JSON through Power Query, under Data, Get Data, From File, From JSON. That suits data you refresh from the same source, but it opens an editor where each nested record has to be expanded into columns by hand. For a one-off file, the workbook made here opens straight into a sheet with its columns and types already set.
Why is my long number shown as text?
#
Because Excel would change it otherwise. Excel keeps only 15 significant digits, so a 16 or 17 digit ID stored as a number loses its last digits. Written as text it stays exactly as it was, and the page lists how many numbers were written that way.
Is my data uploaded?
#
No. The workbook is assembled by JavaScript in this tab and handed straight to your downloads folder.