XLSX vs XLSM vs XLS: Excel File Types Explained
By ExcelReady TeamUpdated 6 min read
The short answer
XLSX is Excel's standard file format and cannot store macros. XLSM is the same format with VBA macros allowed, so use it only when the workbook has macros you need. XLS is the old Excel 97-2003 format, limited to 65,536 rows and 256 columns. For everyday work, save as XLSX.
Key takeaways
- XLSX and XLSM are the same modern format; the only difference is that XLSM can hold VBA macros.
- Saving a workbook with macros as XLSX removes the macros, after a warning.
- XLS is the Excel 97-2003 format, with only 65,536 rows and 256 columns per sheet.
- Files from other people that end in .xlsm can run code, so only enable macros from sources you trust.
- Changing the extension by renaming the file doesn't convert it. Use Save As.
On this page+
The short answer to XLSX vs XLSM: they are the same modern Excel format, but XLSM can store VBA macros and XLSX cannot. XLS is a third, older format from Excel 97-2003 that you should only use for very old software. This guide explains what each file type keeps and loses, so you can pick the right one when you save, share or receive a workbook.
XLSX vs XLSM vs XLS at a glance#
XLSX is the default for good reason. Choose XLSM only for macros and XLS only for old systems.
| Feature | XLSX | XLSM | XLS |
|---|---|---|---|
| Full name | Excel Workbook | Excel Macro-Enabled Workbook | Excel 97-2003 Workbook |
| Stores VBA macros | No | Yes | Yes |
| Rows × columns per sheet | 1,048,576 × 16,384 | 1,048,576 × 16,384 | 65,536 × 256 |
| Introduced | Excel 2007 | Excel 2007 | Excel 97 |
| Format inside | Compressed XML | Compressed XML | Older binary format |
| Newer features (tables, new functions) | Kept | Kept | Some lost or limited |
| Risk when opening from strangers | Lower | Higher (macros can run code) | Higher (macros can run code) |
| Best for | Almost everything | Workbooks with macros | Very old software only |
What each file type is#
The letters after the dot tell Excel how the file is built and what it may contain.
- XLSX (Excel Workbook) is the standard format since Excel 2007. Inside, it is a set of XML files packed into a ZIP archive, which keeps it small. It holds data, formulas, formatting, charts, tables and PivotTables. It can't hold VBA macros.
- XLSM (Excel Macro-Enabled Workbook) is the same format plus a place to store VBA macros. A macro is a small program, written in Visual Basic for Applications, that repeats steps for you, like formatting a report or copying data between sheets.
- XLS (Excel 97-2003 Workbook) is the old binary format. It can hold macros, but it has smaller sheets and doesn't support many features added since 2007.
You may also meet XLSB (binary workbook, which can hold macros and often opens faster for very large files), XLTX and XLTM (templates without and with macros) and CSV (plain text, one sheet, no formulas). The CSV vs XLSX comparison covers CSV in detail.
The same workbook saved three ways#
Imagine a workbook with three sheets: Data with 100,000 rows, Summary with XLOOKUP formulas, and a macro that formats the report. Here is what happens when you save it in each format.
| Save as | What happens |
|---|---|
| XLSX | Excel warns that the VBA project can't be saved in a macro-free workbook. If you click Yes, the data and formulas are kept, but the macro is gone. |
| XLSM | Everything is kept: data, formulas and the macro. |
| XLS | The Compatibility Checker warns that rows beyond 65,536 will be lost and some features may not work in earlier versions. |
In Excel for Windows, choose File > Save As, then pick the type in the Save as type list. On a Mac, choose File > Save As and pick it in the File Format list. The type you choose decides the extension. Renaming a file from .xlsm to .xlsx in your file explorer doesn't convert it, and Excel then refuses to open it with an error about the file format or extension.
When to use XLSX#
Use XLSX for every workbook that doesn't need macros. It is the safest and most widely accepted choice:
- Sharing with colleagues and clients. Email filters and company systems accept XLSX, and people open it without a security warning.
- Uploading to websites and apps. Most tools that import Excel files expect XLSX.
- Reports, models and dashboards built with formulas. Formulas, tables, PivotTables, charts and conditional formatting all work in XLSX. None of them need macros.
- Job tests and assessments. Unless the task says otherwise, save your answer as XLSX.
If you aren't sure whether a workbook has macros, save it as XLSX. Excel tells you if there is something it can't keep.
When to use XLSM#
Use XLSM only when the workbook contains VBA macros that you need to keep. Typical cases:
- A button that runs a task, such as "Refresh report" or "Create PDF".
- A tool that loops over many sheets or files, which formulas alone can't do.
- Custom functions written in VBA that your formulas call.
When you open an XLSM file from someone else, Excel disables its macros and shows a yellow security bar. In current versions of Microsoft 365 on Windows, Excel goes further and blocks macros in files downloaded from the internet. This protects you, because a macro can do anything a program can. Only enable macros in files from people and places you trust.
If you recorded a macro to try it out and no longer need it, save the file as XLSX to remove it.
When to use XLS, and how to convert it#
Use XLS only when someone has to open the file in Excel 2003 or earlier, or when an old system can only read XLS. Otherwise, convert it.
When you open an XLS file in a modern Excel, the title bar shows Compatibility Mode. The sheet is still limited to 65,536 rows and 256 columns, and some newer features are turned off. To convert it, choose File > Info > Convert on Windows, or use File > Save As and pick Excel Workbook (.xlsx). Choose XLSM instead if the old file contains macros you need.
Converting can break links from other workbooks. A formula that points to another file includes the file name and extension, such as ='[Prices.xls]Sheet1'!B2. When Prices.xls becomes Prices.xlsx, that link still looks for the old name. Use Data > Edit Links > Change Source to point it at the new file. If the link breaks completely, you may see #REF!; the guide to fixing #REF! errors explains why. For links within one file, see how to reference another sheet.
Common mistakes with Excel file types#
These slips cause most file-type problems:
- Saving a macro workbook as XLSX. Excel warns you, but clicking Yes deletes the macros. Keep an XLSM copy first.
- Renaming instead of converting. Changing .xlsm to .xlsx by hand makes the file unreadable. Always use Save As.
- Saving everything as XLSM "just in case". XLSM files trigger warnings and may be blocked by email filters. Use XLSM only when there are macros.
- Keeping old XLS files in daily use. Large data gets cut at row 65,536, and newer functions may not work.
- Enabling macros in unknown files. If you didn't expect a macro, don't enable it.
- Confusing a file with a sheet. A file type applies to the whole workbook, not one sheet. If the terms are new, read workbook vs worksheet. To bring sheets from several files into one, see how to combine sheets.
Our recommendation#
Save as XLSX by default. It keeps everything formulas can do, opens without warnings and works everywhere. Switch to XLSM only when the workbook has VBA macros you want to keep, and tell people why the file asks them to enable content. Treat XLS as a legacy format: open old files, then convert them to XLSX.
In short: XLSX for almost everything, XLSM for macros, XLS only for very old software.
Practise it#
Most real workbooks, whatever their file type, link several sheets together. Practise working with multiple worksheets in a live spreadsheet: you write formulas that pull values from other sheets, and each step is checked instantly. Try the exercise on this page first: it counts the macro-enabled files in a list with one COUNTIF.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
How many files in the list are macro-enabled workbooks? In D2, use COUNTIF with a wildcard to count the file names in A2:A8 that end in .xlsm.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Owner | XLSM files | |||
| 2 | Finance | ||||
| 3 | HR | ||||
| 4 | Sales | ||||
| 5 | Sales | ||||
| 6 | Finance | ||||
| 7 | IT | ||||
| 8 | Finance | ||||
| 9 | |||||
| 10 | |||||
| 11 |
Tip: The * wildcard means any text. "*.xlsm" matches every name that ends in .xlsm.
Practise this in a lesson
Frequently asked questions
What is the difference between XLSX and XLSM?
Both use the same modern Excel format. XLSM can store VBA macros, and XLSX cannot. If a workbook has no macros, XLSX is the better choice.
Is XLSM safe to open?
The file itself opens like any workbook, but its macros can run code on your computer. Excel disables macros by default and shows a warning. Only enable them if you trust the sender.
Can I convert XLSM to XLSX?
Yes. Open the file, choose File > Save As, and pick Excel Workbook (*.xlsx). Excel warns that the macros will be removed; click Yes to continue.
Why can't I just rename .xlsm to .xlsx?
The file extension must match the content inside. If you rename the file, Excel shows an error that the file format or extension is not valid. Use Save As to change the type.
Should I still use the XLS format?
Only when someone must open the file in Excel 2003 or earlier, or in an old system that reads nothing else. XLS limits each sheet to 65,536 rows and 256 columns and drops newer features.