XLSX to JSON Converter
Convert Excel XLSX files to JSON format online. Configure key rows, column mapping, sheet selection, and data start rows for precise output.
About
XLSX files encode cell data across multiple XML documents compressed inside a ZIP archive. Extracting structured JSON from this format requires parsing shared string tables, resolving cell references in base-26 notation, and mapping row data against configurable key rows. Incorrect parsing produces silent data corruption - missing columns, shifted values, or type coercion errors that propagate downstream into databases and APIs. This tool performs real binary decompression and XML traversal in the browser. It supports custom keysRow assignment, explicit column-to-field mapping, and a configurable dataStartingRow parameter. Multi-sheet workbooks are handled as a three-dimensional structure: jsonArray[sheets][rows][cellValues].
The converter resolves shared strings from xl/sharedStrings.xml, reads cell types (string, number, boolean, date), and reconstructs sparse rows where empty cells exist. Limitations: password-protected workbooks and macro-enabled content (.xlsm) are not supported. Merged cell regions are read from the top-left cell only. Date serial numbers are converted assuming the 1900 date system (not the 1904 system used by some legacy Mac workbooks). Pro tip: if your spreadsheet uses formulae, only the cached result values are extracted - volatile functions may show stale data.
Formulas
Column letter references in XLSX are base-26 encoded. The conversion from a column string s of length n to a zero-based index i follows:
Where sk is the k-th character of the column string (e.g., "A" = 65 in ASCII, so charCode โ 64 = 1). The subtraction of 1 converts from one-based to zero-based indexing.
Excel date serial numbers are converted to ISO-8601 dates using the offset from the epoch 1899-12-30:
Where serialNumber is the numeric cell value. Note: the 1900 date system contains an intentional Lotus 1-2-3 compatibility bug treating 1900 as a leap year. Serial number 60 (1900-02-29) does not exist. Values โค 60 are offset by 1 day.
The JSON assembly follows the structure result = sheets[] โ rows[] โ object{key: value}. When keysRow is specified, cell values from that row become property names. When mapping is provided, it overrides keysRow with explicit field-to-column bindings.
Reference Data
| XLSX Internal File | Purpose | Key Data Extracted |
|---|---|---|
| [Content_Types].xml | Archive manifest | Content type declarations for all parts |
| xl/workbook.xml | Workbook structure | Sheet names, sheet order, rId references |
| xl/_rels/workbook.xml.rels | Relationship map | rId โ sheet file path mapping |
| xl/sharedStrings.xml | String deduplication table | All unique string values referenced by index |
| xl/worksheets/sheet1.xml | Sheet cell data | Row/column references, values, types |
| xl/styles.xml | Cell formatting | Number formats (used for date detection) |
| Cell Type Attribute | Meaning | JSON Output Type |
| t = "s" | Shared string reference | String (resolved from table) |
| t = "b" | Boolean | TRUE / FALSE |
| t = "n" or absent | Number | Number (float or integer) |
| t = "e" | Error value | String (e.g., "#REF!") |
| t = "str" | Inline formula string | String (formula result) |
| t = "inlineStr" | Inline rich text | Plain text (tags stripped) |
| Column Letter | Zero-Based Index | Base-26 Calculation |
| A | 0 | 1 โ 1 |
| Z | 25 | 26 โ 1 |
| AA | 26 | 26 ร 1 + 1 โ 1 |
| AZ | 51 | 26 ร 1 + 26 โ 1 |
| BA | 52 | 26 ร 2 + 1 โ 1 |
| XFD | 16383 | Maximum column in XLSX (Excel 2007+) |
| Option | Type | Description |
| sheet | Number / String / Array | Zero-based index, sheet name, or array of either. If unset, all sheets exported. |
| keysRow | Number (one-based) | Row whose cell values become JSON object keys |
| dataStartingRow | Number (one-based) | First row of actual data (rows above are skipped) |
| mapping | Object | Explicit fieldName โ column letter mapping |