You have data in a spreadsheet and you need it as JSON: to seed a database, feed an API, or drop it into a config file. This guide shows how to turn an Excel sheet into a clean array of objects, what each option does, and how to handle sheets without headers.
The short version: open the workbook, confirm your first row holds the column names, and you get back an array of objects keyed by those names. The Excel to JSON converter runs on your device, so the data never leaves your browser.
What “Excel to JSON” actually means
There is more than one way to represent a sheet as JSON, but one shape is by far the most useful: an array of objects, one per row. A sheet like this:
| name | quantity | price |
|---|---|---|
| Apples | 12 | 3.50 |
| Pears | 8 | 2.25 |
becomes:
[
{ "name": "Apples", "quantity": 12, "price": 3.5 },
{ "name": "Pears", "quantity": 8, "price": 2.25 }
]
The header row supplies the keys, every other row becomes an object, and the values keep their types: numbers stay numbers, text stays text. This is the format almost every API, framework and import routine expects, which is why it is the default.
Headers are the important decision
The single choice that matters is whether your first row contains column names. Most sheets do, and treating that row as headers gives you readable keys like name and price.
If your sheet is just raw data with no header row, using the first row as keys would consume a real data row and give you nonsense keys. In that case, switch the header option off. Each value is then keyed by its column position (A, B, C), and no row is lost. You can always rename those keys later in code.
A small but useful detail: when a header cell is blank, a sensible converter falls back to the column letter for that one column rather than producing an empty "" key, which would be awkward to reference.
How to convert a sheet to JSON
Step 1: Open the workbook
Drop your .xlsx or .xls file into the converter and pick the sheet you want.
Step 2: Confirm the header row
Leave “first row is the header” on if your top row holds column names. Turn it off for raw, header-less data.
Step 3: Copy or download the JSON
The result appears formatted and ready. Copy it straight into your code, or download it as a .json file.
Handling the messy parts
Real spreadsheets are rarely tidy. A few things worth knowing:
- Empty cells become empty strings, so every object has the same set of keys. Code that loops over the array will not hit a missing-property error.
- Duplicate header names are a problem in any key-value format, since an object cannot have two identical keys. Rename duplicate columns in the sheet before converting so each becomes its own field.
- Numbers that should be text. ZIP codes, phone numbers and IDs with leading zeros are worth checking. If a leading zero matters, store that column as text in Excel before converting, so it is not read as a plain number.
Common mistakes to avoid
- Leaving the header option on for a header-less sheet. You will lose your first data row and get meaningless keys. Turn it off for raw data.
- Expecting nested JSON. A sheet is flat, just rows and columns, so the output is flat too. If you need nested objects, convert first and reshape the array in code.
- Forgetting duplicate headers. Two columns named the same will collapse into one key. Give every column a distinct name first.
Going the other direction, building a spreadsheet from JSON your API returned? See how to convert JSON to Excel.