XLSX Parsing API

Parse Excel spreadsheets to structured JSON. Merged cells, every sheet of the workbook, formulas and cell text are kept, and the same file always gives the same result.

Spreadsheets Are Structured Data Trapped in a Visual Layout

An .xlsx file is a zip archive of SpreadsheetML, the XML format that records cells, types, formulas and merged ranges. Many parsers flatten this into CSV or plain text, which loses merged cells, the split into sheets and cell types.

AILANG Parse reads SpreadsheetML directly. Merged cells, which Excel records as mergeCell ranges, are marked on each cell with gridSpan (across columns) and vMerge (down rows). Text that Excel stores once and reuses (shared strings) is filled back into each cell. Each sheet becomes its own section with its table intact.

Merged cells are easily lost when a spreadsheet is flattened. A financial report with merged region headers turns into a flat grid that is hard to read. AILANG Parse keeps track of which cells are merged. See table extraction details.

Raw SpreadsheetML vs Structured Output

Raw sheet1.xml + sharedStrings.xml
<!-- sharedStrings.xml -->
<sst count="6">
  <si><t>Region</t></si>
  <si><t>Q1</t></si>
  <si><t>Q2</t></si>
  <si><t>EMEA</t></si>
  <si><t>APAC</t></si>
</sst>

<!-- sheet1.xml -->
<mergeCells count="1">
  <mergeCell ref="A1:A2"/>
</mergeCells>
<sheetData>
  <row r="1">
    <c r="A1" t="s"><v>0</v></c>
    <c r="B1" t="s"><v>1</v></c>
    <c r="C1" t="s"><v>2</v></c>
  </row>
  <row r="2">
    <c r="B2"><v>125000</v></c>
    <c r="C2"><v>140000</v></c>
  </row>
  <row r="3">
    <c r="A3" t="s"><v>4</v></c>
    <c r="B3"><v>143000</v></c>
    <c r="C3">
      <f>SUM(B2:B3)</f>
      <v>268000</v>
    </c>
  </row>
</sheetData>
Structured output
{
  "metadata": {
    "title": "Q1-Q2 Revenue",
    "sheets": ["Revenue", "Summary"]
  },
  "blocks": [
    {
      "type": "heading",
      "level": 2,
      "text": "Revenue"
    },
    {
      "type": "table",
      "headers": [
        {"text": "Region", "vMerge": "restart"},
        {"text": "Q1"},
        {"text": "Q2"}
      ],
      "rows": [
        [
          {"text": "EMEA"},
          {"text": "125000"},
          {"text": "140000"}
        ],
        [
          {"text": "APAC"},
          {"text": "143000"},
          {"text": "268000",
           "formula": "SUM(B2:B3)"}
        ]
      ]
    }
  ]
}

What Gets Extracted

Tables with Cell Types

Every cell keeps its type: string, number, boolean, date or formula. Shared strings are returned as the actual text. Sparse sheets with empty cells are handled.

Merged Cells

Merges across columns and down rows, recorded in mergeCell elements, are marked with gridSpan and vMerge. They are read from the file, not guessed from the layout. Deep dive →

Multi-Sheet Workbooks

Each worksheet becomes a separate section, with the sheet name as its heading. Sheets come out in workbook order. Sheet details such as visibility and tab color are kept.

Formulas & Cached Values

Each formula comes with its last calculated value. You get both "formula": "SUM(B2:B10)" and "text": "268000".

Shared Strings

XLSX stores repeated text once, in sharedStrings.xml, and refers to it by number. AILANG Parse looks each one up, so you see the actual text and not the number.

Comments & Metadata

Cell comments come with their author. Workbook metadata (title, author, created date) comes from the file's properties. Comment details →

Merged Cells

Financial reports, inventory sheets and regulatory filings use merged cells for group headers and category labels. XLSX stores each merge as a mergeCell element with a cell range (for example A1:A3). AILANG Parse turns each range into gridSpan (across columns) and vMerge (down rows) on the cells involved.

{
  "type": "table",
  "headers": [
    {"text": "Department", "vMerge": "restart"},
    {"text": "H1", "gridSpan": 2},
    {"text": "H2", "gridSpan": 2}
  ],
  "rows": [
    [{"text": ""}, {"text": "Q1"}, {"text": "Q2"}, {"text": "Q3"}, {"text": "Q4"}],
    [{"text": "Engineering"}, {"text": "$450K"}, {"text": "$480K"}, {"text": "$510K"}, {"text": "$520K"}],
    [{"text": "Sales"}, {"text": "$320K"}, {"text": "$340K"}, {"text": "$355K"}, {"text": "$370K"}]
  ]
}

See Tables & Merged Cells for the full specification.

Multi-Sheet Workbooks

One XLSX file often holds several worksheets: raw data, summaries, pivot tables, configuration. AILANG Parse reads every sheet in workbook order. Each sheet becomes a section with the sheet name as its heading, followed by the sheet's table.

{
  "blocks": [
    {"type": "heading", "level": 2, "text": "Raw Data"},
    {"type": "table", "headers": [...], "rows": [...]},
    {"type": "heading", "level": 2, "text": "Summary"},
    {"type": "table", "headers": [...], "rows": [...]},
    {"type": "heading", "level": 2, "text": "Config"},
    {"type": "table", "headers": [...], "rows": [...]}
  ]
}

Use Cases

Financial Report Extraction

Parse budget spreadsheets, P&L statements and revenue models with their merged category headers intact. Formulas are kept next to their calculated values, so other systems can check the calculations or flag anomalies.

Data Pipeline Ingestion

Convert uploaded XLSX files to structured JSON for loading into a database. Cell types (number, date, string) are kept, so your code does not have to guess whether "42736" is a number or an Excel date. A workbook with many sheets is handled in one call.

Regulatory Filing Analysis

Financial regulatory filings (XBRL supplements, risk reports, capital adequacy schedules) use merged cells to group categories. Exporting to CSV loses that grouping. Structured parsing keeps it.

Inventory & ERP Data

Warehouse inventory sheets, BOM spreadsheets and ERP exports use workbooks with several sheets that refer to each other. Parse the whole workbook into typed blocks, then pass them to an LLM for procurement analysis, stock reconciliation or demand forecasting.

AI Spreadsheet Understanding

Give LLMs structured table JSON instead of a CSV dump. The model sees cell types, merged cells and formulas, so it can reason about the table's structure as well as its values, without having to work out where the columns are.

Format Conversion

Convert XLSX to Markdown tables, HTML or Quarto for documentation and reporting. Merged cells are expanded or marked in the output. Each sheet of a workbook gets its own section.

Try It

CLI

# Parse an XLSX file
docparse financials.xlsx

# Convert XLSX to Markdown tables
docparse financials.xlsx --convert output.md

# Convert XLSX to HTML
docparse financials.xlsx --convert output.html

API

curl -X POST https://docparse.ailang.sunholo.com/api/v1/parse \
  -H "Content-Type: application/json" \
  -d '{"filepath":"sample_xlsx_formats","outputFormat":"markdown","apiKey":"YOUR_API_KEY"}'

Python SDK

from ailang_parse import DocParse

client = DocParse(api_key="YOUR_API_KEY")
result = client.parse_file("financials.xlsx")

# Iterate sheets (each is a section block)
for block in result.blocks:
    if block.type == "heading":
        print(f"Sheet: {block.text}")
    if block.type == "table":
        print(f"  {len(block.rows)} rows, {len(block.headers)} columns")
        if block.has_merges:
            print("  Contains merged cells")

Parse in Browser    API Reference

Frequently Asked Questions

How do I parse an XLSX file to JSON?

Send the .xlsx file to the AILANG Parse API or use the Python/JS/Go SDK. The parser reads SpreadsheetML directly and returns structured JSON with tables, merged cells, and metadata per sheet.

How are merged cells handled in XLSX parsing?

Each merged range is marked on its cells with gridSpan (across columns) and vMerge (down rows). The merges are read from the file, not guessed from the layout. See table extraction docs.

Does XLSX parsing support multi-sheet workbooks?

Yes. Each sheet becomes a separate section block with the sheet name as a heading. All sheets are parsed in workbook order.

Are formulas extracted from XLSX files?

Yes. Each formula comes with its last calculated value, so you get both the formula text and the result.

What about shared strings in XLSX?

XLSX stores repeated text once, in a shared string table. AILANG Parse fills the actual text back into every cell.

How fast is XLSX parsing?

Typical spreadsheets parse in under 50ms, with no other software to install. AILANG Parse scores 98.1% on the OfficeDocBench benchmark.