Back to Updates
DevTool Team

How to Convert JSON to Excel: Online Tools, Power Query, and Python Compared

Convert JSON to Excel step by step. See exactly how nested objects become columns, how arrays are exported, and when to use an online converter, Excel Power Query, or Python.

Why JSON to Excel Is Harder Than It Looks

JSON and Excel disagree about shape. JSON is a tree: objects contain objects, arrays contain objects that contain more arrays. A worksheet is a rectangle: rows and columns, one value per cell.

Every JSON to Excel conversion is therefore a set of decisions, not a single mechanical step:

  • Which part of the document is the table? An API response usually wraps the real rows in a field like data or results.
  • What happens to a nested object? It has to become extra columns.
  • What happens to an array? A cell cannot hold three values, so something has to give.
  • What happens to null, to very large integers, to booleans?

Tools that hide these decisions produce a spreadsheet quickly and quietly get some of them wrong. This guide shows what each decision actually does to your data, so you can check the result instead of trusting it.

The Three Practical Methods

Method Best for Cost
Online converter A one-off file or API response you need in Excel now No setup; check whether the tool uploads your data
Excel Power Query An import you want to refresh later from the same source Learning the expand steps; lives inside a workbook
Python (pandas) Scheduled jobs and pipelines Requires an environment; overkill for a single file

The rest of this guide walks through the online path in detail, then shows when the other two are the better answer.

Step 1: Find the Table Inside Your JSON

Real API responses rarely put the rows at the top level. They look like this:

{
  "data": [
    { "id": 1024, "name": "Alice Chen", "active": true },
    { "id": 1025, "name": "Bob Miller", "active": false }
  ],
  "page": 1,
  "total": 2
}

The rows are at data. The fields page and total are metadata about the response, not columns.

A good converter detects this automatically by looking for common wrapper names — data, items, records, rows, results, list — and picks the array it finds. When your API uses a different name, or nests the array deeper, you set the root path yourself with a simple dot path such as response.payload.orders.

If you point the tool at the whole document instead of the array, you get one row with a cell containing the entire JSON blob. That is the single most common reason a conversion "looks broken".

Step 2: Understand How Nesting Becomes Columns

Take a record with a nested object, an array of strings, and an array of objects:

{
  "data": [
    {
      "id": 1024,
      "name": "Alice Chen",
      "active": true,
      "score": null,
      "address": { "city": "Berlin", "zip": "10115" },
      "tags": ["pro", "beta"],
      "orders": [
        { "sku": "A-1", "qty": 2 },
        { "sku": "B-7", "qty": 1 }
      ]
    },
    {
      "id": 1025,
      "name": "Bob Miller",
      "active": false,
      "score": 91.5,
      "address": { "city": "Paris", "zip": "75001" },
      "tags": [],
      "orders": [{ "sku": "C-3", "qty": 5 }]
    }
  ]
}

Converted with default settings, that produces this table:

Id Name Active Score City Zip Tags Orders
1024 Alice Chen TRUE Berlin 10115 ["pro","beta"] [{"sku":"A-1","qty":2},{"sku":"B-7","qty":1}]
1025 Bob Miller FALSE 91.5 Paris 75001 [] [{"sku":"C-3","qty":5}]

Three things in that table are worth reading closely.

Nested objects became columns, and the header is the last segment. The source path is address.city, but the column header is City. That is deliberate: address.city as a header is accurate and unreadable, and most spreadsheets are read by people. The full dot path stays visible in the mapping panel so you always know where a column came from.

The trade-off appears when two branches end in the same word. If your record has both user.name and company.name, you get two columns both headed Name. Rename one in the mapping panel before you send the file to anyone.

null became an empty cell. Not the text null, not the number zero. Alice's score is genuinely absent, and an empty cell is how a spreadsheet says that. This matters because =AVERAGE() skips empty cells but happily averages in a zero.

Types survived. 91.5 is a number in the .xlsx file, not the string "91.5". true and false are booleans, which is why Excel displays them as TRUE and FALSE and lets you filter on them. Converters that write everything as text force you to re-type every column after import.

Step 3: Decide What Arrays Should Become

The tags and orders columns above are still JSON text, which is honest but not useful in a spreadsheet. There are three ways to represent an array in a single cell, and the right one depends on what you plan to do with the file.

Keep the JSON text (the default). Nothing is lost. Use this when the spreadsheet is an intermediate artifact and something downstream will parse the cell again.

Join the values. ["pro","beta"] becomes pro, beta. An empty array becomes an empty cell. This is the right choice when a human is reading the sheet and the array holds simple labels.

Count the items. ["pro","beta"] becomes 2, and an empty array becomes 0. Use this when you are building a report and the question is "how many", not "which ones". Because the result is a real number, you can sum and sort the column immediately.

Source value Keep JSON Join Count
["pro","beta"] ["pro","beta"] pro, beta 2
[] [] (empty) 0
[{"sku":"A-1"},{"sku":"B-7"}] full JSON text {"sku":"A-1"}, {"sku":"B-7"} 2

Notice the last row: joining an array of objects produces something no one wants to read. When your array holds objects rather than labels, none of these three options is right — you want a second worksheet instead. That is covered in JSON Arrays to Excel.

Step 4: Watch Out for Large Numbers

This one silently destroys data and almost no converter mentions it.

JavaScript numbers, and Excel's own display, cannot hold integers beyond about 15–16 significant digits exactly. An order ID like 9007199254740993123 will come back as 9007199254740993000 if it is handled as a number anywhere along the way. Nothing errors. The file opens fine. The IDs are simply wrong.

The fix is to write oversized integers as text rather than numbers:

Field Value in JSON Value in Excel Type
orderId 9007199254740993123 9007199254740993123 Text
small 42 42 Number

Only integers of 16 digits or more are treated this way. Ordinary numbers stay numeric so you can still calculate with them. If you ever paste a long ID into a spreadsheet and see it end in zeros, this is what happened.

Step 5: Check the Preview Before You Download

The most useful habit in any conversion workflow is looking at the table before you download it. Specifically:

  1. Is the row count what you expect? If you have one row and a huge cell, your root path is wrong (Step 1).
  2. Are the columns you care about present, or did a field only exist on some records?
  3. Are numeric columns right-aligned? If they are left-aligned, they came through as text.
  4. Did any column header collide with another (two columns named Name)?
  5. Are long IDs intact all the way to the last digit?

A converter that lets you edit the preview — rename a header, delete a column you do not need, fix one wrong cell — saves a round trip through Excel afterwards.

Skip the setup entirely: our free JSON to Excel converter does all five steps in the browser. It detects the array root, flattens nested objects, lets you choose how arrays are exported, shows an editable preview, and generates the .xlsx locally — the JSON is never uploaded to a server.

When to Use Excel Power Query Instead

Power Query is the right tool when the conversion is not a one-off.

Use it when:

  • The data comes from a URL that will change, and you want to hit refresh instead of re-converting.
  • The workbook is a recurring report that other people open.
  • You need to join the JSON against other tables already in the workbook.

Skip it when you just want the file once. Power Query makes you expand each nested level by hand through the UI, and a record with four levels of nesting means a lot of clicking.

When to Use Python Instead

Reach for code when the conversion has to repeat without you.

import json
import pandas as pd

with open("response.json", encoding="utf-8") as f:
    payload = json.load(f)

# json_normalize flattens nested objects into dot-notation columns
df = pd.json_normalize(payload["data"], sep=".")

df.to_excel("output.xlsx", index=False, sheet_name="Export")

pd.json_normalize handles nested objects well. Arrays of objects need an explicit decision, the same one as Step 3:

# One row per order, carrying the parent id along
orders = pd.json_normalize(
    payload["data"],
    record_path="orders",
    meta=["id", "name"],
)

with pd.ExcelWriter("output.xlsx") as writer:
    df.to_excel(writer, sheet_name="Customers", index=False)
    orders.to_excel(writer, sheet_name="Orders", index=False)

Two things to watch for in the Python path. to_excel requires openpyxl installed. And pandas will happily read a 19-digit ID as a float and round it, so pass dtype=str for those columns or convert before writing.

Choosing Between JSON to Excel and JSON to CSV

They are adjacent, not identical.

.xlsx .csv
Data types Numbers, booleans, dates keep their type Everything is text
Multiple sheets Yes No, one table per file
Formatting Frozen header row, filters, column widths None
Encoding problems None; encoding is defined by the format Common, especially with non-ASCII text in Excel
Diff-friendly / scriptable Poor Excellent
Import into other tools Widely supported Universally supported

Pick .xlsx when a person will open the file. Pick .csv when a program will. If your data has non-ASCII characters and your audience uses Excel, .xlsx avoids the mojibake problem entirely — see the JSON to CSV guide for the encoding workarounds CSV requires.

Common Problems and What Causes Them

One row, one enormous cell. The root path points at the whole document instead of the array. Set the root path to the field holding your records.

Columns missing for some records. The converter builds the column set from the fields it actually sees. If only 3 of 500 records have an email field, the column exists but is mostly empty — that is correct behavior, and it tells you something about your data.

Two columns with the same header. Two different paths end in the same segment. Rename one in the mapping panel.

Long IDs ending in zeros. Precision loss on integers past 15–16 digits. Use a converter that writes them as text, or quote them in the source JSON.

Numbers that will not sum. They came through as text. Check alignment: text is left-aligned by default, numbers right-aligned.

Browser tab freezes on a huge file. Client-side conversion is bounded by browser memory. Exact limits depend on the device and browser, so there is no single safe file size to quote. Split the input or switch to the Python path.

Frequently Asked Questions

How do I convert a JSON file to Excel?

You have three practical options. An online converter is fastest for a one-off file: paste the JSON or upload the file, check the preview table, and download an .xlsx. Excel's built-in Power Query works well when you want the import to refresh later from the same source. Python with pandas is best when the conversion needs to run on a schedule or inside a data pipeline. For a single API response or export, the online converter is almost always the shortest path.

Is it safe to convert JSON to Excel online?

It depends entirely on the tool. Many converters upload your file to a server for processing, which is a problem if the JSON contains customer records, credentials, or internal identifiers. Browser-based converters do the parsing and .xlsx generation locally with JavaScript, so the data never leaves your machine. Check the tool's description before pasting anything sensitive, and prefer local processing for production data.

Do I need Microsoft Excel installed to produce an .xlsx file?

No. The .xlsx format is an open packaging standard, so converters, scripts, and libraries can write valid workbooks without Excel being present. The resulting file opens in Excel, Google Sheets, LibreOffice Calc, Numbers, and WPS Office. You only need Excel itself if you plan to use Excel-specific features such as Power Query refresh or macros.

Should I convert JSON to Excel or to CSV?

Choose .xlsx when a person will open the file, because it keeps numbers numeric, booleans boolean, and supports multiple sheets, frozen headers, and filters. Choose .csv when a program will read it, because it is plain text, diff-friendly, and universally importable. If the data contains non-ASCII text and the audience uses Excel, .xlsx also avoids the character-encoding problems that plague CSV.

Why does my converted file have only one row?

The converter was pointed at the whole JSON document instead of the array holding your records, so the entire document became a single row with one very large cell. Set the root path to the field containing the records, typically data, items, results, or rows. This is the most common reason a conversion looks broken.

How do I convert JSON Lines (.jsonl) to Excel?

JSON Lines stores one JSON object per line and is not a single valid JSON document, so most parsers reject it outright. Wrap the content in an array by adding an opening bracket at the top, a closing bracket at the bottom, and commas between records, and it converts like ordinary JSON. In Python, read it directly with pd.read_json(path, lines=True).

Summary

Converting JSON to Excel is a series of decisions about shape: where the table lives, how nesting becomes columns, what arrays turn into, and which values need protecting from the spreadsheet itself. Once you know what each decision does, checking a conversion takes about thirty seconds.

For a single file, use an online converter and read the preview. For a refreshable report, use Power Query. For anything scheduled, write the ten lines of pandas.

Convert JSON to Excel now → — free, runs entirely in your browser, no upload and no signup.