What Is XLSX?
XLSX is the default spreadsheet format introduced by Microsoft with Office 2007, replacing the legacy binary XLS format. The letters stand for Excel Open XML Spreadsheet — X for XML, L for Library/workbook, S for spreadsheet. The format is standardised under ECMA-376 and ISO/IEC 29500, making it an open international standard even though Microsoft developed it.
Despite frequent confusion, XLSX is not a single file. It is a ZIP archive containing dozens of XML files and binary assets, all arranged according to the Open Packaging Conventions (OPC) specification. Renaming an XLSX file to .zip and opening it reveals this structure immediately.
Internal ZIP Structure
Unzipping a minimal XLSX file exposes a predictable tree:
[Content_Types].xml — MIME types for every part
_rels/.rels — Root relationships (entry point)
xl/
workbook.xml — Sheet list, named ranges, calc chain
workbook.xml.rels — Links to individual sheets
worksheets/
sheet1.xml — Cell data, formulas, merge info
sheet2.xml
sharedStrings.xml — Deduplicated string table
styles.xml — Number formats, fonts, fills, borders
theme/
theme1.xml — Office colour/font theme
calcChain.xml — Formula calculation order
drawings/ — Charts, images (optional)
charts/
chart1.xml
tables/
table1.xml — Structured Table definitions
docProps/
app.xml — Application metadata
core.xml — Author, created/modified dates
The sharedStrings.xml is particularly important for performance: every unique text string used in cells is stored once in this file and referenced by index from the sheet XML. A spreadsheet with 100,000 cells all containing "January" stores that word once, not 100,000 times.
Cell Reference System
XLSX uses A1-style references where columns are letters (A–XFD, supporting up to 16,384 columns) and rows are 1-based integers (up to 1,048,576). In the XML, a cell is represented like:
<c r="B3" s="2" t="n">
<v>42.75</v>
</c>
r— cell address (B3)s— style index (links to styles.xml)t— value type:n(number),s(shared string index),b(boolean),e(error),str(inline string),inlineStr<v>— the stored value<f>— formula, if present (alongside<v>which holds the cached result)
For date/time values, Excel stores the underlying serial number (days since 1 January 1900 in Windows mode, or 1 January 1904 on older Mac mode). The style index determines how that number is displayed as a date.
Formulas and the Calculation Chain
When a formula exists, the XML stores both the formula text and the last calculated value:
<c r="C5" t="n">
<f>SUM(A1:A10)</f>
<v>487</v>
</c>
The calcChain.xml records the order in which cells should be recalculated to satisfy dependencies. Spreadsheet applications use this to avoid recalculating the entire workbook from scratch when a single cell changes.
Shared formulas — where the same formula pattern is applied across a range — are encoded once with a ref attribute specifying the range, substantially reducing file size:
<f t="shared" ref="D2:D100" si="0">B2*C2</f>
Array formulas (entered with Ctrl+Shift+Enter in older Excel) are marked with t="array".
Structured Tables (ListObjects)
When you format a range as a Table (Insert → Table), Excel stores it in xl/tables/tableN.xml and adds a reference in the sheet XML. Structured table references like =Table1[Amount] are stored as proper XML attributes, making the intent self-documenting and immune to row insertion errors.
<table id="1" name="Table1" displayName="Table1" ref="A1:D201">
<tableColumns count="4">
<tableColumn id="1" name="Date"/>
<tableColumn id="2" name="Product"/>
<tableColumn id="3" name="Qty"/>
<tableColumn id="4" name="Amount"/>
</tableColumns>
<tableStyleInfo name="TableStyleMedium2" showRowStripes="1"/>
</table>
Pivot Tables
PivotTable definitions live in xl/pivotTables/pivotTableN.xml, backed by a cache definition in xl/pivotCache/pivotCacheDefinitionN.xml. The cache stores a snapshot of the source data, which is why pivot table files can be surprisingly large even when "Refresh on Open" is enabled. The cache can be cleared to reduce file size at the cost of requiring a refresh before the pivot is usable.
Styles and Formatting
The styles.xml file contains four indexed arrays:
- numFmts — number format codes (date masks, currency, percentage)
- fonts — name, size, bold, italic, colour
- fills — solid colours, patterns, gradients
- borders — line style, colour for each edge
Cell styles (xf elements) combine indices into these arrays. Because every cell references a style index rather than repeating formatting data, even heavily formatted spreadsheets remain compact.
XLSX vs. XLSM vs. XLSB vs. XLS
| Format | Extension | Macros | Binary | Max Rows | Notes |
|---|---|---|---|---|---|
| Excel Open XML | .xlsx | No | No | 1,048,576 | Default; safest for sharing |
| Excel Macro-Enabled | .xlsm | Yes (VBA) | No | 1,048,576 | Required for VBA macros |
| Excel Binary | .xlsb | Yes (VBA) | Yes | 1,048,576 | Fastest open/save; not ODF-compatible |
| Legacy Excel | .xls | Yes (VBA) | Yes | 65,536 | Office 97–2003; avoid for new files |
| Excel Template | .xltx | No | No | — | Template without macros |
| Excel Macro Template | .xltm | Yes (VBA) | No | — | Template with macros |
XLSX deliberately cannot contain VBA macros. Attempting to save a macro-enabled workbook as XLSX triggers a warning and strips all macros, preventing accidental macro distribution via ordinary spreadsheets — a deliberate security boundary.
Compatibility and Interoperability
XLSX enjoys near-universal support:
- Microsoft Excel 2007+ — native format
- LibreOffice Calc / Apache OpenOffice Calc — strong support, minor rendering differences with advanced charts
- Google Sheets — full read/write; some complex features (certain pivot types, VBA macros) are lost on import
- Apple Numbers — reads XLSX; exports can lose conditional formatting details
- Python (openpyxl, xlrd, pandas) — extensive programmatic manipulation
The main interoperability gaps involve:
- Conditional formatting rules using certain Excel-specific functions
- Power Query / Power Pivot (stored in separate binary streams)
- Slicers on pivot tables
- Sparklines (mini-charts in cells)
- Office themes applied to charts
File Size and Compression
Because XLSX is a ZIP archive, the XML inside is compressed with DEFLATE. Typical compression ratios of 5:1 to 10:1 are common for text-heavy spreadsheets. However, spreadsheets with many embedded images or binary chart data may compress poorly.
Practical size reduction tips:
- Clear unused rows/columns — Excel sometimes tracks a "used range" far beyond actual data, inflating the file
- Remove unused styles — accumulated via copy-paste from external sources
- Delete pivot cache — remove cached data; users must refresh on open
- Convert images from PNG to JPEG inside the archive if lossless quality is not required
- Save as XLSB — if sharing only with Excel users and file size is critical
Security Considerations
XLSX files can contain:
- External data connections — auto-refresh to external URLs or databases
- Linked workbooks — formulas referencing other XLSX files
- Dynamic arrays (FILTER, SORT, UNIQUE) — spill into adjacent cells
- Embedded objects — OLE objects (other Office documents, PDFs)
Unlike XLSM, XLSX cannot execute VBA on open. However, DDE (Dynamic Data Exchange) and external links can still exfiltrate data or trigger unexpected behaviour. Always inspect external connections before enabling them in downloaded spreadsheets.
Converting XLSX Files
Common conversion scenarios:
XLSX → CSV: Exports only the active sheet; all formatting, formulas (as values), and multi-sheet data are lost. Use for data interchange with systems that cannot read binary/XML formats.
XLSX → ODS: LibreOffice handles this well. Complex features (pivot tables, certain conditional formatting) may not translate perfectly.
XLSX → PDF: Preserves visual appearance; useful for sharing read-only reports. Print area settings in XLSX control what appears in the PDF.
XLSX → Google Sheets: Import via Google Drive; Google converts the file. Most formulas and formatting survive; macros do not.
CSV/TSV → XLSX: Import wizard in Excel allows specifying delimiters, column data types, and encoding (critical for non-ASCII characters).
Summary
XLSX is the world's dominant spreadsheet format precisely because it balances openness (ISO-standardised XML), performance (ZIP compression, shared string table), and rich features (pivot tables, charts, conditional formatting, structured tables). Its ZIP+XML architecture makes it inspectable and repairable with any text editor, a significant advantage over the opaque binary XLS format it replaced. For any modern workflow involving tabular data, XLSX is the default choice unless VBA macros (XLSM) or maximum performance (XLSB) are required.
Related conversions
Document conversions that follow this topic naturally: