file in abyss
Back to formats

Document

DOCX Word Open XML Document

Word Open XML Document is a document format commonly identified by .docx. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .docx
MIME application/vnd.openxmlformats-officedocument.wordprocessingml.document

Magic numbers

Analyze your file
offset 0 Word Open XML Document leading signature
50 4B 03 04
PK..

Structure

  1. ZIP container
  2. [Content_Types].xml
  3. _rels/.rels
  4. word/document.xml

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 50 4B 03 04, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("504b0304")
OFFSET = 0

def is_docx(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

Word Open XML Document is used for data exchange, imports, exports, parser testing, and validation workflows. Encoding, delimiters, versions, and container structure often change implementation behavior.

Common detection mistakes

  • The .docx extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • Word Open XML Document can start with signatures such as 50 4B 03 04, but related containers and damaged files may require additional validation.

Security notes

Document formats may include scripts, attachments, macros, or external references. Sandbox previews and conversions, and avoid opening untrusted files directly.

Using samples

11 samples help test leading-byte detection, parser errors, upload limits, and download behavior.

Sample files

11 / 11 files
Sample Traits Size Source / license / SHA-256
Doc

Blue Sky DOCX

Blue Sky DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.docx
Type Sample
1.4 KB
SHA-256 ecdeb8876f29896e26ab2291c275b7dda500eb769669fbdaa5b3e16123eb7bb0
Download
Doc

Flower Garden DOCX

Flower Garden DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.docx
Type Sample
1.5 KB
SHA-256 aa9203da7c21b43c532ac66622a34ce7952efbc62fb49cab0cf7d53f685c276d
Download
Doc

Navy Blue Sky DOCX

Navy Blue Sky DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.docx
Type Sample
1.5 KB
SHA-256 165ba457ca04d0963c0f8779cc1aafb8eca9dd87a5c996d1c0a62e6f845248fe
Download
Doc

Nature of the Sky DOCX

Nature of the Sky DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.docx
Type Sample
1.6 KB
SHA-256 8a5ba5754bee861941c74d490604a26e53a156097574b4492fbd62e20c40e8b6
Download
Doc

Sky Landscape DOCX

Sky Landscape DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.docx
Type Sample
1.6 KB
SHA-256 cb45942888fa84fe6c1f5d06023f317dcee8a0271ba333947a1da78aef77b1bf
Download
Doc

Starry Sky DOCX

Starry Sky DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.docx
Type Sample
1.7 KB
SHA-256 febd4887b583dfc0ab0f253fb2056ec0f6a16e7fc44f616ba35d926e0185c89b
Download
Doc

Blue Night Sky DOCX

Blue Night Sky DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.docx
Type Sample
1.7 KB
SHA-256 1663e4dc8e2ab1f0f6edb16ff0bbd55fd42abbabfa0bbb78e31e4e9e8333becc
Download
Doc

Hibiscus Flower DOCX

Hibiscus Flower DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.docx
Type Sample
1.8 KB
SHA-256 a77a5e581defd26e8dce364ee2de805ae26e5da346c76a5f651c8b51c2774111
Download
Doc

Arctic Sky DOCX

Arctic Sky DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.docx
Type Sample
1.8 KB
SHA-256 2cd4ca0ad25fb60fca45a22f258c6192c86ddb0c692f2e8456774aa7d877cbb7
Download
Doc

Sunset Rays DOCX

Sunset Rays DOCX is a Word Open XML Document sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.docx
Type Sample
1.9 KB
SHA-256 c84d64f4acb2619f46470635e9297e70176651cfbb11506c698bee85d03cbb03
Download
Doc

NASA Blue Marble DOCX

NASA Blue Marble DOCX is a Word Open XML Document sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.docx
Type Sample
2.1 KB
SHA-256 b2cdfa34dc8f4c1c102ade1829c7cb322bbd2c6e4fa5358c9c44f5ed992abd27
Download

Frequently asked questions

What is the magic number (file signature) of Word Open XML Document?

Word Open XML Document files begin with the byte signature 50 4B 03 04 ("PK.."). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of Word Open XML Document?

The MIME type for Word Open XML Document is application/vnd.openxmlformats-officedocument.wordprocessingml.document.

What file extension does Word Open XML Document use?

Word Open XML Document files use the .docx extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats