# .DOCM MIME Type and Content-Type Header

> Word documents that can contain VBA macros, with the same ZIP-of-XML structure as .docx.

- MIME type: `application/vnd.ms-word.document.macroEnabled.12`
- Extensions: .docm
- Content-Type header: `application/vnd.ms-word.document.macroEnabled.12`
- Compress in transit: no (already compressed)
- File signature: `50 4B 03 04` (the ZIP signature — this format is a ZIP archive inside)

## Good to know

- Office blocks macros in files downloaded from the internet by default, so a `.docm` from your site opens with its macros disabled.
- If users upload Office files, treat macro-enabled types as higher risk — or accept only `.docx`.
- Apache's stock config spells the type in lowercase (`macroenabled`). MIME types are case-insensitive, but a naive string comparison in an upload validator isn't.

## Server configuration

### nginx (inside the types block in mime.types)

```
application/vnd.ms-word.document.macroEnabled.12 docm;
```

### Apache (.htaccess or server config)

```
AddType application/vnd.ms-word.document.macroEnabled.12 .docm
```

### Express

```
res.set("Content-Type", "application/vnd.ms-word.document.macroEnabled.12");
```

### Python

```
import mimetypes

mimetypes.add_type("application/vnd.ms-word.document.macroEnabled.12", ".docm")
```

### HTML file input

```
<input type="file" accept=".docm,application/vnd.ms-word.document.macroEnabled.12">
```

## FAQ

### What is the MIME type for .docm files?

`application/vnd.ms-word.document.macroEnabled.12`.

### What Content-Type header should a .docm file be served with?

`Content-Type: application/vnd.ms-word.document.macroEnabled.12`. It's already compressed, so servers shouldn't gzip it.

### How can I tell if a file is really a .docm?

Check its bytes rather than the extension: DOCM files start with `50 4B 03 04` (`PK..`) — the ZIP signature — this format is a ZIP archive inside. On the command line, `file --mime-type name.docm` does this for you.

## Related types

- [.docx — application/vnd.openxmlformats-officedocument.wordprocessingml.document](https://www.devkult.com/mime/docx.md)
- [.doc — application/msword](https://www.devkult.com/mime/doc.md)
- [.xlsm — application/vnd.ms-excel.sheet.macroEnabled.12](https://www.devkult.com/mime/xlsm.md)

Open the interactive page: https://www.devkult.com/mime/docm