How to Convert JSON to Excel (Including Nested JSON)

Turn JSON into an Excel sheet by flattening it to CSV or importing it with Power Query. Covers nested objects, arrays, Google Sheets and leading zeros.

9 min readUpdated October 12, 2026By the AnyShift Editorial Team

To convert JSON to Excel, flatten it into a table first: each object in the JSON array becomes a row and each key becomes a column header. The quickest way is to paste the JSON into a JSON to CSV converter, save the CSV and open it in Excel. On Windows, Excel for Microsoft 365 can also import a .json file directly through Data > Get Data > From File > From JSON.

Which route is better depends on how deeply nested your data is and whether it contains values Excel likes to “fix”, such as ZIP codes with leading zeros or 19-digit IDs. This guide covers both routes, Google Sheets, and the traps that silently corrupt data.

What shape of JSON converts cleanly

Excel thinks in rows and columns, while JSON can be any tree. The closer your JSON is to a list of similar objects, the cleaner the spreadsheet. This is how the AnyShift converter maps each common shape:

JSON shapeExampleResult in the spreadsheet
Array of flat objects[{"id":1,"name":"Ada"}, …]One row per object, one column per key (ideal)
Wrapper object around an array{"data":[{…},{…}],"page":1}Rows come from the array; extras such as page are dropped
Single object{"id":1,"name":"Ada"}One row
Nested object{"customer":{"city":"Leeds"}}A dotted column: customer.city
Array of plain values"tags":["gift","priority"]One cell: gift; priority
Array of objects"items":[{"sku":"A"},{"sku":"B"}]Numbered columns: items.0.sku, items.1.sku

Most REST API responses look like the second row: a wrapper object with the records in an array such as data, results or orders.

Method 1: Convert JSON to CSV, then open it in Excel

This route works in every version of Excel on Windows and Mac, and the same CSV opens in Google Sheets, Apple Numbers and LibreOffice.

  1. Check the JSON is valid. Paste it into the JSON Formatter & Validator. If something is wrong (a trailing comma, single quotes, a missing bracket) it reports the line and column of the error. JSON copied from log files or browser dev tools often has a stray character at the start or end.
  2. Convert it. Paste the JSON into the JSON to CSV Converter, or click Open file to load a .json file. Pick a delimiter: comma for Excel set up for the US, UK, Canada (English) or Australia; semicolon if your Excel uses a regional format where the comma is the decimal separator.
  3. Save the CSV. Click Save to download converted.csv, or Copy to paste it elsewhere.
  4. Open it in Excel. Double-clicking works for simple data, but Data > From Text/CSV lets you control encoding and column types (see the traps section below).
  5. Save as a workbook. Use File > Save As > Excel Workbook (.xlsx) so formatting, formulas and column types are kept.

The conversion runs in your browser, so customer exports and API responses are not uploaded anywhere.

If you need an .xlsx file without opening Excel, for example to email a workbook or upload it to a system that only accepts Excel files, drop the CSV into the CSV to Excel Converter. It detects numbers automatically, so columns that must stay as text (ZIP codes, product codes with leading zeros) are better imported through Excel’s own dialog, and date columns may need a date format applied (Home > Number Format > Short Date).

Worked example: nested order data

Here is a shortened API response with nested customers and line items:

{"orders":[
  {"id":1001,"customer":{"name":"Ada Lovelace","country":"UK"},"tags":["gift","priority"],
   "items":[{"sku":"MUG-01","qty":2},{"sku":"TEE-M","qty":1}],"total":42.5},
  {"id":1002,"customer":{"name":"Grace Hopper","country":"US"},"tags":[],
   "items":[{"sku":"MUG-01","qty":1}],"total":12,"coupon":"FALL10"}
],"page":1}

The converter produces this CSV:

id,customer.name,customer.country,tags,items.0.sku,items.0.qty,items.1.sku,items.1.qty,total,coupon
1001,Ada Lovelace,UK,gift; priority,MUG-01,2,TEE-M,1,42.5,
1002,Grace Hopper,US,,MUG-01,1,,,12,FALL10

What happened, step by step:

  • It found the orders array inside the wrapper object and ignored "page":1.
  • customer became two dotted columns, customer.name and customer.country.
  • tags holds plain strings, so the values were joined into one cell with ; .
  • items holds objects, so each one got numbered columns. Order 1002 has only one item, so its items.1 cells are empty.
  • coupon exists only on the second order. Columns are the union of every key, so the first row gets a blank cell rather than an error.

When you need one row per line item

Numbered columns are fine for a handful of items, but they break pivot tables: you cannot easily total qty across items.0.qty, items.1.qty and beyond. For analysis you usually want a “long” table, with one row per item and the order details repeated:

order_idcustomerskuqty
1001Ada LovelaceMUG-012
1001Ada LovelaceTEE-M1
1002Grace HopperMUG-011

Now a pivot table can sum qty by sku in one step: MUG-01 = 3, TEE-M = 1. There are two ways to get this layout:

  • Power Query (Method 2 below) expands the items list with Expand to New Rows, repeating the parent fields for each item.
  • Reshape at the source. If you control the export, request a line-item report or endpoint instead of nested orders, then convert as normal.

Method 2: Import JSON directly with Power Query

Excel for Microsoft 365 and Excel 2019 or later on Windows include Power Query, which reads JSON natively and can refresh the table when the file changes.

  1. Go to Data > Get Data > From File > From JSON, choose the file and click Import.
  2. The Power Query Editor opens. If the top level is an array, you will see a List: click To Table and then OK. If it is a wrapper object, click the List link next to the key you want (such as orders), then To Table.
  3. Click the expand icon (two arrows) in the column header to turn each Record into columns. Untick Use original column name as prefix for shorter headers.
  4. For columns that still show List (such as items), click the expand icon, choose Expand to New Rows, then expand the resulting records again.
  5. Set column types: right-click a header, choose Change Type > Text for IDs and codes. Then click Home > Close & Load.

Excel for Mac has been gaining Power Query data sources over time. If From JSON is not in your Data menu, use Method 1.

Google Sheets, Numbers and LibreOffice

  • Google Sheets has no built-in JSON import (IMPORTDATA only reads CSV and TSV). Convert to CSV, then use File > Import > Upload. Untick Convert text to numbers, dates, and formulas to keep leading zeros.
  • Apple Numbers opens CSV files directly with File > Open.
  • LibreOffice Calc shows a Text Import dialog when you open a CSV. Click a column and set Column type to Text for codes and IDs.

Five traps that silently corrupt your data

ProblemExampleFix
Leading zeros droppedZIP 02134 becomes 2134Import the column as Text
Long numbers rounded1234567890123456789 shows as 1.23457E+18Keep IDs as strings
Accents garbledCafé shows as CaféImport as UTF-8 or use .xlsx
Everything in one columnComma file on a semicolon localeMatch the delimiter
Day and month swapped03/04/2026Use ISO dates: 2026-03-04

Leading zeros. US ZIP codes in New England start with 0, as do many product codes and UK phone numbers stored without spaces. Excel treats them as numbers and drops the zeros. In Data > From Text/CSV, set Data Type Detection to Do not detect data types, or click Transform Data and change those columns to Text. Excel for Microsoft 365 on Windows also has File > Options > Data > Automatic data conversion, where you can turn off removing leading zeros.

Long numbers. Excel keeps only 15 significant digits, so a 16- to 19-digit order ID or social media post ID is rounded and displayed in scientific notation. There is an earlier limit too: most browser-based converters, AnyShift’s included, read JSON with JavaScript’s standard parser, which stores numbers as 64-bit floats. Integers above 9,007,199,254,740,991 lose precision while parsing, so 1234567890123456789 becomes 1234567890123456800. If you control the API, send IDs as strings ("id":"1234567890123456789"); many APIs already offer a string version of large IDs.

Garbled characters. Double-clicking a UTF-8 CSV in Excel for Windows can turn é into é. In Data > From Text/CSV, set File Origin to 65001: Unicode (UTF-8), or convert to .xlsx, which has no encoding ambiguity.

One-column CSVs. Excel splits a CSV using your system’s list separator. Where the regional format uses a decimal comma (much of continental Europe, and often French-language settings in Canada), that separator is a semicolon, so a comma-separated file lands in column A. Choose Semicolon in the converter, or pick the delimiter in the From Text/CSV dialog.

Date order. 03/04/2026 means 4 March in the US but 3 April in the UK and Australia, and Canadian files use both. Store dates as ISO 8601 (YYYY-MM-DD) in your JSON so nobody has to guess.

Going the other way: Excel to JSON

To turn a spreadsheet back into JSON, export it with the Excel to CSV Converter (each sheet becomes its own CSV), then paste the CSV into the CSV to JSON Converter. With Nest dotted headers on, a column named customer.name becomes {"customer":{"name":"Ada"}} again. Numbered columns such as items.0.sku come back as objects keyed "0", "1" rather than arrays, so tidy those by hand if your app expects a list. Detect numbers & booleans turns 42.5 and true into real JSON values; switch it off if you have codes with leading zeros.

FAQ

Can Excel open a JSON file directly?

Not by double-clicking, which only shows raw text. Use Data > Get Data > From File > From JSON in Excel for Microsoft 365 or Excel 2019 and later on Windows, or convert the JSON to CSV first.

How do I convert nested JSON to Excel?

Flatten it. A converter that uses dot notation turns {"customer":{"city":"Leeds"}} into a customer.city column. If nested arrays need to become separate rows, use Power Query’s Expand to New Rows.

How many rows can Excel hold?

A worksheet holds up to 1,048,576 rows and 16,384 columns. Larger exports need to be split, or loaded into the Power Query Data Model instead of a sheet.

Is it safe to convert confidential JSON online?

Only if the tool does not upload it. AnyShift’s JSON, CSV and Excel converters run entirely in your browser; open the Network tab in your browser’s developer tools and you will see no request carrying your data.

Should I save as CSV or XLSX?

Use CSV when another system will import the file: it is plain text with one sheet and no formatting. Use XLSX when people will open it: it keeps column types, multiple sheets and formatting, and avoids delimiter and encoding problems.

Why does my CSV open with everything in one column?

The file’s delimiter does not match Excel’s list separator for your region. Re-export with the matching delimiter, or open it through Data > From Text/CSV and choose the delimiter manually.

More Developer & Data tools

View all →