How to convert Excel to JSON
- Drop your Excel file into the box or choose it. XLSX, XLS and ODS work, and several files at once.
- Leave First row has the column names ticked to get one object per row, or untick it for plain arrays of rows.
- Copy the JSON from the preview or download the .json file.
From rows to objects
Spreadsheets and JSON describe the same kind of data in different ways. A sheet is a grid where the first row usually names the columns. JSON, the format web APIs and most programming languages use, describes records as objects with named fields. Converting is a matter of reading the header row once and pairing every following row’s cells with those names.
Values keep their types: a number is written as a JSON number, a checkbox-style TRUE as true, and a date as ISO 8601 text, because JSON has no date type and ISO dates sort correctly and are understood everywhere. Rows and columns that are empty at the end of a sheet are left out.
Uses
- Seeding a database or app: keep content in a spreadsheet that anyone can edit, and convert it to JSON for the code.
- Mock data and tests: turn a sample sheet into fixtures.
- Static sites and charts: feed a table into a chart library or a site generator.
To go back from JSON to a spreadsheet, use JSON to Excel. For CSV files, use CSV to JSON. Spreadsheets are read with SheetJS Community Edition (Apache 2.0 licence).