What Is an .xlsx File?
An .xlsx file is a modern spreadsheet file format used by Microsoft Excel and many other spreadsheet programs. It can store worksheets, numbers, text, formulas, tables, charts, formatting and other structured spreadsheet data.
.xlsx is a spreadsheet file format
An .xlsx file is a spreadsheet workbook stored using Microsoft's Office Open XML spreadsheet format.
It is commonly associated with Microsoft Excel, although other spreadsheet applications can also read and write .xlsx files.
A single workbook can contain multiple worksheets along with formulas, formatting, charts and other spreadsheet information.
What does .xlsx mean?
The .xlsx extension identifies an Excel workbook stored using the Office Open XML format.
The extension tells software what kind of file it is dealing with and which format should be used to interpret the contents.
An .xlsx file is a workbook
A workbook can contain one or more worksheets.
Each worksheet contains a grid of rows and columns.
Spreadsheet data is stored in cells
Each cell is identified by a column and row.
For example:
| A | B | C |
|---|---|---|
| Product | Quantity | Price |
| Keyboard | 2 | 39.99 |
| Mouse | 4 | 19.50 |
Cells can contain different kinds of information
.xlsx files can store formulas
A spreadsheet cell does not have to contain only a fixed value.
It can contain a formula:
or:
The spreadsheet application evaluates the formula and displays the calculated result.
A formula and its displayed result are different things
Suppose a cell contains:
The displayed result may be:
The workbook can retain the formula rather than simply replacing it with the number 30.
.xlsx files can store presentation information
Unlike a simple CSV file, an .xlsx workbook can retain substantial visual formatting.
A workbook can contain much more than cells
Worksheets
Multiple spreadsheet pages can exist inside one file.
Charts
Data can be visualised using charts and graphs.
Tables
Structured Excel tables can organise related records.
Formulas
Calculations can reference other cells and sheets.
Validation
Rules can restrict what users are allowed to enter.
Hyperlinks
Cells can contain links to websites and other resources.
An .xlsx file is based on XML
The modern Excel workbook format belongs to the Office Open XML family of file formats.
Internally, workbook information is divided across a collection of structured XML files and related resources.
An .xlsx file is also a ZIP package
One of the most interesting facts about .xlsx files is that they are packaged using ZIP compression.
If a copy of an .xlsx file is renamed from:
to:
ZIP-compatible software can usually open the package and reveal the internal files.
An .xlsx file is not one giant XML document. It is a ZIP package containing multiple XML documents and supporting files organised according to the Office Open XML format.
What is inside an .xlsx file?
A simplified workbook package might contain:
The exact contents depend on which features are used in the workbook.
Worksheets are represented using XML
Internally, a worksheet may contain XML structures representing rows and cells.
Spreadsheet software interprets these structures and presents them as the familiar grid seen in Excel.
Text may be stored separately from worksheet cells
Some .xlsx workbooks use a shared strings table.
Instead of repeating the same text many times inside worksheets, cells can reference entries stored in a shared XML structure.
Formatting can be stored separately
Workbook styles can be defined in internal style information and referenced by cells.
This avoids having to repeat complete formatting instructions for every individual cell.
.xlsx replaced the older .xls format
| .xls | .xlsx |
|---|---|
| Older Excel format | Modern Excel workbook format |
| Binary file format | Office Open XML package |
| Associated with older Excel versions | Introduced with Excel 2007 |
| Legacy format | Common modern format |
.xlsx and .csv are very different
| CSV | XLSX |
|---|---|
| Plain-text format | ZIP-based spreadsheet package |
| Usually represents one table | Can contain multiple worksheets |
| No native cell formatting | Supports extensive formatting |
| No native charts | Can contain charts |
| Simple data exchange | Complete spreadsheet workbook |
Saving Excel data as CSV can remove workbook features
Suppose an .xlsx workbook contains:
Exporting one sheet to CSV normally preserves the tabular values but not the complete workbook structure.
.xlsx files do not normally contain VBA macros
Excel uses a different extension for macro-enabled workbooks:
| Extension | Workbook type |
|---|---|
| .xlsx | Standard Excel workbook |
| .xlsm | Macro-enabled Excel workbook |
This distinction matters. If a workbook depends on VBA macros, saving it as an ordinary .xlsx file is not the appropriate format for retaining those macros.
.xlsx files can be created by software
Excel itself is not required to generate every .xlsx workbook.
Programming libraries can create, read and modify spreadsheet files automatically.
Python can create .xlsx files
For example, libraries such as openpyxl can work with Excel workbooks.
Software can therefore generate spreadsheets from databases, APIs and other data sources.
Spreadsheet generation can be automated
This is useful for reporting, financial data, exports, project tracking and business workflows.
.xlsx files are supported by many applications
Microsoft Excel is the application most strongly associated with .xlsx, but other spreadsheet software can also work with the format.
Complex workbook features may not always behave identically when the same file is opened in different spreadsheet applications.
An .xlsx file is not a plain-text file
Although its internal structure contains XML documents, the .xlsx file itself is a compressed package.
Opening it directly in a basic text editor will therefore not display the workbook in the same clean way as opening a CSV, TXT or XML file.
What are .xlsx files used for?
The simplest way to think about .xlsx
More than just a table.
An .xlsx file is a modern spreadsheet workbook format based on Office Open XML. It can contain multiple worksheets, values, formulas, formatting, charts and other spreadsheet features. Internally, the workbook is stored as a ZIP package containing XML documents and related resources.