Introduction
DOCX is the default format of
Microsoft Word since Word 2007, replacing the older
binary .doc. It is part of
Office Open XML, standardised as ECMA-376 and ISO/IEC 29500. A DOCX file is a ZIP
archive of XML files: the text and its formatting, the styles, the numbering of lists,
comments, headers, footers and the pictures.
Related extensions use the same layout: .docm for documents with macros
and .dotx for templates.
Structure
The ZIP package follows the Open Packaging Conventions.
[Content_Types].xml gives the type of each part, and
_rels/.rels points to the main document,
word/document.xml. Its body is a list of paragraphs (w:p),
each made of runs (w:r) of text (w:t) that share the same
formatting. Tables, section settings and references to pictures sit among the
paragraphs.
zip[Content_Types].xml the media type of each partXMLzip_rels/.rels points to the main document and propertiesXMLzipword/document.xml the body: paragraphs, runs, tablesXMLzipword/styles.xml, numbering.xml, settings.xmlXMLzipword/media/ the picturesimageszipdocProps/ title, author, dates and statisticsXML
Links
Software
- Microsoft Word (Windows, macOS, web, mobile)
- LibreOffice Writer (Windows, macOS, Linux)
- Google Docs (web browsers)
- Apple Pages (macOS, iOS)
- ONLYOFFICE (Windows, macOS, Linux, web)
- Pandoc (command line converter)
Developers
- python-docx, Python library that reads and writes DOCX
- Apache POI, Java library for Office files, DOCX through its XWPF classes
- Open XML SDK, .NET library from Microsoft for Office Open XML packages
- Mammoth, JavaScript library that converts DOCX to HTML
Reference
- ECMA-376 Office Open XML File Formats, Ecma International