Free DOC test files and sample generator

The legacy binary Microsoft Word format, still common in older document workflows and compatibility testing.

Generate a .doc file →

What is a .doc file?

DOC: Word 97–2003 Document. The legacy Word 97-2003 document. Because the binary format is notoriously intricate, our .doc files are written as Rich Text, a native Word format that Word, WordPad and LibreOffice all open from a .doc extension, which is the reliable way to produce a genuinely openable legacy document.

Why generate a test DOC file?

What you can put inside a .doc file

You get 3 content options for DOC, so the file holds something meaningful rather than random padding: Paragraph text, Numeric / figures, Multi-page. For DOC these are alternatives, so choose the one that matches what you need to test.

How a .doc file is identified

Every .doc file begins with 7B 5C 72 74 66 31, "{\rtf1", this .doc is Rich Text Format, which Word opens natively regardless of the extension. The binary OLE2 form was tried and real Word refused it. That is what a validator inspecting content rather than the file name looks for.

How the size lands on the exact byte

An ignorable RTF group carries the padding: readers skip groups marked with \*, so Word never shows it.

Negative testing with broken DOC 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 DOC content

[Word 97–2003], binary .doc document.

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, WordPad or LibreOffice Writer.

Media type application/msword · extension .doc · category Doc & TXT

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

Frequently asked questions about DOC files

What identifies a .doc file?

A .doc file begins with the bytes 7B 5C 72 74 66 31, "{\rtf1", this .doc is Rich Text Format, which Word opens natively regardless of the extension. The binary OLE2 form was tried and real Word refused it. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.

How can a .doc file be an exact number of bytes?

An ignorable RTF group carries the padding: readers skip groups marked with \*, so Word never shows it.

What can go inside the DOC file?

There are 3 content options for .doc: Paragraph text, Numeric / figures, Multi-page. For DOC these are alternatives, so pick the one matching what you need to test.

Can I download several broken DOC files at once?

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

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

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

Open in Word, WordPad or LibreOffice Writer.

Related Doc & TXT formats

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

Browse all file formats →