Excel to JSON: Complete Conversion Guide

Excel spreadsheets are everywhere in business, but modern web applications speak JSON. Whether you're importing customer data, migrating from legacy systems, or building APIs from Excel reports, knowing how to convert Excel to JSON is essential.

This guide covers everything from basic XLSX to JSON conversion to handling multiple sheets, formulas, merged cells, and data validation.

Why Convert Excel to JSON?

Excel (.xlsx, .xls) and JSON serve different ecosystems:

Excel excels at:

  • Business reporting and analysis
  • Data entry by non-technical users
  • Complex formulas and calculations
  • Visual formatting and charts

JSON excels at:

  • Web APIs and microservices
  • Modern web applications
  • NoSQL databases (MongoDB, CouchDB)
  • Configuration and data exchange

Common use cases:

  1. Import customer data - Load Excel lists into your application
  2. API development - Convert Excel mockups to JSON endpoints
  3. Database migration - Move Excel data to MongoDB or PostgreSQL JSONB
  4. Data integration - Sync Excel reports with web dashboards
  5. Testing - Generate JSON test fixtures from Excel sheets

Understanding Excel File Structure

Excel File Formats

.xlsx (Office Open XML)

  • Modern format (Excel 2007+)
  • XML-based (actually a ZIP containing XML files)
  • Supports 1,048,576 rows × 16,384 columns
  • Recommended for conversion

.xls (Binary Format)

  • Legacy format (Excel 97-2003)
  • Binary format
  • Supports 65,536 rows × 256 columns
  • Needs conversion to .xlsx first

.xlsm (Macro-Enabled)

  • Like .xlsx but contains VBA macros
  • Macros are ignored during JSON conversion

Excel Sheet Structure

Typical Excel sheet:

   A           B        C        D
1  Name        Age      City     Country
2  Alice       30       Paris    France
3  Bob         25       London   UK
4  Charlie     35       Tokyo    Japan

Resulting JSON:

[
  {
    "Name": "Alice",
    "Age": 30,
    "City": "Paris",
    "Country": "France"
  },
  {
    "Name": "Bob",
    "Age": 25,
    "City": "London",
    "Country": "UK"
  },
  {
    "Name": "Charlie",
    "Age": 35,
    "City": "Tokyo",
    "Country": "Japan"
  }
]

Key assumptions:

  • Row 1 = Headers (becomes JSON keys)
  • Rows 2+ = Data (becomes JSON objects)
  • Result = Array of objects

How to Convert Excel to JSON Online

The fastest method is jconvert.dev - processes files entirely in your browser.

Step-by-Step Conversion

1. Prepare your Excel file

Clean up your spreadsheet:

  • Ensure row 1 contains clear headers
  • Remove empty rows at the top
  • Delete unnecessary formatting
  • Clear merged cells (or handle them - see below)

Good Excel structure:

ID  | Name   | Email              | Active
----|--------|--------------------|---------
1   | Alice  | [email protected]  | TRUE
2   | Bob    | [email protected]    | FALSE

2. Upload your .xlsx file

  • Drag and drop your Excel file
  • Or click "Browse" to select
  • Files up to 10MB supported

3. Automatic processing

The converter automatically:

  • Extracts all sheets (or selected sheet)
  • Detects headers from row 1
  • Infers data types (numbers, booleans, dates)
  • Generates clean JSON structure

4. Preview and download

  • Preview shows formatted JSON
  • Download as .json file
  • Copy to clipboard for immediate use

Live Example

Excel data:

Product      | Price  | InStock
-------------|--------|--------
Laptop       | 1299.99| true
Mouse        | 29.99  | true
Keyboard     | 89.99  | false

Convert to JSON →

Expected output:

[
  {
    "Product": "Laptop",
    "Price": 1299.99,
    "InStock": true
  },
  {
    "Product": "Mouse",
    "Price": 29.99,
    "InStock": true
  },
  {
    "Product": "Keyboard",
    "Price": 89.99,
    "InStock": false
  }
]

Handling Multiple Sheets

Excel workbooks often contain multiple sheets. How should they be represented in JSON?

Option 1: Single Sheet Conversion

Convert only the active or selected sheet:

Excel workbook:

  • Sheet1: Customers
  • Sheet2: Orders
  • Sheet3: Products

JSON (Sheet1 only):

[
  {"id": 1, "name": "Alice"},
  {"id": 2, "name": "Bob"}
]

When to use: Most common scenario - you only need one sheet

Option 2: All Sheets as Object

Each sheet becomes a property:

JSON:

{
  "Customers": [
    {"id": 1, "name": "Alice"},
    {"id": 2, "name": "Bob"}
  ],
  "Orders": [
    {"orderId": "ORD-001", "customerId": 1},
    {"orderId": "ORD-002", "customerId": 2}
  ],
  "Products": [
    {"sku": "LAPTOP-01", "price": 1299.99},
    {"sku": "MOUSE-01", "price": 29.99}
  ]
}

When to use: Relational data across sheets, complete workbook export

Option 3: All Sheets as Array

JSON:

[
  {
    "sheetName": "Customers",
    "data": [
      {"id": 1, "name": "Alice"}
    ]
  },
  {
    "sheetName": "Orders",
    "data": [
      {"orderId": "ORD-001", "customerId": 1}
    ]
  }
]

When to use: When sheet names are dynamic or you need to iterate through sheets

Data Type Handling

Excel has rich data types. JSON has limited types. Here's how they map:

Numbers

Excel:

  • Integers: 123
  • Decimals: 123.45
  • Scientific: 1.23E+10
  • Currency: $1,299.99
  • Percentages: 15%

JSON (all become numbers):

{
  "integer": 123,
  "decimal": 123.45,
  "scientific": 12300000000,
  "currency": 1299.99,
  "percentage": 0.15
}

Note: Currency symbols and thousand separators are stripped

Dates

Excel: Stores dates as numbers (days since 1900-01-01)

  • Display: 2026-02-26
  • Internal: 46044 (days)

JSON options:

Option 1: ISO 8601 string

{"date": "2026-02-26T00:00:00.000Z"}

Option 2: Unix timestamp

{"date": 1740528000000}

Option 3: Keep Excel serial number

{"date": 46044}

Recommendation: ISO 8601 for readability, Unix timestamp for APIs

Booleans

Excel:

  • TRUE, FALSE
  • 1, 0 (sometimes used as booleans)

JSON:

{"active": true, "deleted": false}

Text

Excel: Any text value

JSON: String

{"name": "Alice Smith", "note": "Important customer"}

Special case - leading zeros:

Excel: 00123 (display) / 123 (value)

Problem: Leading zeros are lost unless formatted as text

Solution: Format cells as text in Excel before export

Formulas

Excel: =SUM(A1:A10)

JSON: Only the calculated value is exported

{"total": 12345}

Note: Formulas themselves are not preserved - only results

Empty Cells

Excel: Empty cell

JSON options:

  • null - Standard approach
  • "" - Empty string
  • Omit key entirely
{
  "name": "Alice",
  "age": null,
  "city": ""
}

Handling Complex Excel Features

Merged Cells

Excel with merged cells:

 A      B      C
----------------
Name           | Age
Alice Smith    | 30

Problem: Cell A1 and B1 are merged

Solution 1: Unmerge before conversion

 A          B       C
-------------------------
Name       Name    Age
Alice      Smith   30

Solution 2: Take first cell value

[{"Name": "Alice Smith", "Age": 30}]

Best practice: Avoid merged cells in data tables

Multiple Header Rows

Excel:

Section A
Name      | Age
----------|-----
Alice     | 30

Problem: Row 1 is a section header, row 2 is actual headers

Solution: Skip section headers, use row 2 as headers

Manual fix: Delete or hide section header rows before export

Pivot Tables

Problem: Pivot tables have complex structure not suitable for direct JSON

Solution:

  1. Convert pivot table to regular table (Copy → Paste Values)
  2. Then convert to JSON

Charts and Images

Problem: Charts and embedded images can't be represented in JSON

Solution: They're ignored during conversion (data only)

Hyperlinks

Excel: Cell contains hyperlink https://example.com

JSON options:

Option 1: URL only

{"website": "https://example.com"}

Option 2: Object with text and URL

{"website": {"text": "Visit Site", "url": "https://example.com"}}

Note: Most converters extract URL only

Named Ranges

Excel: Named range SalesData refers to A1:D100

JSON: Named ranges are not preserved - only the data itself

Real-World Examples

Example 1: Customer List

Excel:

CustomerID | FirstName | LastName | Email              | JoinDate
-----------|-----------|----------|--------------------|-----------
C001       | Alice     | Smith    | [email protected]  | 2024-01-15
C002       | Bob       | Johnson  | [email protected]    | 2024-02-20

JSON:

[
  {
    "CustomerID": "C001",
    "FirstName": "Alice",
    "LastName": "Smith",
    "Email": "[email protected]",
    "JoinDate": "2024-01-15T00:00:00.000Z"
  },
  {
    "CustomerID": "C002",
    "FirstName": "Bob",
    "LastName": "Johnson",
    "Email": "[email protected]",
    "JoinDate": "2024-02-20T00:00:00.000Z"
  }
]

Use case: Import into CRM system via REST API

Example 2: Product Inventory

Excel:

SKU       | Product  | Price   | Quantity | InStock
----------|----------|---------|----------|--------
LAP-001   | Laptop   | 1299.99 | 15       | TRUE
MOU-001   | Mouse    | 29.99   | 150      | TRUE
KEY-001   | Keyboard | 89.99   | 0        | FALSE

JSON:

[
  {
    "SKU": "LAP-001",
    "Product": "Laptop",
    "Price": 1299.99,
    "Quantity": 15,
    "InStock": true
  },
  {
    "SKU": "MOU-001",
    "Product": "Mouse",
    "Price": 29.99,
    "Quantity": 150,
    "InStock": true
  },
  {
    "SKU": "KEY-001",
    "Product": "Keyboard",
    "Price": 89.99,
    "Quantity": 0,
    "InStock": false
  }
]

Use case: Sync with e-commerce platform

Example 3: Multi-Sheet Workbook

Excel Workbook:

Sheet "Users":

ID | Name
---|------
1  | Alice
2  | Bob

Sheet "Orders":

OrderID | UserID | Amount
--------|--------|-------
ORD-001 | 1      | 99.99
ORD-002 | 2      | 149.99

JSON (all sheets):

{
  "Users": [
    {"ID": 1, "Name": "Alice"},
    {"ID": 2, "Name": "Bob"}
  ],
  "Orders": [
    {"OrderID": "ORD-001", "UserID": 1, "Amount": 99.99},
    {"OrderID": "ORD-002", "UserID": 2, "Amount": 149.99}
  ]
}

Use case: Complete data export for migration

Best Practices

1. Clean Your Excel Data First

Before converting:

  • Remove blank rows/columns
  • Unmerge cells
  • Delete unnecessary formatting
  • Ensure consistent data types per column
  • Check for hidden rows/columns

2. Use Clear Headers

Bad headers:

col1 | col2 | col3

Good headers:

customerName | email | registrationDate

Headers become JSON keys - make them descriptive and programming-friendly

3. Standardize Date Formats

Choose one date format in Excel and stick with it:

  • ISO 8601: 2026-02-26
  • US: 02/26/2026
  • EU: 26/02/2026

Tip: Use Excel's TEXT() function to format dates before export

4. Handle Missing Data Consistently

Decide how to represent missing values:

  • Leave cells empty → null in JSON
  • Use "N/A" → string "N/A" in JSON
  • Use 0 for numbers → number 0 in JSON

Be consistent across your dataset

5. Test with Sample Data

Export a small sample first:

  • Verify structure
  • Check data types
  • Confirm handling of special cases

Then export the full dataset

Common Issues and Solutions

Issue 1: Dates Become Numbers

Problem:

{"date": 46044}

Cause: Excel stores dates as serial numbers

Solution: Most converters auto-detect and format to ISO 8601. If not, format in Excel first:

=TEXT(A1, "YYYY-MM-DD")

Issue 2: Leading Zeros Lost

Excel: 00123
JSON: 123

Cause: Excel treats it as a number

Solution: Format cell as Text in Excel before conversion

Issue 3: Large Numbers Become Scientific Notation

Excel: 12345678901234567890
JSON: 1.234567890123456789e+19

Cause: Number precision limits

Solution: Store as text in Excel if exact value needed

Issue 4: Special Characters Break

Excel: Contains emojis, accents, or Unicode

Solution: Ensure UTF-8 encoding during export (most modern converters handle this)

Issue 5: File Too Large

Problem: 50MB+ Excel file

Solution:

  • Split into multiple sheets/files
  • Filter to relevant columns only
  • Use server-side tools for massive files

Tools and Resources

Online Converters

jconvert.dev (recommended)

  • ✅ 100% client-side (privacy-first)
  • ✅ Multi-sheet support
  • ✅ Automatic type detection
  • ✅ Up to 10MB files
  • ✅ Free, no registration

Programming Libraries

Python (openpyxl):

import openpyxl
import json

wb = openpyxl.load_workbook('data.xlsx')
sheet = wb.active

headers = [cell.value for cell in sheet[1]]
data = []

for row in sheet.iter_rows(min_row=2, values_only=True):
    data.append(dict(zip(headers, row)))

with open('output.json', 'w') as f:
    json.dump(data, f, indent=2)

JavaScript (xlsx):

const XLSX = require('xlsx');
const fs = require('fs');

const workbook = XLSX.readFile('data.xlsx');
const sheetName = workbook.SheetNames[0];
const sheet = workbook.Sheets[sheetName];

const data = XLSX.utils.sheet_to_json(sheet);

fs.writeFileSync('output.json', JSON.stringify(data, null, 2));

Node.js (SheetJS):

const xlsx = require('node-xlsx');
const fs = require('fs');

const sheets = xlsx.parse('data.xlsx');
const data = sheets[0].data;

const headers = data[0];
const jsonData = data.slice(1).map(row => {
  const obj = {};
  headers.forEach((header, i) => {
    obj[header] = row[i];
  });
  return obj;
});

fs.writeFileSync('output.json', JSON.stringify(jsonData, null, 2));

Frequently Asked Questions

Q: Can I convert .xls (old Excel) files?
A: Yes, but convert to .xlsx first in Excel (Save As → .xlsx format)

Q: Are formulas preserved in JSON?
A: No, only the calculated values. Formulas are Excel-specific.

Q: How are multiple sheets handled?
A: Depends on the tool - either select one sheet or export all as nested JSON

Q: What about Excel macros?
A: Macros are ignored - they're VBA code, not data

Q: Can I convert back from JSON to Excel?
A: Yes! Use JSON to Excel converter →

Q: Is my data stored when using online converters?
A: With jconvert.dev, no - everything happens in your browser

Conclusion

Converting Excel to JSON is straightforward for clean data but requires attention to detail for complex spreadsheets. Key takeaways:

  1. Clean your Excel data before converting
  2. Use clear headers that make good JSON keys
  3. Be aware of data type conversions (especially dates)
  4. Test with samples before full export
  5. Choose the right tool - jconvert.dev for simplicity and privacy

Whether you're importing data to a web app, feeding APIs, or migrating to modern databases, mastering Excel to JSON conversion streamlines your workflow.

Ready to convert? Try jconvert.dev now →


Related Guides


Last updated: February 26, 2026