Shard Tools

XLSX to JSON

Turn an Excel sheet into a JSON array of objects in your browser, using the header row as keys.

Maintained by Roshan.

Use XLSX to JSON

Reads an Excel workbook in this tab and turns any sheet into JSON, using the first row as keys. Nothing is uploaded.

Dates are read as dates, not serial numbersExcel stores a date as a count of days and marks it as a date only through its cell format. A reader that ignores formatting turns every date into a five-digit number. This one reads the format, and it keeps text like a leading-zero postcode as text rather than turning 0123 into 123.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About XLSX to JSON

Developers reach for this when a spreadsheet is the source of truth for something a program has to consume: a product catalogue maintained by a colleague, a translation table, seed data for a database, a list of settings someone edits in Excel because that is the tool they have. The output here is an array of objects with the header row supplying the keys, which is the shape almost every consumer expects and the one that survives being pasted straight into code. Doing it in the browser matters for a reason beyond privacy: the spreadsheets that end up in this workflow are frequently internal, and pasting one into an unknown web service is the kind of thing that quietly violates a data policy.

Work through the input

  1. The workbook is unpacked in the tab. An .xlsx is a ZIP of XML parts, and the browser reads both without any spreadsheet library needing to be fetched.
  2. The first row of the chosen sheet becomes the object keys. A column with a blank header is given a stable generated name rather than being dropped, so no data goes missing silently.
  3. Every remaining row becomes one object. Rows that are entirely empty are skipped, since a trailing blank row is an artefact of editing rather than a record.
  4. Cells formatted as dates are read through their number format and emitted as readable date strings instead of the raw serial numbers Excel stores internally.
  5. Values are emitted as strings. A spreadsheet column mixes types freely, and guessing per cell produces a JSON array whose objects disagree about their own schema.

When xlsx to json is useful

Seed data maintained in a spreadsheet

Keep the sheet as the editable source and convert when you need to load it. Give every column a short, code-friendly header, since those become the object keys verbatim.

A catalogue export for a static site

Convert, then cast the numeric fields in your build step. Doing it there keeps the types consistent instead of depending on what each cell happened to contain.

Check the output

Questions about XLSX to JSON

Why are numbers quoted as strings?

Because guessing types cell by cell produces an inconsistent array - one object with a number and the next with a string under the same key. Casting in your own code is explicit and safe.

How are the keys chosen?

From the first row of the sheet, used verbatim. A column with an empty header gets a generated name so its data is not silently discarded.

What happens to dates?

They are read through the cell's number format and written as readable date strings, rather than the day-count serial numbers Excel stores.

Can I get nested JSON?

No. A sheet is a flat grid, so the output is a flat array of flat objects. Reshape it in code if you need nesting.

Related tools

XLSX to CSV

Convert an Excel .xlsx sheet to CSV in your browser. Dates stay dates, leading zeros survive, and the file never leaves your device.

CSV to JSON Converter

Convert CSV to a JSON array locally. Parse quoted commas, embedded newlines, BOM files, duplicate headers, sparse rows, and optional safe value types.

JSON Formatter and Validator

Format, minify, and validate JSON locally in your browser. Inspect keys, values, nesting depth, and root type without sending private API data to a server.