# .doc MIME Type: application/msword

> Legacy binary Word documents.

- MIME type: `application/msword`
- Extensions: .doc
- Content-Type header: `application/msword`
- Compress in transit: no (already compressed)
- File signature: `D0 CF 11 E0 A1 B1 1A E1` (the OLE2 compound-file signature shared by legacy Office formats)

## Good to know

- Macros in legacy Office files are a common malware vector; scan uploads.

## Server configuration

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

```
application/msword doc;
```

### Apache (.htaccess or server config)

```
AddType application/msword .doc
```

### Express

```
res.set("Content-Type", "application/msword");
```

### Python

```
import mimetypes

mimetypes.add_type("application/msword", ".doc")
```

### HTML file input

```
<input type="file" accept=".doc,application/msword">
```

## FAQ

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

`application/msword`.

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

`Content-Type: application/msword`. It's already compressed, so servers shouldn't gzip it.

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

Check its bytes rather than the extension: DOC files start with `D0 CF 11 E0 A1 B1 1A E1` — the OLE2 compound-file signature shared by legacy Office formats. On the command line, `file --mime-type name.doc` does this for you.

## Related types

- [.docx — application/vnd.openxmlformats-officedocument.wordprocessingml.document](https://www.devkult.com/mime/docx.md)
- [.rtf — application/rtf](https://www.devkult.com/mime/rtf.md)
- [.odt — application/vnd.oasis.opendocument.text](https://www.devkult.com/mime/odt.md)

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