Rutba Office

What is actually inside a .docx file

Rename it to .zip and look. Understanding the parts explains almost everything about why documents behave the way they do between programs — and lets you fix a corrupt file by hand.

8 September 2026 · 6 min read

Try it first

Copy any .docx, rename the copy to .zip, and open it. Nothing about the file is hidden — Office Open XML is an ECMA and ISO standard, and the container is an ordinary ZIP archive. What you are looking at is the whole document.

The parts, and what each one does

  • `[Content_Types].xml` — the manifest. Every part in the package is declared here with its type. If this is wrong, nothing opens.
  • `_rels/.rels` — the root relationships, pointing at the main document part.
  • `word/document.xml` — the document itself. Paragraphs (`w:p`), runs of text with identical formatting (`w:r`), tables, section properties. This is where the words are.
  • `word/styles.xml` — style definitions. "Heading 1" is a name here, and paragraphs reference it rather than repeating its formatting.
  • `word/numbering.xml` — list definitions, which is why lists are the thing that most often goes wrong between programs.
  • `word/settings.xml` — document-wide settings, including whether change tracking is on.
  • `word/media/` — the images, as ordinary files. You can extract every picture from a document by unzipping it.
  • `word/_rels/document.xml.rels` — the relationships from the document to everything else. Images, hyperlinks and embedded objects are referenced by relationship id (`rId7`), not by filename, which is why moving parts around by hand goes wrong.
  • `docProps/core.xml` and `app.xml` — metadata: author, revision, editing time, word count.

An .xlsx has `xl/workbook.xml`, `xl/worksheets/sheet1.xml`, `xl/sharedStrings.xml` and `xl/styles.xml`; a .pptx has `ppt/slides/slide1.xml` with layouts and masters behind it. Same container, same relationship model, different vocabulary.

One detail that explains a lot: shared strings

In an .xlsx, text cell values are usually not stored in the sheet. They live once in `xl/sharedStrings.xml`, and the cell holds an index into that table. It is why a spreadsheet with a hundred thousand identical labels is small, and why a corrupt shared-strings part turns an entire workbook into numbers and blanks at once rather than damaging one area.

Repairing a document by hand

Because it is a ZIP of XML, a damaged .docx is sometimes repairable with ordinary tools, and it is worth trying before paying for recovery software.

  • Unzip it. If the ZIP itself will not open, that is a different problem and a ZIP repair tool is the right instrument.
  • Run `document.xml` through any XML validator. Truncation and a single unclosed tag are the common faults, and both are visible immediately.
  • Fix the XML, re-zip the folder — with `[Content_Types].xml` at the root of the archive, not inside a subfolder — and rename back to .docx.

It is fiddly and it works more often than people expect, because most "corrupt" documents are one malformed part rather than a shredded file.

Why any of this matters to a normal user

Two reasons, and neither requires you to ever unzip anything again.

First, it explains formatting loss. Parts are separable, so a program can preserve the ones it does not understand — or discard them. Once you know a document is a package of parts rather than a monolith, "why did my chart become a picture" has an obvious answer.

Second, it is why the format outlived the program. A .docx from 2007 opens today because it is standardised, self-describing XML in a ZIP. That is a genuinely good reason to prefer it over anything proprietary and opaque, whatever you think of the company that designed it.

Our own product, disclosed

Where our own software comes into this

Our engine is built directly on the structure above: it keeps the package, edits the parts it needs, and writes the rest back untouched. The article’s last section is the argument for that design and this is the software that took it.

It is also why the engine is a separate set of packages rather than something buried inside an application — the ZIP and package layer, the spreadsheet calculation engine and the .pptx renderer are each usable on their own, under the AGPL, or under a commercial licence if you are embedding them in something closed.

Download it free →Compared with the alternatives →

Seven apps, one free download

No account, no telemetry, and it works with the network switched off.