Excel to JSON · 6 min read
Handle Merged Cells, Blank Rows, and Table Layouts When Converting Excel to JSON
Real-world Excel files rarely follow the clean, flat structure that JSON expects. Merged cells span multiple rows, blank rows separate sections, and headers span multiple columns. This guide explains how to handle these spreadsheet quirks using the Excel to JSON Converter.
Why Excel Layouts Break JSON Conversion
Excel is designed for visual presentation — human readability, not data interchange. Three common patterns cause problems:
- Merged cells — a single value displayed across multiple rows. Without handling, only the first row gets the value and the rest are blank.
- Blank separator rows — empty rows used as visual dividers. In JSON, empty rows become null objects or are omitted entirely.
- Multi-row headers — headers that span two or more rows. These need flattening into a single header row for JSON key names.
The converter handles all three automatically, producing clean JSON even from messy spreadsheets.
1. Merged Cell Handling
When an Excel cell is merged across multiple rows, only the top-left cell contains the value. Consider this sales spreadsheet:
Region | Product | Sales
North | Widget A | 12000
| Widget B | 8500
| Widget C | 9200
South | Widget A | 9500
| Widget B | 7200
In the raw spreadsheet, "North" is only in the first row. The converter fills the merged value down, producing:
[
{"region": "North", "product": "Widget A", "sales": 12000},
{"region": "North", "product": "Widget B", "sales": 8500},
{"region": "North", "product": "Widget C", "sales": 9200},
{"region": "South", "product": "Widget A", "sales": 9500},
{"region": "South", "product": "Widget B", "sales": 7200}
]
Every row now has a complete set of values, ready for data processing.
2. Blank Row Handling
Blank rows in Excel are often used as visual separators. The converter has two modes:
- Skip blanks (default): Completely empty rows are omitted from the JSON output. The row numbering in the array is sequential without gaps.
- Preserve as null: Blank rows become
nullentries in the array. This is useful when you need to compare row positions with the original spreadsheet.
For most use cases, skipping blanks produces cleaner JSON. Preserve nulls only when position tracking is critical.
3. Multi-Row and Styled Headers
Some Excel files use two header rows — one with a category like "Financial" and another with sub-headers like "Revenue" and "Cost". The converter:
- Treats the first row of the selected range as the JSON key names.
- Ignores font styles, colors, bold, and cell formatting — only the cell text value matters.
- Auto-detects whether the first row is a header (if it's visually distinct) or treats it as data.
For multi-row headers, the recommendation is to clean up the file first — use the inline table editor to merge or flatten the header rows into a single row before exporting.
Try the Free Excel to JSON Converter
Upload .xlsx files with merged cells, blank rows, and complex layouts. Clean JSON output. No server uploads.
Convert Excel to JSON Now →Best Practices for Excel to JSON Conversion
- Unmerge in Excel first. If possible, use Excel's "Unmerge Cells" feature before converting. This gives you full control over how merged values are distributed.
- Use a single header row. A clean, single-row header produces the most predictable JSON. Avoid stacked or multi-row headers.
- Remove blank rows. Delete visual separator rows in Excel before conversion for the cleanest output.
- Check the table preview. The converter shows a live table view of your Excel data — review it before exporting to catch layout issues.
- Combine with other tools. Use CSV to JSON for simple tabular data, and Excel to JSON for files with complex layouts and merged cells.
Frequently Asked Questions
How are merged cells handled during Excel to JSON conversion?
Merged cells are expanded back into individual cells with the merged value repeated in each row. The converter fills the merged value down through all previously merged cells so no data is lost in the JSON output.
What happens to blank rows in the Excel spreadsheet?
Blank rows are automatically skipped by default. You can also choose to keep them as null objects if you need to preserve the exact row numbering for comparison with the original spreadsheet.
How does the converter handle styled headers and column names?
The first row (header row) becomes the JSON object key names. Bold, colored, or formatted headers are ignored — only the cell text value is used as the key. This ensures clean, predictable JSON regardless of Excel styling.
Can I convert only a specific range of cells?
Not directly from the Excel file viewer. However, you can use the inline table editor to delete unwanted rows or columns before exporting. This lets you trim the data to the exact range you need.
Is my data safe when converting Excel to JSON?
100% safe. All processing happens in your browser. Your .xlsx file never leaves your computer. No server uploads, no storage, no tracking of your content.