# Excel Filename Extensions: XLSX, XLS, CSV and More

An Excel filename extension is the short suffix at the end of a file name that tells Windows, macOS and Excel itself what kind of file it is. The extension controls whether the file can hold macros, whether it stores formatting, and whether other programs can open it. Choosing the right one matters most when you save, email or archive a workbook.

## Quick Answer

- `.xlsx` is the standard Excel workbook format. It holds data, formulas and formatting but no macros.
- `.xlsm` is the same as `.xlsx` but allows macros and VBA code.
- `.xls` is the older Excel 97-2003 binary format, still readable by modern Excel.
- `.csv` is plain text with no formatting, formulas or multiple sheets, which makes it ideal for moving data between programs.
- `.xltx` and `.xlam` are for templates and add-ins, not for everyday data files.

## What Excel Filename Extension Means

In plain terms, a filename extension is the part of a file name after the final period. In `Budget.xlsx`, the extension is `.xlsx`. It tells the operating system which application should open the file and tells Excel how to read the bytes inside it.

The precise definition is that a filename extension is a suffix separated from the base name by a period, conventionally one to five characters long, that maps a file to a registered file type. Microsoft Office uses extensions to distinguish both the application and the internal file format. Office Open XML (OOXML) formats were introduced with Microsoft Office 2007 and became the default format of the suite from that release onward [1]. Before that, Office used binary formats, which is why `.xls` files behave differently from `.xlsx` files.

The extension is not decoration. It is the primary signal Excel uses when you double-click a file, and it is the signal other software uses when importing your data.

## How It Works

Excel decides how to open a file by matching the extension against its registered file types. If the extension is `.xlsx`, Excel reads the file as an OOXML workbook. If it is `.csv`, Excel reads it as delimited plain text and applies its own parsing rules.

You can test this logic yourself with a simple lookup formula. The `IF` function checks a condition and returns one value when the condition is true and another when it is false:

$$\text{IF}(\text{logical\_test},\ \text{value\_if\_true},\ \text{value\_if\_false})$$

Each argument does one job:

- `logical_test` is the comparison, such as `B2=".xlsx"`.
- `value_if_true` is what Excel returns when the comparison holds.
- `value_if_false` is what Excel returns otherwise.

This is the mechanism behind the worked example below. It is a lookup table built from formulas, and it shows how each extension maps to a format name, a macro capability and a typical use.

## Worked Example

The table below models a small reference sheet of common Excel file extensions. Column A holds a sample file name, column B holds the extension, and columns C, D and E use `IF` formulas to look up the format name, macro support and typical use for that extension.

| Row | A: File Name | B: Extension | C: Format | D: Macro Support | E: Typical Use |
|---|---|---|---|---|---|
| 1 | File Name | Extension | Format | Macro Support | Typical Use |
| 2 | Budget.xlsx | .xlsx | `=IF(B2=".xlsx","Excel Workbook","")` -> displays Excel Workbook | `=IF(B2=".xlsx","No","")` -> displays No | `=IF(B2=".xlsx","Standard Excel file","")` -> displays Standard Excel file |
| 3 | Macros.xlsm | .xlsm | `=IF(B3=".xlsm","Excel Macro-Enabled Workbook","")` -> displays Excel Macro-Enabled Workbook | `=IF(B3=".xlsm","Yes","")` -> displays Yes | `=IF(B3=".xlsm","Workbook with macros","")` -> displays Workbook with macros |
| 4 | Legacy.xls | .xls | `=IF(B4=".xls","Excel 97-2003 Workbook","")` -> displays Excel 97-2003 Workbook | `=IF(B4=".xls","Yes","")` -> displays Yes | `=IF(B4=".xls","Older Excel format","")` -> displays Older Excel format |
| 5 | Data.csv | .csv | `=IF(B5=".csv","CSV (Comma delimited)","")` -> displays CSV (Comma delimited) | `=IF(B5=".csv","No","")` -> displays No | `=IF(B5=".csv","Plain text data","")` -> displays Plain text data |
| 6 | Template.xltx | .xltx | `=IF(B6=".xltx","Excel Template","")` -> displays Excel Template | `=IF(B6=".xltx","No","")` -> displays No | `=IF(B6=".xltx","Reusable template","")` -> displays Reusable template |
| 7 | Addin.xlam | .xlam | `=IF(B7=".xlam","Excel Add-In","")` -> displays Excel Add-In | `=IF(B7=".xlam","Yes","")` -> displays Yes | `=IF(B7=".xlam","Add-in with macros","")` -> displays Add-in with macros |

To follow the logic for row 2, the formula in C2 checks whether B2 equals `.xlsx`. It does, so the formula returns "Excel Workbook". The formula in D2 checks the same cell and returns "No", because a standard `.xlsx` file cannot store macros. The formula in E2 returns "Standard Excel file". Rows 3 through 7 repeat the same three checks for their own extensions.

If you want to build this kind of lookup for a longer list, the [Excel functions overview](/blog/data-analysis/excel-functions-overview) covers the lookup and logical functions you would combine, and the [Excel Name Box](/blog/data-analysis/excel-name-box) is useful for jumping straight to a specific cell while you check your formulas.

## How to Interpret It

Read the table as a decision map. The extension in column B determines everything to its right. A `.xlsx` file is safe to share and cannot carry code. A `.xlsm` file can carry code, so treat it as you would any executable file from an untrusted source. A `.csv` file carries only values, so any formatting, formulas, charts or extra sheets are gone the moment you save in that format.

The macro column is the one people get wrong most often. Both `.xls` and `.xlsm` report "Yes" for macro support, but they are not interchangeable. The `.xls` format is the legacy binary format, and the `.xlsm` format is the modern OOXML format. If you only need to know whether a file can run code, the column answers that. If you need to know whether the file is modern or legacy, read the format column instead.

## When to Use It (and when not to)

Use `.xlsx` for almost everything. It is the default for a reason. It compresses well, it supports the full modern feature set, and every current version of Excel opens it.

Use `.xlsm` only when the workbook genuinely contains macros or VBA code. If you save a macro workbook as `.xlsx`, Excel warns you that the code will be removed. If you save a plain workbook as `.xlsm`, you gain nothing and you make the file harder to email, because many mail systems and security tools block macro-enabled files.

Use `.csv` when another program needs your data. Databases, statistical software and web applications all read CSV. Do not use it as your working format. Save a `.xlsx` master and export a `.csv` copy.

Use `.xls` only when you must open a file in a very old version of Excel or a third-party tool that has not been updated. Otherwise, convert it.

Use `.xltx` and `.xlam` for their intended purposes. A template gives you a starting point each time you create a new file. An add-in extends Excel with custom commands or functions.

## Excel Filename Extension vs File Format

People often use "extension" and "format" as if they mean the same thing. They are related but not identical. The extension is the label on the file. The format is the internal structure of the bytes inside it.

| Aspect | Filename extension | File format |
|---|---|---|
| What it is | The suffix after the final period | The internal structure of the file contents |
| Example | `.xlsx` | Office Open XML workbook |
| Who reads it | The operating system and Excel | Excel's file parser |
| Can it be wrong | Yes, you can rename a file and mislabel it | No, the bytes do not change when you rename |
| Practical effect | Determines which program opens the file | Determines what Excel can do with the contents |

The practical consequence is that renaming a file does not convert it. If you rename `Data.csv` to `Data.xlsx`, the file still contains comma-separated text, not a workbook, and Excel reports that the file format or file extension is not valid. You have to open the file and save it in the target format.

## Common Mistakes

- **Saving a macro workbook as `.xlsx`.** Excel strips the VBA code and warns you. Fix it by choosing "Excel Macro-Enabled Workbook (*.xlsm)" in the Save As dialog.
- **Renaming a file to change its format.** The extension changes but the contents do not. Fix it by opening the file and using Save As to pick the real format.
- **Using `.csv` as a working file.** You lose formulas, formatting, charts and all but one sheet. Fix it by keeping a `.xlsx` master and exporting CSV copies.
- **Hiding the extensions in File Explorer.** Windows hides known extensions by default, so `Budget.xlsx` may display as `Budget`. Fix it by turning on file name extensions in File Explorer's View options.
- **Assuming `.xls` and `.xlsx` are the same.** They are different formats with different limits. Fix it by converting legacy files to `.xlsx` when you no longer need backward compatibility.
- **Emailing `.xlsm` files to people who do not expect them.** Many mail filters block macro-enabled attachments. Fix it by sending a `.xlsx` copy or a password-protected archive when macros are not needed.

## Limitations

An extension tells you the intended format, not the actual contents. A file can be renamed, truncated or corrupted, and the extension will still claim it is a valid workbook. Excel usually detects the mismatch and warns you, but not always, and a file that opens without complaint can still contain damaged data.

The extension also says nothing about data quality. A `.csv` file with the right extension can still have inconsistent delimiters, mixed date formats or encoding problems that break the import. The extension is a starting point for deciding how to open a file, not a guarantee about what is inside it.

## Frequently Asked Questions

### What is the difference between XLSX and XLS?

`.xlsx` is the modern Office Open XML format introduced with Office 2007, and `.xls` is the older binary format used by Excel 97 through 2003 [1]. Modern Excel opens both, but `.xlsx` supports more rows, more columns and newer features. Save as `.xls` only when you need compatibility with very old software.

### Can I just rename a CSV file to XLSX?

No. Renaming changes the label, not the contents. The contents are still plain text, so Excel will report that the file format or file extension is not valid and will not open it as a workbook. Open the CSV in Excel and use Save As to choose the Excel Workbook format instead.

### Which Excel extension should I use for a file with macros?

Use `.xlsm`, the Excel Macro-Enabled Workbook format. If you save macro code in a `.xlsx` file, Excel removes it. If you need the macros to be available across many workbooks, an `.xlam` add-in is the better choice.

### Why does my file show as .xlsx when I saved it as CSV?

This usually happens because the Save As dialog kept the previous file type. Check the "Save as type" dropdown before you click Save. Also check whether Windows is hiding file extensions, because a hidden extension can make a CSV file look like something else.

### Is CSV better than XLSX for data analysis?

It depends on the tool. CSV is the safest format for moving data into databases, statistical software and programming languages because it is plain text and universally readable. XLSX is better when you need formulas, multiple sheets or formatting. A common approach is to keep the analysis in XLSX and export a CSV when you hand data to another system.

## References

1. [List of Microsoft Office filename extensions - Wikipedia](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions)

## Further Reading

- [Broman KW, Woo KH (2018). Data Organization in Spreadsheets. The American Statistician](https://doi.org/10.1080/00031305.2017.1375989)
- [Ziemann M, Eren Y, El-Osta A (2016). Gene name errors are widespread in the scientific literature. Genome Biology](https://doi.org/10.1186/s13059-016-1044-7)
- [Microsoft Support: Excel help and learning](https://support.microsoft.com/en-us/excel)
- [McCullough B, Heiser DA (2008). On the accuracy of statistical procedures in Microsoft Excel 2007. Computational Statistics &amp; Data Analysis](https://doi.org/10.1016/j.csda.2008.03.004)
- [Abeysooriya M, Soria M, Kasu MS et al. (2021). Gene name errors: Lessons not learned. PLOS Computational Biology](https://doi.org/10.1371/journal.pcbi.1008984)

## Related Articles

- [Excel Name Box: What It Is and How to Use It](/blog/data-analysis/excel-name-box)
- [Excel Functions: What They Are and How to Use Them](/blog/data-analysis/excel-functions-overview)
- [How to Freeze Rows and Columns in Excel (Step by Step)](/blog/data-analysis/how-to-freeze-panes-in-excel)
- [How to Use XLOOKUP in Excel (Step by Step)](/blog/data-analysis/how-to-use-xlookup-excel)
- [How to Create a Drop Down List in Excel (Step by Step)](/blog/data-analysis/how-to-create-drop-down-excel)