ZERO-UPLOAD SANDBOX
.xlsx Tier 1 · Deep AST Parser

Office Open XML Workbook (Excel)

ZIP-packaged XML spreadsheet container (`[Content_Types].xml` + `xl/workbook.xml`). Frequently misdiagnosed when backend export endpoints fail and save HTML/JSON error pages as `.xlsx`.

Shares `50 4B 03 04` with all ZIP files; true validation requires confirming `xl/workbook.xml` in the Central Directory (and rejecting legacy OLE2 `D0 CF 11 E0` `.xls` or HTML `3C 21 44 4F`).

MIME Types application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Byte Endianness little
Container Family zip
PRONOM PUID fmt/214
0xFF

Drop any .xlsx file (even 100 GB+) to inspect locally

Reads tiny File.slice() header/footer pages in a sandboxed Web Worker · 0 Bytes Uploaded

Binary Signature & Wire Layout

.xlsx Magic Bytes & Header Offset Map

Offset: 0x00 (0 B) ASCII: PK..
50 4B 03 04

PKZIP container verified via xl/workbook.xml entry

Byte Offset Length Data Type Field Name Engineering Description
0x00 - 0x03 4 B uint32_le zip_sig 0x04034B50 PKZIP Local File Header
0x1E+ var utf8 content_types Typically '[Content_Types].xml'
Upload Gateway & AppSec Advisory

.xlsx Security & Polyglot Risk Matrix

Risk Level: medium
Arbitrary Code / Macros
NO (Inert Data)
Pickle Deserialization
SAFE (No Pickle VM)
XML External Entity (XXE)
POSSIBLE (Disable DTD)
Polyglot Prepend Risk
YES (Check Tail/Offsets)
Backend Upload Validation Recommendation

Disable XML DTD / external entity resolution (XXE) in server-side XLSX parsers, enforce Zip Bomb decompression limits, and reject `xl/vbaProject.bin` macro blobs.

Compiler-Verified Reference Code

Read .xlsx Header & Metadata Without Heavy Dependencies

import sys, zipfile
with zipfile.ZipFile(sys.argv[1], "r") as zf:
    names = set(zf.namelist())
    assert "xl/workbook.xml" in names, "Missing xl/workbook.xml"
    print(f"Valid OOXML .xlsx ({len(names)} parts)")
CI/CD & Unit Test Fixtures

Deterministic .xlsx Sample Files & Edge Cases

Open Full .xlsx Sample Matrix & Mutator →
minimalexpect: valid

minimal-sheet.xlsx

Real single-cell workbook written by openpyxl with Content_Types, rels, workbook.xml and sheet1.xml.

↓ Download (4.7 KB)
SHA-256: 872a54723dd14451428342c5f097a0c3c7d5097a7d7fb28a86905e0df685a9f7
Exact: 4,843 bytes
curl -fsSL https://fileformat.co/fixtures/v1/xlsx/minimal-sheet.xlsx -o minimal-sheet.xlsx \
  && echo "872a54723dd14451428342c5f097a0c3c7d5097a7d7fb28a86905e0df685a9f7  minimal-sheet.xlsx" | shasum -a 256 -c
realisticexpect: valid

quarterly-revenue.xlsx

Real openpyxl workbook: 4 quarterly revenue rows with USD floats for tabular import tests.

↓ Download (4.9 KB)
SHA-256: d5ab69cbec81720b5a6399b0d77de88308017bad09e0b3919b15c0e4cf8afe3e
Exact: 5,037 bytes
curl -fsSL https://fileformat.co/fixtures/v1/xlsx/quarterly-revenue.xlsx -o quarterly-revenue.xlsx \
  && echo "d5ab69cbec81720b5a6399b0d77de88308017bad09e0b3919b15c0e4cf8afe3e  quarterly-revenue.xlsx" | shasum -a 256 -c
edge-caseHTML Spoofed as .xlsxexpect: parser_error

spoofed-gateway-error.xlsx

Real-world debugging classic: filename ends .xlsx but bytes are an HTML gateway error page — openpyxl must raise.

↓ Download (203 B)
SHA-256: 22cceb2a5564d2877e94960a59b434289c9f4aa0c56e346c0aa9ce8bf361cceb
Exact: 203 bytes
curl -fsSL https://fileformat.co/fixtures/v1/xlsx/spoofed-gateway-error.xlsx -o spoofed-gateway-error.xlsx \
  && echo "22cceb2a5564d2877e94960a59b434289c9f4aa0c56e346c0aa9ce8bf361cceb  spoofed-gateway-error.xlsx" | shasum -a 256 -c

Related Specifications & Alternatives