Free DOCM test files and sample generator

A Word document that may carry VBA macros. Security tooling, mail gateways and upload filters treat .docm differently from .docx, which is exactly why it needs testing.

Generate a .docm file →

What is a .docm file?

DOCM: Macro-Enabled Word Document. A DOCM is byte-for-byte the same kind of package as a DOCX: a ZIP of XML parts, with one string different: the content type declared for the main document part marks it macro-enabled. That single change is what makes mail gateways quarantine it, SharePoint warn about it and Word open it in Protected View. It is a good reminder that file-type decisions are made on declared type and extension, not on what a file actually contains.

Why generate a test DOCM file?

What you can put inside a .docm file

You get 4 content options for DOCM, so the file holds something meaningful rather than random padding: Paragraph text, Table, Numeric / figures, Multi-page. For DOCM these are alternatives, so choose the one that matches what you need to test.

How a .docm file is identified

Every .docm file begins with 50 4B 03 04, the ASCII letters "PK", the initials of Phil Katz, who created the ZIP format. That is what a validator inspecting content rather than the file name looks for.

How the size lands on the exact byte

The package is a ZIP, so the padding is trailing whitespace inside one of the XML parts it already contains. Extractors and Office readers both ignore it, so the document opens unchanged.

Negative testing with broken DOCM files

Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation.

Sample DOCM content

[Word document], same Open XML package as DOCX, macro-enabled content type.

This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.

How to open and verify the file

Open it in Word, or rename it to .zip and inspect [Content_Types].xml to see the macro-enabled override. Files generated here contain no VBA project at all. A macro-enabled document is not the same as a document containing a macro, and this site does not produce executable payloads. The extension and content type are what security tooling branches on, and those are genuine.

Media type application/vnd.ms-word.document.macroEnabled.12 · extension .docm · category Doc & TXT

Generate a .docm file → · questions about sizes, privacy or cost are answered on the site FAQ.

Frequently asked questions about DOCM files

What identifies a .docm file?

A .docm file begins with the bytes 50 4B 03 04, the ASCII letters "PK", the initials of Phil Katz, who created the ZIP format. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.

How can a .docm file be an exact number of bytes?

The package is a ZIP, so the padding is trailing whitespace inside one of the XML parts it already contains. Extractors and Office readers both ignore it, so the document opens unchanged.

What can go inside the DOCM file?

There are 4 content options for .docm: Paragraph text, Table, Numeric / figures, Multi-page. For DOCM these are alternatives, so pick the one matching what you need to test.

Can I download several broken DOCM files at once?

Yes, select more than one File Condition and you get one ZIP containing a .docm per condition, each named after its condition.

Can the DOCM file use UTF-16 or a byte-order mark?

No, and deliberately. A .docm file is a container rather than plain text, so rewriting its bytes as UTF-16 would not produce a UTF-16 document. It would produce a broken file. Use a text format such as CSV, JSON or XML for encoding tests.

How do I open or verify the DOCM file?

Open it in Word, or rename it to .zip and inspect [Content_Types].xml to see the macro-enabled override. Files generated here contain no VBA project at all. A macro-enabled document is not the same as a document containing a macro, and this site does not produce executable payloads. The extension and content type are what security tooling branches on, and those are genuine.

Related Doc & TXT formats

PDF · DOCX · TXT · DOC · MD · HTML · RTF · ODT

Browse all file formats →