ConvertCSV

How to Convert JSON to Excel (XLSX) Online and With Code

By Convert CSV Editorial TeamLast updated August 1, 2026

Convert JSON to Excel (XLSX) fast. See browser and script workflows, how to flatten nested JSON, preserve leading zeros, and avoid Excel’s type traps.

Why You Would Convert JSON to Excel

APIs speak JSON, but stakeholders live in Excel. Product managers want to filter, sort, and add columns; finance wants pivot tables; sales wants VLOOKUPs. Handing them a JSON file is a dead end. XLSX is the bridge.

The trick is doing the conversion once, cleanly, so you do not have to re-do it every week.

Two Ways to Do It

Pick based on the file size, sensitivity, and whether the job repeats.

ApproachBest for
Browser converter (JSON → CSV → Excel)One-off conversions, no coding
Python/Node scriptRecurring jobs, nested data, automation

Step-by-Step: In the Browser

The fastest path uses two Convert CSV Online tools.

  • Open the JSON to CSV Converter.
  • Paste the JSON or upload the .json file.
  • Download the resulting .csv.
  • Open the CSV to Excel Converter and drop the CSV in.
  • Download the .xlsx and open in Excel or Google Sheets.

Preview before download

Use the Online CSV Editor or Online XLSX Editor to check headers, types, and row count before sharing the file.

Step-by-Step: With Python

pandas turns a JSON array into an Excel file in three lines.

import pandas as pd

df = pd.read_json("orders.json", dtype={"order_id": str})
df.to_excel("orders.xlsx", index=False, sheet_name="Orders")

Flatten nested JSON

json_normalize turns nested keys into flat columns.

import json, pandas as pd

with open("orders.json") as f:
    data = json.load(f)

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

Multiple sheets

Group related datasets into one workbook.

with pd.ExcelWriter("report.xlsx") as w:
    orders.to_excel(w, sheet_name="Orders", index=False)
    customers.to_excel(w, sheet_name="Customers", index=False)

Step-by-Step: With Node.js

SheetJS (xlsx) writes XLSX from JSON arrays.

import * as XLSX from "xlsx";
import fs from "node:fs";

const data = JSON.parse(fs.readFileSync("orders.json", "utf8"));
const ws = XLSX.utils.json_to_sheet(data);
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, "Orders");
XLSX.writeFile(wb, "orders.xlsx");

Flattening Nested JSON

Excel is flat—rows and columns. Nested JSON needs a strategy.

  • Dot-notation columns: customer.name, customer.email.
  • Repeated rows: one Excel row per item in a nested array (a join).
  • JSON-in-cell: paste a JSON string into a single cell for reference (last resort).

Preserve Data Excel Loves to Break

Excel is famous for helpful auto-conversions that destroy data.

  • Leading zeros on IDs and postal codes.
  • Long numeric IDs turning into scientific notation.
  • Dates rewritten to the local locale.
  • Ambiguous strings like SEPT1 becoming dates.

How to prevent it

Force text types in your script (dtype=str in pandas), or import the CSV through Data → From Text/CSV in Excel and mark ID columns as Text.

Real-World Examples

The pattern shows up everywhere.

API dump for stakeholders

A developer fetches JSON from an API and hands it to marketing as an XLSX with filters ready.

Weekly report

A Python job pulls JSON from an internal service, writes a multi-sheet XLSX, and emails it to leadership.

Bug repro from logs

An engineer converts JSON logs to Excel to slice by user, region, or status.

Common Mistakes

Skip these to keep the file trustworthy.

  • Letting Excel auto-detect ID columns and losing zeros.
  • Ignoring nested structures and shipping a wall of "[object Object]".
  • Overwriting the master JSON with an Excel export that changed formats.
  • Not verifying row counts after conversion.
  • Emailing an XLSX with private data instead of using a secure sharing tool.

Best Practices

The habits that separate a one-off from a reliable pipeline.

  • Normalize JSON before writing to Excel.
  • Type IDs as strings.
  • Add a data dictionary sheet.
  • Save as .xlsx, not .xls (see the XLS vs XLSX guide).
  • Keep JSON as the source of truth; regenerate Excel from it.

Why Use Convert CSV Online?

Convert CSV Online is free, browser-based, and requires no account for everyday conversions. Chain JSON to CSV → CSV to Excel and preview in the Online XLSX Editor. Client-side workflows run on Windows, macOS, and Linux browsers.

Reproducible in seconds

Save the two-step flow as a habit for anyone on the team—no installs, no accounts.

Conclusion

Converting JSON to Excel is a one-time UX bridge that lets non-developers explore your data. Do it once, do it cleanly, and keep the JSON as the source of truth.

FAQ

How do I convert JSON to Excel?

In the browser, chain JSON to CSV → CSV to Excel with Convert CSV Online. In code, use pandas (Python) or SheetJS (Node.js) to write XLSX from a JSON array.

Can I convert nested JSON to Excel?

Yes. Flatten the nested keys with dot notation (e.g., customer.email) or use pandas.json_normalize before writing to XLSX.

How do I preserve leading zeros?

Force ID columns to string type before writing (dtype=str in pandas). In Excel, import via Data → From Text/CSV and mark those columns as Text.

Is it safe to convert JSON online?

Convert CSV Online processes files in your browser for everyday conversions, so data does not need to leave your machine.

Should I output XLS or XLSX?

Always XLSX. XLS is a legacy format with size limits and worse tooling.

Can I create multi-sheet workbooks?

Yes. Use pandas ExcelWriter with multiple to_excel calls, or SheetJS book_append_sheet to add sheets to a workbook.

References

Convert your CSV in the browser

Preview, clean, and convert CSV files free with Convert CSV Online—no installation and no account required for everyday conversions.