Free DOCX test files and sample generator

Microsoft Word's Open XML document format. Used for rich text reports and templated documents.

Generate a .docx file →

What is a .docx file?

DOCX: Word Document. DOCX is the modern Word document: a ZIP package of XML parts. It is the most common document format in business, and the one most often uploaded to contract, CV and report-handling systems.

Why generate a test DOCX file?

What you can put inside a .docx file

You get 7 content options for DOCX, so the file holds something meaningful rather than random padding: Paragraph text, Table, Numeric / figures, Multi-page, Image, Bar chart, Pie chart. Pick several and they are merged into one file, with a section, sheet, slide or folder for each.

How a .docx file is identified

Every .docx 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 DOCX 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 DOCX content

[Word document], headings, paragraphs, tables and styles.

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 in Word or LibreOffice Writer, or extract text with python-docx / `unzip -p file.docx word/document.xml`.

Media type application/vnd.openxmlformats-officedocument.wordprocessingml.document · extension .docx · category Doc & TXT

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

Frequently asked questions about DOCX files

What identifies a .docx file?

A .docx 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 .docx 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 DOCX file?

There are 7 content options for .docx: Paragraph text, Table, Numeric / figures, Multi-page, Image, Bar chart, Pie chart. Choose more than one and they are combined into a single file, a section, sheet, slide or folder per option, rather than downloaded separately.

Can I download several broken DOCX files at once?

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

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

No, and deliberately. A .docx 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 DOCX file?

Open in Word or LibreOffice Writer, or extract text with python-docx / unzip -p file.docx word/document.xml.

Related Doc & TXT formats

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

Browse all file formats →