What’s Inside an XLSX File?

An .xlsx file is not one binary blob โ it is a ZIP archive containing a structured set of XML files, each responsible for a specific part of the workbook. Rename any .xlsx to .zip, open it, and you will find plain-text XML describing sheets, cells, shared strings, styles, and more. Understanding what is inside is the key to extracting data reliably โ with or without Excel.
This guide covers every XML part, explains exactly how cell values, dates, formulas, and embedded objects are stored, and shows how to extract data from Excel XLSX in your browser without installing anything.
Key definitions: OOXML, Open Packaging Convention, ZIP container, ECMA-376
Office Open XML (OOXML) is the XML-based file format family used by Microsoft Office since Office 2007. The .xlsx, .docx, and .pptx extensions all follow it. The standard is published as ECMA-376 (first edition 2006, fifth edition 2021), which defines every XML element, attribute, and relationship that a conforming file must use.
The physical container for an OOXML document is a ZIP archive โ a normal, deflate-compressed zip file. That container is structured according to the Open Packaging Convention (OPC), which specifies how parts inside the ZIP relate to each other through relationship files (.rels), how content types are declared, and how the package is navigated by a reader. OPC is defined in ISO/IEC 29500-2. Because a ZIP file starts with the well-known PK magic bytes at offset 0, any unzip utility can open an XLSX without any special software.
The full file structure of an XLSX
Below is the complete directory tree you find when you unzip a typical XLSX. Optional parts โ charts, images, pivot tables โ appear only when the workbook uses them.
workbook.xlsx (renamed to .zip)
โ
โโโ [Content_Types].xml โ part-type manifest (required by OPC)
โโโ _rels/
โ โโโ .rels โ root relationship: points to workbook
โ
โโโ docProps/
โ โโโ app.xml โ application name, sheet count, company
โ โโโ core.xml โ author, created/modified timestamps
โ
โโโ xl/
โโโ workbook.xml โ sheet registry, defined names, sheet order
โโโ _rels/
โ โโโ workbook.xml.rels โ links workbook โ each sheet, styles, sharedStrings
โ
โโโ worksheets/
โ โโโ sheet1.xml โ rows, cells, formulas for Sheet 1
โ โโโ sheet2.xml โ rows, cells, formulas for Sheet 2
โ โโโ _rels/
โ โโโ sheet1.xml.rels โ links sheet โ drawings, pivot caches, etc.
โ
โโโ sharedStrings.xml โ deduplicated text table (all string cell values)
โโโ styles.xml โ number formats, fonts, fills, borders, cell XFs
โ
โโโ charts/
โ โโโ chart1.xml โ chart definition (series, axes, chart type)
โ โโโ _rels/
โ โโโ chart1.xml.rels
โ
โโโ drawings/
โ โโโ drawing1.xml โ anchors charts and images to cell positions
โ
โโโ media/
โ โโโ image1.png โ embedded images (PNG, JPEG, EMF, WMF)
โ โโโ image2.emf
โ
โโโ pivotTables/
โโโ pivotTable1.xml โ pivot table layout and field definitions
โโโ pivotCaches/
โโโ pivotCacheDefinition1.xml โ cached pivot source data
workbook.xml: sheet registry, defined names, sheet order
xl/workbook.xml is the logical entry point for the workbook. Its three most important roles are:
- Sheet registry โ a
<sheets>element listing every sheet by display name, internal ID (sheetId), and relationship ID (r:id). The relationship ID resolves viaxl/_rels/workbook.xml.relsto the physical file path (e.g.,xl/worksheets/sheet2.xml). This indirection means sheets can be reordered or hidden without renaming files on disk. - Sheet order and visibility โ the order of
<sheet>elements in the XML matches the tab order the user sees. Astate="hidden"attribute marks hidden sheets;state="veryHidden"hides sheets that cannot be unhidden from the Excel UI without VBA. - Defined names โ a
<definedNames>block stores named ranges and named formulas. Each entry maps a human-readable name (e.g.,SalesTax) to a formula string (e.g.,Sheet1!$B$2). Parsers that skip this block will misresolve any formula referencing a named range.
worksheet/sheet1.xml: rows, cells, and the c element
Each worksheet is a stream of <row> elements, each containing one or more <c> (cell) elements. The <c> element carries three key attributes:
rโ the cell address in A1 notation (e.g.,r="C4"). Rows and columns that contain no data are omitted entirely from the XML, so gaps are implicit and must be inferred by column offset.tโ the value type flag. When absent the value is a plain number. When present it is one ofs(shared string index),b(boolean),e(error),inlineStr(inline string), orstr(formula result that is a string).sโ the style index, an integer pointing intoxl/styles.xml‘s cell XF table. This governs how the value is formatted on screen: date pattern, decimal places, fill colour, etc.
Inside <c>, the <v> element holds the actual stored value, and the optional <f> element holds a formula string. A <row> element also carries an r attribute (row number, 1-based) and optional ht (height in points) and hidden="1" attributes.
sharedStrings.xml: text deduplication and why index resolution is required
Every distinct text value in the entire workbook is stored exactly once in xl/sharedStrings.xml, inside an ordered list of <si> (string item) elements. A worksheet cell that contains text does not store the text itself โ it stores a zero-based integer index into this list.
For example, if the heading Product Name appears 500 times across all sheets, every one of those 500 cells in the worksheet XML is simply:
<c r="A1" t="s"><v>7</v></c>
where 7 is the zero-based position of Product Name in the shared-strings list. This keeps file size small, but it means a parser that does not load and index sharedStrings.xml first will read every text cell as a raw integer โ a common mistake in naive XLSX readers. Rich-text strings (mixed bold/italic within one cell) use <si><r><rPr>โฆ</rPr><t>โฆ</t></r></si> with per-run properties, and must be concatenated by the reader to produce the full cell text.
styles.xml: number formats, fonts, fills, borders, and date serial numbers
xl/styles.xml is the workbook’s complete visual-formatting dictionary. It contains four indexed tables:
- numFmts โ number format strings (e.g.,
d/mm/yyyy,#,##0.00,@for plain text). Built-in format IDs 0โ163 are implied by the standard and do not need to appear explicitly in the file. - fonts โ font name, size, bold, italic, underline, and colour, indexed per font record.
- fills โ background fill patterns and colours, indexed per fill record.
- borders โ top, bottom, left, right, and diagonal border styles, indexed per border record.
These four tables are composed into cell XF records (<xf> inside <cellXfs>). The s attribute on a <c> element in a worksheet is an index into this <cellXfs> list, not directly into the numFmts list.
Date serial numbers are resolved entirely through styles. Excel stores the date 17 September 2026 as the number 46091 (days since 1 January 1900, with the historical 1900 leap-year bug preserved for compatibility). The cell’s style XF points to a numFmt whose format code contains a date pattern. A correct parser detects whether the numFmt is a date format โ by checking built-in IDs 14โ17 and 22, or by scanning custom format strings for d, m, or y tokens โ and converts the serial to a calendar date. Without this step, every date column appears as a large integer.
Cell value types: the five t-attribute values explained
| t attribute | Type name | What <v> contains |
|---|---|---|
| absent | Number | The numeric value as a decimal string (e.g., 3.14 or 46091) |
s |
Shared string | Zero-based index into sharedStrings.xml |
b |
Boolean | 1 for TRUE, 0 for FALSE |
e |
Error | Error token string: #VALUE!, #REF!, #DIV/0!, #N/A, etc. |
inlineStr |
Inline string | No <v> โ text is inside a child <is><t> element directly in <c> |
Inline strings (t="inlineStr") bypass the shared-strings table entirely and embed text directly in the worksheet XML. They appear in files generated by tools that do not implement the shared-strings mechanism โ common in programmatically generated exports and some macro output. A complete parser must handle both the t="s" index-resolution path and the t="inlineStr" direct-text path.
Formulas: cached values versus formula text
When a cell contains a formula, the worksheet XML stores both the formula text and its last calculated result:
<c r="D5">
<f>SUM(D1:D4)</f>
<v>1234.56</v>
</c>
The <f> element holds the formula as typed by the user. The <v> element holds the cached value โ the result Excel computed the last time the workbook was saved. Data extractors read <v>, which gives the numeric or string result without needing to evaluate the formula. This is by design: an XLSX reader does not require a formula engine to get accurate data from most files.
Shared formulas (a single formula applied across a range) use <f t="shared" ref="D5:D20" si="0"> on the first cell and <f t="shared" si="0"/> on subsequent cells, referencing the master formula by an si index. Array formulas use t="array". In all cases the cached <v> remains the reliable extraction target.
Embedded objects: charts, images, and pivot tables
XLSX supports three categories of embedded content, each in its own sub-folder under xl/:
- Charts โ defined in
xl/charts/chart1.xml(and subsequent numbered files). The chart XML specifies series, axes, chart type, and source data references back to worksheet cell ranges. Charts are visually positioned by a drawing anchor inxl/drawings/drawing1.xml. EMF (Enhanced Metafile) images inxl/media/provide the static preview for viewers that cannot render the chart XML natively. - Images โ raster (PNG, JPEG, GIF) and vector (EMF, WMF) images are stored as binary blobs in
xl/media/. The drawing anchor inxl/drawings/positions each image on its sheet using two-cell anchors (top-left and bottom-right corner cells). Data extraction tools typically ignore media files โ they are relevant only to visual rendering. - Pivot tables โ the pivot layout lives in
xl/pivotTables/pivotTable1.xmland references a pivot cache definition inxl/pivotCaches/. The cache stores a snapshot of the source data range, enabling the pivot to function even if the underlying sheet is modified. Parsers targeting raw data should read the source worksheet, not the pivot cache, to avoid stale or summarised values.
How to extract data from XLSX
There are two practical routes depending on your goal:
Option A โ Use the EasyExtract tool (recommended for most users). The Excel XLSX data extractor opens the file directly in your browser. It resolves shared strings, applies number-format detection for dates, reads formula cached values, and lets you choose the sheet and the columns you want before exporting clean CSV โ with the workbook never leaving your device. If your data is already comma-separated, the CSV column extractor lets you filter and reorder columns with the same privacy guarantee.
Option B โ The ZIP rename trick (for manual inspection and debugging). Duplicate the file, change the extension from .xlsx to .zip, and open it in any archive viewer. You can then read individual XML parts in a text editor โ useful for checking what a cell actually stores, confirming whether a shared-strings table exists, or identifying what numFmt a date column uses. This is not practical for bulk extraction because you still need to manually cross-reference every shared-strings index and style index by hand.
XLSX vs XLS: BIFF8 binary versus open XML, why parsers differ
The older .xls format (Excel 97โ2003) uses the BIFF8 (Binary Interchange File Format, version 8) structure โ a proprietary binary format embedded inside a Microsoft Compound Document (OLE2) container. There is no ZIP, no XML, and no human-readable parts. Every record type has a fixed binary opcode, and strings are stored in either Windows-1252 or UTF-16 encoding depending on a per-string flag byte.
The consequence for parsers is significant: an XLSX library and a BIFF8 library share almost no code. A tool that reads .xlsx perfectly may fail silently on .xls, and vice versa. Key practical differences:
- BIFF8 is hard-limited to 65,536 rows and 256 columns; XLSX supports up to 1,048,576 rows and 16,384 columns.
- Shared strings in BIFF8 use an SST (Shared String Table) binary record, not an XML file.
- Date serial numbers use the same 1900 epoch, but the Mac Excel 1904 date system (epoch: 1 January 1904) appears far more often in legacy
.xlsfiles, requiring a separate conversion path. - Formula syntax is stored in tokenised binary form (Reverse Polish Notation byte codes) in BIFF8, not as a human-readable text string like in XLSX.
If you receive a .xls file and need clean data, the safest path is to open it in Excel or LibreOffice and re-save as .xlsx before using an XML-based extractor.
Common problems when reading XLSX files
- Dates displayed as numbers. A cell containing
46091is a date if and only if its style XF points to a date-type numFmt. Parsers that do not check the numFmt pattern will output raw integers. The fix is to detect date numFmt IDs (built-ins 14โ17, 22, plus any custom format string containingd,m, orytokens) and convert the serial accordingly. - Merged cells. A merge is declared in a
<mergeCells>block near the bottom of the worksheet XML. The actual value lives only in the top-left cell of the merged range; all other cells in the range are absent from the XML. Exporters that flatten the grid without expanding merges lose data and produce blank columns. - Hidden rows and columns. Rows with
hidden="1"and columns withhidden="1"inside<col>elements are invisible in Excel but physically present in the XML. An extractor must decide whether to include or exclude them based on explicit user intent. - Password protection. Workbook-level password protection encrypts the entire ZIP using ECMA-376 Agile Encryption (AES-128 or AES-256) or legacy XOR obfuscation. The file signature changes from the standard ZIP
PKbytes to an OLE2 header; the XML parts are inaccessible without the decryption key. Sheet-level “protection” is different โ it only sets asheetProtectionflag in the worksheet XML, which does not encrypt data. The ZIP can still be opened and the XML read by any parser.
Frequently asked questions
What is OOXML and why does XLSX use it?
Office Open XML (OOXML) is the ISO/ECMA standard XML dialect used by Microsoft Office since 2007. XLSX uses it because XML is human-readable, tool-agnostic, and compresses well inside the ZIP container, making the format open and interoperable without requiring Microsoft software to read it.
Can I open an XLSX file without Excel?
Yes. Because the format is an open standard (ECMA-376), any software that implements it can read the file. The Excel XLSX data extractor does this entirely in your browser โ no installation, no upload, and no Excel licence needed.
Why does my XLSX date column show numbers like 46091?
Excel stores dates as serial numbers (days since 1 January 1900). The number is converted to a date display by a number format pattern stored in styles.xml. Parsers that do not detect and apply the date-type number format output the raw integer. A compliant extractor checks the numFmt and converts dates automatically.
What is sharedStrings.xml and why must a parser load it first?
It is a deduplicated table of every text value in the workbook. Cells with t="s" store a zero-based integer index into this table, not the text itself. A parser that skips sharedStrings.xml will read every text cell as a meaningless number. Loading and indexing it before processing any worksheet XML is mandatory for correct output.
Do formula cells give the formula or the result when extracted?
Extractors read the cached value in the <v> element, which is the last numeric or string result Excel calculated when it saved the file. You get the computed result, not the formula text, without needing any formula-evaluation engine in the parser.
What happens to merged cells during extraction?
The actual value is stored only in the top-left cell of the merged range; all other cells in the range are blank in the worksheet XML. Extractors that do not expand merged cell regions will produce empty output for the rest of the merge. Check whether your extraction tool explicitly handles merges if your data uses them.
How is a password-protected XLSX different from a sheet-protected one?
Workbook-level password protection encrypts the entire file โ the ZIP becomes an OLE2 container and the XML parts are unreadable without the decryption key. Sheet-level protection only sets a flag in the worksheet XML; the data is still plaintext inside the ZIP and can be read by any compliant parser, even though Excel restricts editing in the UI.
Related reading
- CSV vs XLSX: what’s the difference and when to use each
- How to extract data from Excel without opening it
- What is data extraction?
Sources
- ECMA International. ECMA-376: Office Open XML File Formats, 5th edition (December 2021). ecma-international.org
- ISO/IEC 29500-2:2021 โ Information technology โ Open Packaging Conventions. International Organization for Standardization.
Last updated: 17 September 2026.