DOCX

What is a DOCX file?

The Word format since 2007. A ZIP archive full of XML, which is why it converts reasonably well.

What DOCX is

DOCX is a container: a wrapper that holds streams encoded by something else. It is used for editing.

The extension is .docx, and the full name is Word Document. Both matter less than what the file can hold, which is what the rest of this page is about.

Where DOCX came from

Microsoft published it in 2007. The specification is ECMA-376.

Age is worth knowing here for one practical reason: the older a format is, the more programs have had time to learn it.

The specification is public

It is published in full, so anyone can implement it from the document rather than by inspection, which is why it turns up in so many programs and why files written twenty years ago still open. A published specification is not the same thing as a royalty-free one: where a format wraps a codec, the patent licensing is a separate question the standard does not settle.

It can hold several pages in one file

DOCX is not limited to one page, which matters when converting to something that is: one conversion produces one file holding a single page — the first one, unless the page is something the converter lets you pick.

It cannot contain macros

DOCX cannot carry executable code, which is why mail gateways and document portals let it through where they stop its macro-enabled twin.

What kind of document it is

DOCX holds a text document: paragraphs that reflow to fit whatever page they land on.

That is what decides how it converts: the text reflows, so page numbers are a property of the output rather than of the file.

What it does to protect itself

DOCX carries optional encryption.

An encrypted file has to be unlocked before anything can convert it, here or anywhere else — a password is not something a converter can work around, and one that claimed to could not be trusted with the file either.

What opens DOCX

Microsoft Word, LibreOffice Writer and Google Docs read it, and so do most programs of the same kind.

If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.

Opening it in a browser

No browser reads it.

That is the single most common reason to convert it: not that the format is bad, but that the place you want to show the file cannot read it.

What it can carry besides the content

DOCX can hold document properties.

Whether any of it survives a conversion depends entirely on the target, and the honest answer is usually "some of it".

It is a working format

DOCX is meant to be opened and changed. Keep the file in this format for as long as the work is going on, and export from it whenever a finished copy is needed.

What goes wrong with it

The recurring complaints: the layout is reconstructed rather than reproduced exactly.

None of these is a reason to avoid the format. They are the things worth knowing before you are surprised by one, which is a different claim and a more useful one.

A ZIP of XML, and you can look inside

Rename a `.docx` to `.zip` and open it. Inside is a small directory tree: `word/document.xml` holds the text, `word/styles.xml` the formatting definitions, `word/media/` every image, and `docProps/` the document properties. All of it is readable text you can inspect without Word.

This is why DOCX support outside Microsoft is genuinely good where DOC support was always approximate. The format was published as an open standard, so LibreOffice, Google Docs, Pages and dozens of libraries implement it against a specification rather than by reverse engineering. It is also why a corrupt document can sometimes be rescued by extracting `document.xml` by hand.

What travels with the file that you did not mean to send

The document properties carry the author, the person who last saved it, the company name from the Office installation, the total editing time and every revision date. A document created from a colleague’s template will often name them rather than you.

Tracked changes are the sharper edge. If changes were made with tracking on and never accepted, the original wording is still in the file — visible to anyone who switches the view. Comments are the same: hidden in one display mode, present in the XML regardless. Documents sent to clients, opposing counsel and journalists have repeatedly turned out to contain the negotiation that produced them.

Hidden text is an attribute, not a removal

Word can mark text as hidden, and hidden text does not print or display normally. It is still in `document.xml` in full, as ordinary characters with a formatting flag beside them.

The same applies to white-on-white text, text behind an image, and content in a collapsed heading. None of these are deletions. If something must not reach the recipient, it has to be deleted from the document — and the reliable way to confirm that is to convert to PDF, which writes only what is drawn, or to strip the metadata deliberately.

Styles against direct formatting

A heading made by applying the Heading 1 style and a heading made by selecting text and setting it to 16-point bold look identical on screen and are entirely different in the file. The first is structure; the second is decoration.

The difference decides whether the automatic table of contents works, whether the navigation pane is usable, whether a screen reader announces headings, and whether the document converts cleanly to PDF, HTML or EPUB. It is the single largest factor in whether a long DOCX is pleasant or miserable to work with, and it is invisible until something needs the structure.

DOCX cannot carry a macro project, and DOCM can

A file saved as `.docx` cannot contain a VBA project. This is deliberate and it is the most useful security property the format has: a macro-bearing document must be saved as `.docm`, which announces itself in the extension. What the rule does not survive is a rename — Word opens a document by its content rather than its extension, so a DOCM renamed to DOCX still loads with the code intact, and researchers document that being used.

So an unexpected `.docx` cannot run VBA, which is narrower than being safe to open. A macro-free document can point at a macro-bearing template on a remote server; CVE-2022-30190 reached code execution from a document with no macros in it at all; and OLE objects and DDE fields sit in ordinary documents, which is why Microsoft now blocks DDE launch and OLE auto-activation by default. The extension is a signal, not a verdict, and the content can still be a phishing attempt.

Fonts, and why the page breaks move

A DOCX names its fonts and does not usually embed them. Open a document on a machine that lacks the typeface and something else is substituted, with different letter widths, and the text reflows.

In a two-page letter that is invisible. In a fifty-page report it moves page breaks, pushes a table across a boundary and turns a one-line heading into two. Nothing is lost and nothing needs repairing — but if the pagination is part of the document, as in a legal filing or anything with a page-numbered index, send a PDF and keep the DOCX for editing.

Why the file is small, and when it is not

Everything in the archive is compressed, and document XML is highly repetitive, so a substantial report is often a few hundred kilobytes. Text costs almost nothing.

What makes a DOCX large is images, and specifically images inserted at camera resolution and then scaled down on the page. Word stores the original, so a document showing eight photographs at postcard size can carry forty megabytes of full-resolution JPEG. Word’s own compress-pictures option resamples them, and it is usually the difference between an attachment that sends and one that bounces.

Converting to PDF, and what it settles

PDF fixes the layout, embeds the fonts, and writes what is actually drawn on the page — so hidden text and comments do not appear in the output. It is the honest way to send a finished document.

Tracked changes are the exception, and the one worth checking before a document leaves the building. The conversion runs with the defaults, which display unaccepted changes, and what is displayed is what is exported: the mark-up lands in the PDF. Accept or reject it first.

Two things converting does not remove. The document properties are frequently inherited by the PDF, so the author name travels unless it is cleared deliberately. And the conversion is one-way in practice: a PDF can be converted back to something editable, but the result is a reconstruction rather than the original document. Keep the DOCX.

Converting to ODT, and the reverse

Both formats are ZIP archives of XML describing the same kind of object, so the translation is structural rather than a reconstruction. Text, headings, lists, tables, footnotes, images, hyperlinks, comments and tracked changes all cross over dependably in both directions.

What drifts is at the margins — some list numbering, some frame positioning, some field types are expressed differently by the two — so a heavily styled document can shift slightly. For ordinary documents the converted file is the same document, which is why this pair converts far better than either does to the old binary DOC.

The facts, in one place

Identifiers and provenance for the DOCX format.
Extension.docx
Media typeapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
Published byMicrosoft
First published2007
SpecificationECMA-376