What is the DOC file format?
Files with the .doc extension contain formatted text documents stored in a proprietary binary format of Microsoft Word. The format uses an OLE2 Compound File Binary container - the same structured storage shared by legacy Office files like .xls and .ppt - identified internally by a WordDocument stream. Its magic bytes (D0 CF 11 E0 A1 B1 1A E1) appear at the very start of the file, making .doc easy to tell apart from the newer .docx, which is a ZIP-based archive.
The format structure varied between Word versions; the modern OLE2-based layout dates from Word 97 (1997) and was the default through Word 2003. It has since been largely displaced by the XML-based .docx, designed to provide better portability. .doc files can still be created in Word and most word processors today.
.doc files may contain:
- Text and its formatting (fonts, styles, page layout),
- tables,
- images and embedded objects,
- macros (VBA scripts).
Microsoft published the specification of the .doc format only in 2008, to enable other programs to handle those files properly. Nonetheless, the format had already been reverse-engineered to obtain all its details. Before the proprietary Microsoft format appeared in 1983, the .doc extension was also used for plain text files and documents from the WordPerfect program. Template files that share the same binary structure use the .dot extension. The official MIME type is application/msword.
Security & safety
RISK: MEDIUMThe real risk in .doc files is VBA macros: the binary format is a classic carrier for macro malware ("Enable Content" phishing). Modern Office opens DOC files from email or the internet in Protected View with macros disabled - do not enable editing or macros on a document you didn't expect. Opening in LibreOffice or Google Docs is generally safer because their macro engines differ from Word's VBA. The document text itself is harmless; only embedded macros and linked objects pose a threat.
Format details
in a nutshellPrograms that open DOC files
Technical details
deep spec| Container format | OLE2 Compound File Binary (CFB structured storage) |
| Magic bytes | D0 CF 11 E0 A1 B1 1A E1 - 8 bytes at file offset 0 |
| MIME type | application/msword |
| Primary internal stream | WordDocument stream holds the main document content and formatting |
| Supporting streams | 0Table or 1Table stream stores string pool, object references, and revision data |
| Character encoding | UTF-16 LE (Word 97-2003); pre-97 versions used ANSI code pages |
| Macro language | VBA macros stored in an embedded OLE2 Macros storage within the file |
| Compression | None - uncompressed binary; an equivalent .docx is typically 60-80% smaller |
| Encryption | RC4 with 40-bit key (Word 97-2003); insufficient by modern security standards |
| Revision tracking | Change-tracking data encoded as binary revision marks in the WordDocument stream |
| Embedded objects | OLE2 embedding and linking for spreadsheets, charts, and other Office components |
| Template variant | .dot files share the same binary format with an internal flag marking them as templates |
| Word version range | Word 97 (1997) through Word 2003; still readable in current Word and LibreOffice |
| Cross-application support | LibreOffice Writer, Google Docs, and Apple Pages open .doc with minor rendering differences |
| Macro security risk | VBA macros can execute arbitrary code; modern Word disables them by default via Trust Center |
| Released | 1983 (Word 1.0); the modern OLE-based .doc layout dates from Word 97 (1997) |
| Specification | learn.microsoft.com |
DOC conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about DOC files.