Skip to content
NeedToConvert

XLSX to JSON

Turn spreadsheet rows into JSON objects with real numbers, booleans and ISO dates, straight from the workbook.

  • Free
  • Private
  • No sign-up
Files are processed on your device and never uploaded.
Drop files here or click to browseAccepts XLSX, XLS, ODS. Up to 50 MB per file.
Options

Spreadsheets are where a lot of structured data starts life: product catalogues, translation tables, price lists, survey results. Getting it into an application usually means JSON. Going through CSV first loses information, because CSV has no types and freezes dates in whatever format the cell displayed. Reading the workbook directly keeps numbers as numbers, TRUE and FALSE as booleans and dates as unambiguous ISO 8601 strings.

Add .xlsx, .xls or .ods files, choose which sheets to read, and download one .json file per workbook. The workbook is parsed by SheetJS in a Web Worker inside your browser, and nothing is uploaded.

How rows become JSON

With First row is the header switched on, the first row of each sheet supplies the keys and every following row becomes an object. A sheet with name, price and in_stock columns turns into objects like {"name": "Tea", "price": 7, "in_stock": true}. Empty header cells are named column_1, column_2 and so on, a repeated header such as price becomes price_2, and empty cells become null so every object carries the same keys. With the header switched off, each sheet becomes an array of row arrays, the first row included.

Values are taken as stored, not as displayed: a cell showing 12.5% gives 0.125, and a price formatted as $1,200.00 gives 1200. Text stays text, booleans become true or false, and error cells such as #N/A or #DIV/0! are written as their error text. Empty rows and columns at the end of a sheet are dropped.

Good fits for Excel to JSON

Content managed in a spreadsheet

Teams often keep translations, FAQs, menus or product data in a shared workbook. Converting it to JSON gives developers a file to commit, load into a static site generator or ship with an app.

Seeding apps and test environments

A sheet of sample users, stores or prices becomes JSON fixtures for unit tests, a mock API or a database seed script, with types already correct.

Multi-sheet configuration

With All selected under Sheets, a workbook with Products, Categories and Settings tabs becomes one JSON object keyed by tab name, which maps neatly onto separate collections or tables.

Sheets, dates and output shape

Sheets offers All, First and By name. All returns an object whose keys are the sheet names. First returns that sheet's rows as an array. By name reads the sheets you list in Sheet names or numbers, separated by commas, for example Sales, 2: names are matched ignoring case, and numbers count tabs from 1. One sheet gives an array of rows; several give an object keyed by sheet name in the order you typed them.

Excel stores dates as serial numbers counted from 1900, or from 1904 in workbooks that use the old Mac date system, and both are handled. With Dates as ISO 8601 on, a date cell becomes YYYY-MM-DD, YYYY-MM-DDTHH:mm:ss when it has a time of day, or HH:mm:ss for a time alone. No time zone is added, because Excel does not store one. The fictional 29 February 1900, which Excel keeps for Lotus 1-2-3 compatibility, is written exactly as Excel shows it. Switch the option off to get the date text as formatted in the workbook.

Indent sets 2 spaces, 4 spaces or Minified output. Minified JSON contains no whitespace between tokens and is the smallest file to ship to a browser.

How to use this tool

  1. Drop .xlsx, .xls or .ods workbooks onto the box, or click to choose them; each can be up to 50 MB.
  2. In Options, set Sheets to All, First or By name, and type the sheet names or numbers when needed.
  3. Set First row is the header, Dates as ISO 8601 and the Indent.
  4. Press Convert, then download the .json file for each workbook, or all of them with Download all (.zip).

Things to know

  • Formulas are not recalculated; the result saved in the file is used.
  • Numbers follow Excel's precision of 15 significant digits. A long ID typed into Excel as a number was already rounded when it was entered, so store such IDs as text in the sheet.
  • Merged cells give their value to the top-left cell only, and formatting, comments and images are ignored.
  • Password-protected workbooks are not supported.
  • If none of the names typed under By name match a sheet, the conversion stops with an error instead of producing an empty file.

Frequently asked questions

How do I convert only one sheet?

Choose First for the first tab, or By name and type its name or position, such as Prices or 3. A single sheet is returned as a plain array of rows, without the object that wraps sheets by name.

Why is a date coming out as a number like 45000?

The cell holds a date serial but is not formatted as a date in the workbook, so nothing marks it as a date. Apply a date format to that column in Excel and convert again, and it becomes an ISO string.

Is the output an array or an object?

That depends on Sheets. All, or several named sheets, give an object keyed by sheet name; First or a single named sheet give an array. Each row is an object when First row is the header is on, or an array of cell values when it is off.

How is this different from CSV to JSON?

CSV to JSON works on text, where every value starts as a string and types have to be guessed. Reading the workbook uses the cell types Excel stored, so dates, booleans and numbers come through without guessing, and every sheet is available rather than only one.