Excel to JSON Converter
Convert XLSX Excel files to JSON online. Supports type annotations, nested objects, arrays, hash/array output, and master-slave sheet relationships.
Drop your .xlsx file here or click to browse
All processing happens in your browser. No data leaves your device.
About
Incorrect data format conversion between Excel spreadsheets and JSON causes silent failures in data pipelines, misconfigured game assets, and broken API integrations. A single mistyped cell or wrong column type annotation can propagate NULL values across thousands of records. This converter parses .xlsx files entirely in your browser, interpreting header-row type annotations (#string, #number, #bool, #date, #[], #{}, #id) to produce structured JSON. It handles master-slave sheet relationships where complex columns are split into separate sheets, resolving foreign key references via #id and #id[] columns. Output format is determined automatically: a JsonHash keyed by the #id column when present, or a JsonArray otherwise. The tool approximates the xlsx2json specification assuming well-formed XLSX files exported from Excel, Google Sheets, or LibreOffice. Sheets prefixed with ! and columns prefixed with ! are excluded from output.
Formulas
The converter determines output format based on header annotations. The decision logic follows:
For JsonHash output, each row is keyed by its #id value: output[rowid] = rowObject. For master-slave resolution, the slave sheet name follows the pattern slaveName@masterName. If the slave contains a #id column, each slave row merges into the corresponding master row as a nested object. If the slave contains a #id[] column, slave rows with matching IDs are grouped into an array under the master row.
Type coercion for auto-detected cells without explicit annotation uses the rule chain: if the value matches parseFloat(v) ≠ NaN → number. If v ∈ {TRUE, FALSE, true, false} → boolean. If v = "" → null. Otherwise → string.
Reference Data
| Type Annotation | Header Format | Description | Example Cell Value | JSON Output |
|---|---|---|---|---|
| #string | name#string | Force string type | 123 | "123" |
| #number | age#number | Force numeric type | 25 | 25 |
| #bool | active#bool | Boolean type | TRUE | true |
| #date | created#date | Date string (ISO format) | 2024/1/15 | "2024-01-15" |
| #[] | tags#[] | Array (JS literal syntax) | ["a","b","c"] | ["a","b","c"] |
| #{} | config#{} | Object (JS literal syntax) | {key:"val"} | {"key":"val"} |
| #id | id#id | Primary key → hash output | 1001 | Key in hash map |
| #id[] | id#id[] | FK array (slave sheets only) | 1001 | Grouped under master ID |
| ! prefix | !notes | Skip column (not exported) | Any | Excluded |
| (auto) | score | Auto-detect: number, bool, string | 99.5 | 99.5 |
| Sheet ! | !draft | Skip entire sheet | - | Excluded |
| Slave sheet | items@master | Slave linked to master sheet | - | Merged into master |
| null | Any | Empty cell | (empty) | null |