Upload Excel File

Supports XLSX, XLS, CSV files

Last updated

Excel to JSON Conversion

Converting Excel files (.xlsx, .xls) to JSON makes spreadsheet data accessible to web applications and APIs. Each row in the spreadsheet becomes a JSON object, with column headers as keys. This is a common data migration task when moving from spreadsheet-based workflows to database-driven applications.

Excel File Structure

Modern Excel files (.xlsx) are ZIP archives containing XML files. The main data is in xl/worksheets/sheet1.xml, with shared strings in xl/sharedStrings.xml. Libraries like SheetJS (xlsx) handle this complexity and provide a simple API.

Converting with SheetJS

JavaScript
import * as XLSX from 'xlsx';

async function excelToJson(file) {
  const buffer = await file.arrayBuffer();
  const workbook = XLSX.read(buffer, { type: 'array' });

  const result = {};
  for (const sheetName of workbook.SheetNames) {
    const sheet = workbook.Sheets[sheetName];
    // Convert to array of objects (first row = headers)
    result[sheetName] = XLSX.utils.sheet_to_json(sheet, {
      header: 1,        // use first row as headers
      defval: null,     // default value for empty cells
      blankrows: false  // skip blank rows
    });
  }
  return result;
}

// Usage with file input
document.getElementById('fileInput').addEventListener('change', async (e) => {
  const file = e.target.files[0];
  const json = await excelToJson(file);
  console.log(JSON.stringify(json, null, 2));
});

Data Type Handling

Frequently Asked Questions

Yes, our Excel To Json is completely free with no registration required. Use it unlimited times without any restrictions.