A file extension that ends in x, such as .xlsx, .docx, or .pptx, indicates that the document does not contain VBA macros. The letter x signals the Office Open XML format, which stores content as XML parts inside a ZIP package and cannot hold compiled macro code. Files without the x, such as .xls, .doc, .xlsm, and .docm, either can contain macros or are explicitly built to carry them.

The naming convention came from Microsoft's 2007 move to XML-based file formats. It separated macro-free files from macro-enabled ones so that email gateways, browsers, and desktop apps could spot executable content by filename alone. That single-letter distinction now anchors most enterprise security policy around Office documents.

How the x suffix encodes a format change

Before 2007, Microsoft Office files were binary containers. A .doc or .xls file was a structured binary blob that could embed VBA projects, ActiveX controls, and OLE objects alongside text and numbers. There was no reliable way to tell from the extension alone whether a spreadsheet contained executable code.

The Office Open XML formats replaced that blob with a ZIP archive of XML parts. A .docx is literally a compressed folder. Inside are files like document.xml for body text, styles.xml for formatting, and settings.xml for application state. VBA macro code does not fit this model, so the specification split formats into two families. The plain family (.docx, .xlsx, .pptx) prohibits macro storage. The macro-enabled family (.docm, .xlsm, .pptm) permits a vbaProject.bin binary part inside the same ZIP structure.

That is the mechanism behind the naming rule. The x is not decoration. It marks a package whose content type list excludes the macro part. Opening a .xlsx in a text editor or unzipping it will never reveal a vbaProject.bin file, because the specification forbids it. A .xlsm package can contain that part, and its MIME type, application/vnd.ms-excel.sheet.macroEnabled.12, declares it in advance.

The full extension map

The distinction is cleaner once you lay the formats side by side. Older binary extensions remain ambiguous. Newer ones are explicit.

Extension Format family Macro storage Notes
.docx Office Open XML Prohibited Standard Word document
.docm Office Open XML Permitted Word document with macros
.xlsx Office Open XML Prohibited Standard Excel workbook
.xlsm Office Open XML Permitted Excel workbook with macros
.pptx Office Open XML Prohibited Standard PowerPoint deck
.pptm Office Open XML Permitted PowerPoint deck with macros
.doc / .xls / .ppt Binary Possible Legacy formats, no safe assumption
.dotx / .xltx Office Open XML template Prohibited Macro-free templates
.dotm / .xltm Office Open XML template Permitted Macro-enabled templates

The template row matters because organizations often forget it. A .dotm can carry a macro that runs each time a new document is created from it. A .dotx cannot.

An exception that trips up security teams

Not every x-bearing extension is macro-free in the way people assume. Microsoft also uses x suffixes for other XML-based formats that have nothing to do with Office documents, such as .xml itself or configuration files like .config. Those are not Office files and the rule does not apply to them.

A more consequential exception involves Excel's binary workbook format, .xlsb. It contains no x at the end of a familiar three-letter stem and is not an Office Open XML package in the same sense, yet it is a binary format that can carry macros. Professionals who assume "no x means check for macros, x means safe" will misclassify .xlsb files. Treat .xlsb as macro-capable, because it is.

The counterintuitive professional caveat is this. File extensions are advisory labels, not security controls. A malicious actor can rename a macro-enabled file to .xlsx. Windows will warn that the extension does not match the content, and the file will likely fail to open correctly in Excel, but the label itself proves nothing. Security tools must inspect the actual package contents, not trust the filename.

Where the thresholds actually sit

Several numeric thresholds govern how these formats behave in practice, and they are often conflated.

The first is file size. Office Open XML packages are ZIP archives, so they compress well. A .docx holding a 100-page report may be smaller than the equivalent .doc because XML compresses efficiently, whereas binary Word files store formatting less compactly. Macro-enabled variants add the vbaProject.bin part, which typically adds tens of kilobytes, not megabytes, to the package.

The second is the Trust Center macro setting in Office applications. Microsoft exposes four settings: disable all macros without notification, disable all macros with notification, disable all macros except digitally signed macros, and enable all macros. The default for most current installations is the second option, which blocks execution and shows a yellow security bar. Organizations commonly push the third option through Group Policy, which blocks unsigned macros but allows those signed with a trusted certificate.

The third is the Protected View threshold. Files downloaded from the internet or received as email attachments open in Protected View, a read-only sandbox, regardless of extension. Even a macro-free .docx opens this way. The extension tells you what the file can contain, not whether the current session will execute anything.

These thresholds interact. A .xlsm with an unsigned macro, opened under the default setting, will display a warning bar and refuse to run the code until the user clicks Enable Content. A .xlsx can never trigger that prompt because there is no macro to enable. Reconciling the thresholds means understanding that the extension sets the ceiling on risk, while policy and user action determine whether that ceiling is reached.

What the extension does not tell you

The x suffix answers one question only: can this file contain VBA macros? It says nothing about other active content. Office Open XML documents can embed external links, DDE fields, OLE objects, and remote template references without any macro at all. Those vectors have been used in real attacks against .docx files.

A .docx can also contain a link to an external template that loads content from a remote server when opened. It can carry a DDE field that prompts the user to run a command. It can embed an OLE object that launches another application. None of these require VBA, so the macro-free guarantee does not make the file inert.

The extension also says nothing about digital signatures on the content itself, document provenance, or whether the file has been altered since creation. A macro-free document can still be a phishing lure. This is the misconception that costs organizations the most: equating "no macros" with "safe to open."

Practical actions for users and admins

Start with extension-level filtering. Block or quarantine .docm, .xlsm, .pptm, .dotm, and .xltm at the email gateway unless a business case exists for a specific sender. Treat .xlsb as macro-capable in the same rule.

Then apply content inspection. Configure endpoint tools to unzip Office Open XML packages and flag any that contain a vbaProject.bin part, regardless of the filename. This catches renamed files that slip past extension filters.

Here are concrete steps with thresholds worth adopting:

Set the Trust Center macro policy to disable all macros with notification, or to disable all except digitally signed macros where signing infrastructure exists. Enforce Protected View for files from the internet, email attachments, and potentially unsafe locations. Block .xlsb, .docm, .xlsm, .pptm, .dotm, and .xltm at the perimeter unless explicitly approved. Train users that a .docx or .xlsx can still be malicious through links, DDE fields, and OLE objects. Verify digital signatures on any macro-enabled file that policy allows to run. Log macro execution events and review them, since blocked macros still leave audit traces.

Red flags to treat as stop signals:

A file whose extension does not match its internal content type. A .docx or .xlsx that prompts for Enable Content, which should be impossible. Macro-enabled files arriving from external senders without prior arrangement. .xlsb files in email traffic, which are rarely legitimate. Documents requesting credentials or network access on open.

Timeline of the format shift

The naming convention did not appear overnight. Its adoption followed a multi-year migration.

Date Event
2003 Microsoft begins work on XML-based Office formats
2006 Office Open XML submitted for standardization
January 2007 Office 2007 ships with .docx, .xlsx, .pptx defaults
2008 ISO/IEC 29500 ratifies the format standard
2010 Office 2010 adds broader macro-enabled variant support
2016 Microsoft tightens default macro blocking in Office updates
2022 Microsoft begins blocking macros in files from the internet by default

That 2022 change is worth noting. Microsoft started blocking VBA macros in files downloaded from the internet across Access, Excel, PowerPoint, Visio, and Word, with a notification rather than silent execution. The policy reinforced the extension convention but did not replace it. Macro-enabled files still exist and still require explicit user consent, and the block can be overridden by users in some configurations.

Limits of the naming rule

The x-extension rule is a strong first filter and a weak final one. It depends on applications and operating systems honoring the convention, and on users reading filenames before double-clicking. It cannot detect renamed files that violate the convention. It cannot see active content that does not use VBA. It cannot evaluate intent.

The rule also assumes current software. Legacy Office installations and third-party viewers may not enforce the macro prohibition on .xlsx files, and some export tools produce malformed packages that confuse the parser. In those cases the extension describes intent, not guaranteed behavior.

For high-stakes environments, treat the extension as one signal among several. Pair it with content inspection, macro policy, Protected View, and user training. The x suffix tells you what a well-formed file is allowed to contain. It does not tell you what the file in front of you actually is, and that gap is where attacks live.

This article is general educational information about file format conventions, not a security certification, audit opinion, or compliance determination. It does not guarantee that any file is safe or that any configuration prevents compromise. Consult a qualified security professional for guidance specific to your environment, and follow your organization's incident response procedures if you suspect a malicious document.