Introduction
This is the format of Word 97, 2000, 2002 and 2003, and of most .doc files
in circulation. Word 2007 and later still open and save it as “Word 97–2003 Document”.
It added Unicode text to the Word 6.0
and 95 design and moved the document’s tables into a stream of their own.
Microsoft publishes the format in full as [MS-DOC], one of its Office open specifications.
Structure
The file is a compound file, which starts with the signature
D0 CF 11 E0 A1 B1 1A E1 and holds named streams like files in a small file
system. The WordDocument stream begins with the File Information Block
(FIB), whose wIdent is 0xA5EC and nFib is 193
(0x00C1), followed by the text. A flag in the FIB says whether the table
stream is named 0Table or 1Table; it holds the piece table,
which says where each run of text is and whether it is 8-bit or UTF-16, together with
the styles, fonts, lists and formatting. Pictures live in the Data stream
and embedded objects in ObjectPool.
cfbWordDocument the FIB, then the text and formatting runsstreamcfb0Table or 1Table piece table, styles, fonts, listsstreamcfbData pictures and other binary dataoptionalcfbObjectPool embedded OLE objectsoptionalcfbSummaryInformation, DocumentSummaryInformation title, author, datesstreams
Links
Software
- Microsoft Word (Windows, macOS, web, mobile)
- LibreOffice Writer (Windows, macOS, Linux)
- Google Docs (web browsers)
- Apple Pages (macOS, iOS)
Developers
- Apache POI, Java library for Office files, Word documents through its HWPF classes
Reference
- [MS-DOC]: Word (.doc) Binary File Format, Microsoft
- [MS-CFB]: Compound File Binary File Format, Microsoft