Convert XLSX to JSON

Converting XLSX to JSON turns a spreadsheet into an array of objects a program can read, using the header row as the keys. It runs entirely in your browser, so a workbook full of prices or customer names is never uploaded anywhere.

  • Where it runs In your browser. The file is never uploaded.
  • Rebuilt JSON works differently from an XLSX, so this is not the gradual degradation a lossy codec applies. What JSON can express is reproduced faithfully; what it has no equivalent for does not survive at all.
  • File size limit Up to 100 MB per file, free, without an account.
  • Worth knowing Only the first sheet is read, and only its values. Formulas, formatting, column widths and every sheet after the first are left behind.

Up to 100 files at once. Mixed formats are fine.

The spreadsheet is the interface nobody designed

This conversion exists because of a pattern that repeats in every organisation: the authoritative version of something — a price list, a product catalogue, a translation table, a set of opening hours, a mapping of codes to names — lives in a spreadsheet maintained by somebody who is not a developer, and it has to reach a program that expects data.

That is a perfectly reasonable arrangement. A spreadsheet is a good editing interface, business users already know it, and building a small admin tool to replace it is rarely worth the effort. What it needs is a reliable conversion at the boundary, and that is the whole job here.

A grid becomes an array of objects

The mapping is the obvious one. The first row is treated as the header and supplies the key names; every row after it becomes one object; every cell becomes a value on that object. The result is an array of records, which is the shape a consuming program almost always wants.

It is worth thinking about the header row deliberately, because those cells become key names in your code. Short, lowercase, no spaces and no punctuation makes for keys that are pleasant to work with; a header that reads "Unit price (£, ex VAT)" produces something nobody wants to type twice.

Dates are the first thing that goes wrong

A spreadsheet does not store dates as dates. It stores a number counting days from an origin, and the cell formatting is what makes 45678 appear as a date on screen. Converting hands back what is actually in the file, which is the number.

The two ways round it are both deliberate. Format the column as text in the spreadsheet and type ISO dates into it, which makes the file self-describing and survives every conversion. Or transform the values after conversion, applying the day-count arithmetic yourself. Either is fine; discovering the problem after the data reaches production is not.

Leading zeros and long identifiers were lost before you started

A postcode, a product code, a bank sort code or a national identifier stored in a cell formatted as a number has already lost its leading zeros — Excel did that when the value was typed or imported, and the file contains a number.

The same applies to identifiers past fifteen digits, which lose their last digits to floating point in the spreadsheet itself. No converter can restore either, because the information is not in the file. The fix is upstream: those columns must be formatted as text in the spreadsheet, and it is worth telling whoever maintains it once rather than repairing the output every month.

What a spreadsheet has that JSON does not

Formulas, and you get their results — which is what you wanted, since a program has nothing to do with a formula. Formatting, colours, conditional rules and column widths, none of which is data. Charts, comments and merged cells, which have no equivalent.

Merged cells are the one worth watching. A merged header spanning three columns is a presentational device, and it produces an object with one key and two empty ones — which is a strange-looking record that came from a perfectly sensible-looking sheet. Flat headers, one cell per column, are what make this conversion boring, and boring is the goal.

Where it fits in a build

The common arrangement is to keep the spreadsheet as the editable source, convert to JSON as a step, and commit the JSON alongside the code. The data is then reviewable in a pull request, versioned, and available at build time without any runtime dependency on a file somebody might move.

Two habits make that work over time. Convert the same way every time so a diff shows real changes rather than reordering. And validate the result against a schema before it is committed, so a column renamed by a well-meaning colleague fails a check rather than silently producing objects with a missing field.

When CSV is the better target

If the destination is a database import, an analysis tool or a data pipeline, CSV is usually the better intermediate: it streams, every system reads it, and it does not impose a nesting structure on data that has none.

JSON earns its place when the data is going into application code — a front end, a configuration file, an API fixture — where an array of objects is what the language wants and the parse is one line. Choose by what reads the file rather than by which format is more modern.

The file stays on your machine

The conversion runs in the browser tab on your own processor, so nothing is uploaded and no server holds a copy. There is no account, no queue and no daily allowance; the size limit is 100 MB a file, a hundred files to a drop.

That is not incidental here. The spreadsheets people convert are internal: prices, margins, customer lists, staff records, unreleased catalogues. Not sending them anywhere is the simplest form of not having to trust anybody with them.

How to convert an XLSX spreadsheet to JSON

  1. Make sure the first row holds the column names you want as keys.
  2. Drop the XLSX onto this page; it converts in your browser.
  3. Download the JSON — an array of objects, one per row.

XLSX and JSON: a grid becomes a list of records

XLSX compared with JSON
XLSXJSON
Full nameExcel WorkbookJavaScript Object Notation
File extension.xlsx.json
Media typeapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/json
First published20072001
Published byMicrosoft
SpecificationECMA-376RFC 8259
LicensingOpen standardOpen standard
Standing todayCurrentCurrent
Opens in a browserNo browserEvery browser
Considered insteadCSV, ODS, ParquetXML, YAML, NDJSON

Opening the result

JSON opens in every current browser. XLSX has narrower browser support than that. If the file is going onto a web page or into a form, that is usually the whole reason for the conversion.

The usual programs do not overlap: XLSX opens in Microsoft Excel, LibreOffice Calc and Google Sheets, JSON in Visual Studio Code, jq and Postman — so whoever receives the result needs something from the second list.

What each format is for

The two are aimed at different work: XLSX at editing, JSON at moving data between programs and the web. That is worth weighing before converting, because the reason one exists is usually the reason the other is awkward.

XLSX is Microsoft's format, published in 2007. The specification is ECMA-376, and it is worth reading if the file has to outlive the tool that wrote it.

JSON dates from 2001, specified as RFC 8259. Visual Studio Code, jq and Postman all read it.

XLSX to JSON: types, dates and multiple sheets

Are my XLSX files uploaded anywhere?

No. This conversion runs entirely inside your browser, so the file never leaves your device. You can confirm it yourself: open the network tab of your browser's developer tools and convert something. You will see the page load, plus the analytics and advertising the site is paid for with — and nothing carrying your file. The engine behind this particular pair is SheetJS, a spreadsheet reader and writer in JavaScript; your browser fetches it once and caches it.

What shape does the JSON come out in?

An array of objects, one per row, with the first row used as the keys. That is the shape almost every consumer expects — a list of records — and it maps directly onto the way the data is arranged in the sheet.

Why did my dates become numbers?

Because that is what a spreadsheet stores. A date in Excel is a number counting days from an origin, and the formatting is what makes it look like a date. A conversion that hands back the raw value is being honest about the file; if you need ISO strings, the column has to be formatted as text or the values transformed afterwards.

Do leading zeros survive?

Only if the cell was formatted as text in the spreadsheet. A postcode or a product code stored as a number lost its leading zeros before the conversion ever ran, and no converter can restore what the file does not contain.

What happens to formulas?

You get their results, which is nearly always what is wanted. The formulas themselves are not carried over, because JSON has no way to express one and a consuming program would have nothing to do with it.

Are other sheets included?

The first sheet is converted. If a workbook holds several tables that all matter, the reliable approach is to split them into separate files, which also makes the pipeline easier to reason about later.

Is the spreadsheet uploaded anywhere?

No. The conversion runs inside your own browser, so the file never leaves your machine — which matters, since spreadsheets handed over by a business tend to contain prices, customer names and other things nobody intended to publish.

More about these formats