DataSwitch Pro Private, in-browser data converter

JSON to Excel Converter

Turn a JSON array into a real Excel workbook with typed cells, a bold frozen header and sensible column widths.

Copied to clipboard!
Rows
0
Columns
0
Delimiter
—
Input Size
0 B
Output Size
0 B
Speed
0 ms

How to convert JSON to Excel

Updated · 3 min read

API responses, database exports and log files usually arrive as JSON, but the people who need to read them often live in Excel. This tool converts a JSON array into an .xlsx file: every object becomes a row, every key becomes a column, and nested objects are spread into their own columns so nothing is hidden inside a cell.

  1. Paste your JSON, or drop a .json file onto the input box.
  2. Check the preview on the right — it shows the rows and columns the workbook will contain.
  3. Leave Flatten nested JSON to columns on to split nested objects into separate columns.
  4. Click Download to save the .xlsx file, or Copy and paste straight into Excel or Google Sheets.

Example

JSON input

[
  { "order": 1001, "customer": { "name": "Leila", "city": "Fes" }, "total": 149.5, "paid": true },
  { "order": 1002, "customer": { "name": "Tom", "city": "Lyon" }, "total": 80, "paid": false, "coupon": "WELCOME" }
]

Excel output

ordercustomertotalpaidcoupon
1001{"name":"Leila","city":"Fes"}149.5TRUE
1002{"name":"Tom","city":"Lyon"}80FALSEWELCOME

The nested customer object becomes two columns, customer.name and customer.city. The second order has a coupon that the first one lacks, so the column is added and the first row's cell is simply left empty.

Your data stays on your device. The conversion runs in JavaScript inside this tab — files and pasted text are never uploaded to DataSwitch Pro.

What the Excel file looks like

Nested objects and arrays

With flattening enabled, {"customer":{"address":{"city":"Fes"}}} becomes a column called customer.address.city. Arrays such as "tags":["new","sale"] are written into one cell as JSON text (["new","sale"]), which keeps every value without creating dozens of sparse columns. Turn flattening off to keep each nested object as JSON text in a single cell.

Which JSON shapes work

Excel limits to keep in mind

An Excel worksheet holds at most 1,048,576 rows and 16,384 columns, and a single cell can contain up to 32,767 characters. Larger datasets are better kept as CSV or loaded into a database — the JSON to CSV and JSON to SQL converters handle those cases.

Convert JSON to Excel in code

For one-off files the tool above is quickest. To automate the same task in a script or pipeline, these snippets are a good starting point.

Python (pandas)

import json
import pandas as pd  # pip install pandas openpyxl

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

pd.json_normalize(data).to_excel("data.xlsx", index=False)

Node.js (write-excel-file)

// npm install write-excel-file
import writeXlsxFile from "write-excel-file/node";
import { readFileSync } from "node:fs";

const data = JSON.parse(readFileSync("data.json", "utf8"));
const header = Object.keys(data[0]);
const rows = data.map(o => header.map(k => o[k] ?? null));
await writeXlsxFile([header, ...rows]).toFile("data.xlsx");

Frequently asked questions

Can I open the result in Google Sheets or LibreOffice?

Yes. The .xlsx format is supported by Google Sheets (File → Import), LibreOffice Calc, Apple Numbers and every recent version of Excel.

Will numbers be stored as numbers?

Yes. JSON numbers become numeric cells and JSON booleans become TRUE/FALSE, so formulas, sorting and charts work immediately. JSON strings remain text even if they look like numbers, which protects codes with leading zeros.

Can I create several sheets at once?

The converter creates one sheet per file. To build a multi-sheet workbook, convert each JSON array separately and move the sheets into one workbook in Excel.

Why does a cell contain text in square brackets?

That cell came from a JSON array. Arrays are written as JSON text so no values are lost; split them in Excel with Text to Columns if you need separate cells.

Is my JSON uploaded to a server?

No. The workbook is generated by JavaScript in your browser and saved directly to your device.

Related converters