YamlBox

Data converters · 6 min read

Excel to JSON: turning workbooks into structured data

An Excel to JSON conversion is usually the first step of getting spreadsheet data into an application, a test fixture, or a spreadsheet-driven website. The awkward part is that a workbook is a rich document — formulas, formats, multiple sheets, dates stored as numbers — while JSON is plain data. Understanding the four breaks between them saves a lot of confused debugging.

Updated

What an XLSX file actually is

An `.xlsx` file is a ZIP archive of XML parts: sheets, shared strings, styles and relationships. That is why a converter can read it directly in the browser with no software installed — it unzips, parses the sheet XML and rebuilds rows as objects. It also explains why `.xls` (the older binary format) needs a different code path and why `.csv` exports lose everything except values.

Headers become keys, and formulas become values

As with CSV, the first non-empty row supplies property names. Formulas are the interesting case: a cell containing `=B2*C2` has both a formula and a cached result, and a converter reads the cached value because that is what the workbook displays. Open the file in Excel first if formulas were calculated elsewhere — a workbook saved by a tool that never computed them can carry stale or missing caches.

The date trap

Excel stores dates as serial numbers — days since 1899-12-30 — and the display value depends on the cell’s number format, which lives in a different XML part. A converter that ignores formats hands you `45231` for the tenth of November, and one that trusts formats can misread a ledger of plain numbers as dates. This is the single most common Excel to JSON complaint, so check one known date in the output against the sheet before porting anything.

Multi-sheet workbooks: decide up front whether you need the first sheet only, or a JSON object keyed by sheet name. Financial models often keep the reference data on a second sheet, and converting only the active one silently drops it.

Clean the grid before converting

  • Remove merged cells — they map to one value and a run of blanks, which is rarely what the consumer expects.
  • Delete title rows and totals rows so the table starts at its header and ends at its last data row.
  • Make headers unique and free of punctuation; they become property names.
  • Normalise empty cells deliberately: an empty cell means absent, unknown or zero, and JSON distinguishes all three.

The privacy argument for doing it locally

Spreadsheets are where organisations keep payroll, pricing, customer lists and forecasts. Uploading a workbook to a conversion website to get JSON back is a data-handling decision nobody needs to make: the YamlBox Excel to JSON converter parses the XLSX in the browser, so the file never leaves the machine, and it works with the network disconnected.

Excel to JSON — frequently asked questions

Why are my Excel dates coming through as numbers like 45231?

Excel stores dates as day counts from a 1900 epoch and keeps the display format separately. If the converter cannot see the cell format, it returns the raw serial. Format the column as an ISO date in the sheet, or convert the number yourself with the 1899-12-30 epoch.

Can I convert a workbook with several sheets?

Yes. Decide whether you want one sheet or all of them — multi-sheet output is usually a JSON object keyed by sheet name, while single-sheet output is an array of row objects. Reference sheets are a common casualty of converting only the first one.

Does converting XLSX to JSON upload my spreadsheet anywhere?

Not with a browser-based tool. The workbook is unzipped and parsed inside the page, so confidential figures never leave your device — and the conversion still works offline, which is the proof of that claim.

Tools mentioned in this post

Browse all 19 tools →

Keep reading

All 19 posts →