XLSX

What is an XLSX file?

The Excel format since 2007. Several sheets, formulas, formatting.

What XLSX is

XLSX is a container: a wrapper that holds streams encoded by something else. It is used for editing.

The extension is .xlsx, and the full name is Excel Workbook. Both matter less than what the file can hold, which is what the rest of this page is about.

Where XLSX came from

Microsoft published it in 2007. The specification is ECMA-376.

Age is worth knowing here for one practical reason: the older a format is, the more programs have had time to learn it.

The specification is public

It is published in full, so anyone can implement it from the document rather than by inspection, which is why it turns up in so many programs and why files written twenty years ago still open. A published specification is not the same thing as a royalty-free one: where a format wraps a codec, the patent licensing is a separate question the standard does not settle.

It can hold several pages in one file

XLSX is not limited to one page, which matters when converting to something that is: one conversion produces one file holding a single page — the first one, unless the page is something the converter lets you pick.

It cannot contain macros

XLSX cannot carry executable code, which is why mail gateways and document portals let it through where they stop its macro-enabled twin.

What kind of document it is

XLSX holds a spreadsheet: cells, formulas and the sheets around them.

That is what decides how it converts: a spreadsheet becomes a print area, and a print area is a decision somebody has to make about where the columns break.

What it does to protect itself

XLSX carries optional encryption.

An encrypted file has to be unlocked before anything can convert it, here or anywhere else — a password is not something a converter can work around, and one that claimed to could not be trusted with the file either.

What opens XLSX

Microsoft Excel, LibreOffice Calc and Google Sheets read it, and so do most programs of the same kind.

If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.

Opening it in a browser

No browser reads it.

That is the single most common reason to convert it: not that the format is bad, but that the place you want to show the file cannot read it.

It is a working format

XLSX is meant to be opened and changed. Keep the file in this format for as long as the work is going on, and export from it whenever a finished copy is needed.

A ZIP file full of XML, and you can look inside

Rename a .xlsx to .zip and open it. Inside is a small directory tree: one XML file per worksheet, a shared table of every distinct string in the workbook, a styles file, and a folder of document properties. Any image or embedded object sits there as a separate file.

This is not a curiosity. It is why a corrupt workbook can sometimes be rescued by opening the archive and pulling the sheet XML out, why file sizes behave the way they do, and why a workbook can carry things nobody remembers putting in it. The format is inspectable with tools everyone already has.

The 2007 break, and what it fixed

XLSX replaced the binary XLS format with Office 2007. The old format was a compound binary document that only Microsoft fully understood; the new one is documented, and that is the reason LibreOffice, Google Sheets, Numbers and dozens of libraries can read it reliably where XLS support was always partial guesswork.

The limits moved at the same time and are worth knowing because people still hit them: a worksheet holds 1,048,576 rows and 16,384 columns, against 65,536 and 256 before. An export truncated at exactly 65,536 rows is a tool writing the old format, not a coincidence.

Formulas are stored twice

Each formula cell holds two things: the formula as text, and the last calculated result. That is why a workbook opens showing values immediately rather than recalculating a hundred thousand cells first, and why a tool that reads XLSX without a formula engine can still report the right numbers.

It also means the cached value can be stale. A file written by a program that does not calculate — many export libraries do not — contains formulas with no results, and every cell reads as zero or empty until Excel opens it. If a generated workbook looks empty where it should have totals, that is the usual cause.

Fifteen digits, and then it stops being exact

Numbers are stored as double-precision floating point, which holds about fifteen significant digits. A sixteen-digit credit card number, a long order reference or a national identifier loses its final digits — permanently, in the file, not just in the display.

The defence is to make the column text before the data arrives, so the digits are stored as characters rather than a quantity. It is the same underlying problem as leading zeros disappearing from postcodes, and the same rule applies: an identifier is not a number just because it is made of digits.

What travels with the workbook that you did not mean to send

The document properties carry the author, the last person to save it, the company name from the Office installation and the creation and modification dates. Hidden rows, hidden columns and hidden worksheets are hidden, not absent — the data is in the XML and anybody can read it.

External links are the sharpest edge. A formula referring to another workbook stores the full path it was linked from, and that path frequently names a network share, a client, or a folder structure that describes the business. Clearing the document properties does not remove them; they live in the sheet, not the metadata.

Macros are not allowed in an XLSX

This is deliberate and one of the format’s better decisions. A file ending in .xlsx cannot contain macro code; a workbook with macros must be saved as .xlsm, which announces itself in the extension. Renaming an XLSM to XLSX does not smuggle the code through — the workbook simply loses it.

That gives a useful rule for anything arriving by email: a plain .xlsx cannot run code when opened. The risk lives with .xlsm and the older .xls, both of which can, and neither of which says so as clearly.

Why the file is smaller than it looks

Everything in the archive is compressed, and spreadsheet XML is extremely repetitive, so the ratio is unusually good. A workbook of a hundred thousand rows can land in a few megabytes. Repeated text is stored once in a shared table and referenced by number, which is why a column of the same twenty category names costs almost nothing.

The things that make a workbook large are mostly not the data: embedded images, formatting applied to entire sheets rather than the used range, and pivot caches, which store a second copy of the source data so the pivot table can be rearranged without it. A file that is mysteriously fifty megabytes usually has one of those three.

A good working format and a poor interchange format

For a person, XLSX is excellent: types are declared, dates stay dates, long numbers keep their formatting, and the file carries its own structure so nothing has to be guessed on opening. Sending a spreadsheet to a colleague, this is the right choice over CSV every time.

For a program, it is heavier than the job usually needs. Reading it means unzipping an archive and parsing several XML documents with a library, where CSV needs no library at all and streams from a file larger than memory. That is the honest split: XLSX when a human opens it, CSV when a machine reads it.

When the workbook will not open

The most common cause is not damage but a download that finished early or was rewritten by an email gateway. If the archive itself will not unzip, the file is truncated and no repair will help — fetch it again from the source.

If the archive opens but Excel refuses the workbook, the sheet XML is usually intact and the damage is in one of the smaller parts around it. Excel’s own Open and Repair recovers most of these, and where it does not, extracting the sheet XML from the archive by hand at least gets the data out.

The facts, in one place

Identifiers and provenance for the XLSX format.
Extension.xlsx
Media typeapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Published byMicrosoft
First published2007
SpecificationECMA-376