devkult_
tools29converters34
home/mime/.docx

.docx MIME type

Word documentdocuments

application/vnd.openxmlformats-officedocument.wordprocessingml.document

Modern Word documents — a ZIP archive of XML files.

MIME typeapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
Extensions.docx
Content-Typeapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
Compress in transit?No — already compressed
File signature50 4B 03 04 (PK..)
the ZIP signature — this format is a ZIP archive inside

Good to know

  • Because a .docx is a ZIP file, naive type detection by signature reports application/zip. Check the extension or the archive's [Content_Types].xml.
  • Macro-enabled documents use .docm and a different type: application/vnd.ms-word.document.macroEnabled.12.

Serve .docx files with the right type

The response header to send:

Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

nginx (inside the types block in mime.types)
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
Apache (.htaccess or server config)
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document .docx
Express
res.set("Content-Type", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
Python
import mimetypes

mimetypes.add_type("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx")
HTML file input
<input type="file" accept=".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document">

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.docx | grep -i '^content-type:'
file --mime-type file.docx

Frequently asked questions

What is the MIME type for .docx files?

application/vnd.openxmlformats-officedocument.wordprocessingml.document.

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

Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document. It's already compressed, so servers shouldn't gzip it.

How can I tell if a file is really a .docx?

Check its bytes rather than the extension: DOCX 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.docx does this for you.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options