The basics
What is a DOTX file?
A DOTX file is a Word template: a file that new documents are made from. Letterheads, invoice and report layouts, CV designs and company style sets are usually distributed as templates. When you use one, Word doesn't open the file itself. It creates a new, untitled document (Document1, Document2…) with a copy of the template's text, styles, page setup, headers, footers and building blocks, and leaves the template unchanged for next time.
Inside, a DOTX is built exactly like a DOCX: XML parts in a ZIP package, defined by the Office Open XML standard (ECMA-376, ISO/IEC 29500). Word has used it for templates since Word 2007; before that, templates were binary DOT files.
- It's a starting point, not a document. Double-click a DOTX and you get a new document. To change the template itself, you open it from inside Word.
- It can't contain macros. A template with VBA code must be saved as DOTM.
- It's not the same as Normal.dotm. Every blank Word document is based on a global template called
Normal.dotm. A DOTX is a template you choose on purpose, for a particular kind of document.
Anatomy
What's inside a DOTX file
A DOTX is a DOCX package with one difference. Our sample-minimal.dotx has only the three parts a template needs, written by hand; here they are, part by part.
$ unzip -l sample-minimal.dotx
Length Date Time Name
--------- ---------- ----- ----
430 2026-10-27 12:00 [Content_Types].xml
298 2026-10-27 12:00 _rels/.rels
565 2026-10-27 12:00 word/document.xml
First 4 bytes: 50 4b 03 04 (PK..)
[Content_Types].xml, indented for reading:
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="rels"
ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
<Default Extension="xml" ContentType="application/xml"/>
<Override PartName="/word/document.xml"
ContentType="application/vnd.openxmlformats-officedocument
.wordprocessingml.template.main+xml"/>
</Types>
_rels/.rels:
<Relationship Id="rId1" Target="word/document.xml"
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"/>
word/document.xml:
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:body>
<w:p><w:r><w:rPr><w:b/></w:rPr><w:t>[Your heading]</w:t></w:r></w:p>
<w:p><w:r><w:t xml:space="preserve">Sample DOTX from 99helpers.com/file-types/dotx</w:t></w:r></w:p>
<w:sectPr>
<w:pgSz w:w="11906" w:h="16838"/>
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440"/>
</w:sectPr>
</w:body>
</w:document>- 1
50 4b 03 04The ZIP signature
Every DOTX starts like every DOCX and every ZIP file. Tools that only read the first bytes can't tell a template from a document, or from a ZIP archive.
- 2
[Content_Types].xmlThe content types
Gives the type of each part. It's the only place in the package where a template and a document differ.
- 3
<Override PartName="/word/document.xml"The main part's entry
An Override applies to one named part, here the main document part.
- 4
…wordprocessingml.template.main+xmlThe template content type
In a DOCX this says
…wordprocessingml.document.main+xml. Changedocumenttotemplateand Word treats the package as a template; a DOTM saysapplication/vnd.ms-word.template.macroEnabledTemplate.main+xmlinstead. - 5
_rels/.relsThe package relationships
Identical to a DOCX: the main part is linked with the ordinary
officeDocumentrelationship. There's no separate relationship type for templates. - 6
word/document.xmlThe template's content
The text, tables and section settings every new document starts with. The XML is the same WordprocessingML as in a document.
- 7
<w:t>[Your heading]</w:t>A placeholder
Plain text in brackets that the user types over. Real templates also use content controls and fields for this.
- 8
<w:pgSz w:w="11906" w:h="16838"/>Page setup
A4 paper and one-inch margins, in twentieths of a point. Page size and margins are among the main things a template passes on.
- 9
(no styles.xml)What a real template adds
Most of a template's value is in parts this file leaves out:
styles.xmlwith its paragraph and character styles, headers and footers, numbering, the theme and the document properties.
Under the hood
What makes a DOTX different from a DOCX
Only one thing: the content type of the main document part in [Content_Types].xml. Our sample-letter.dotx and sample-letter.docx hold the same letter, and every part in the two packages is byte-for-byte identical except that file, where one word differs:
| File | Content type of word/document.xml |
|---|---|
.docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml |
.dotx | application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml |
.docm | application/vnd.ms-word.document.macroEnabled.main+xml |
.dotm | application/vnd.ms-word.template.macroEnabledTemplate.main+xml |
That has a practical consequence: renaming a file changes the extension, but not the content type inside, so the two disagree. Programs that read the package go by the content type. In our tests, LibreOffice opened sample-letter.dotx renamed to .docx as a new untitled document, and the DOCX renamed to .dotx as an ordinary document. Use Save As to turn one into the other; it rewrites the content type.
A document made from a template remembers where it came from, in two places:
docProps/app.xmlholds the template's name in a<Template>element, such asNormal.dotmorLetter.dotx. Word shows it in the document's Advanced Properties.word/settings.xmlcan hold an<w:attachedTemplate>element that points, throughword/_rels/settings.xml.rels, to the template's full path or address. Word looks there for the template's styles and building blocks, and it's the link that template-injection attacks abuse (see the security section).
In Word
How templates work in Word: new documents, folders and Normal.dotm
- Use a template: double-click the DOTX in File Explorer or Finder, or in Word choose File, New, then Personal (sometimes labelled Custom) and pick it. Either way you get a new, unsaved document.
- Edit a template: in Word choose File, Open and open the
.dotxitself. The title bar then shows the template's file name rather than Document1. Make the changes, save and close. - Where your templates live on Windows: Word saves templates to
Documents\Custom Office Templatesby default, and lists that folder under File, New, Personal. File, Options, Save, Default personal templates location changes it. - On a Mac: choosing Word Template as the format in Save As puts the file in Word's own templates folder, and File, New from Template lists it.
- Normal.dotm, the global template behind every blank document, sits in
C:\Users\<user name>\AppData\Roaming\Microsoft\Templateson Windows. It's macro-enabled, so the DOTM page covers it.
What a new document inherits from a DOTX:
| Part of the template | In the new document |
|---|---|
| Text, tables, images, placeholders | Copied |
| Styles, theme, page size, margins | Copied |
| Headers, footers, fields | Copied |
| The link to the template | Kept: the document stays attached to the template, which Word uses for building blocks and, if you ask it to, for updating styles |
How to
How to make, use and convert a DOTX file
- Make one in Word: set up a document with the styles, page layout and placeholder text you want, then File, Save As, and pick **Word Template (*.dotx) as the type. For a template with macros, choose Word Macro-Enabled Template (*.dotm)** instead.
- Turn a template back into a document: open it the normal way (double-click or File, New), which creates Document1, then save that as a
.docx. - LibreOffice Writer opens a DOTX as a new untitled document and can save one: File, Save As, Word 2007 Template (the name in LibreOffice 24.2). On a server:
soffice --headless --convert-to 'dotx:MS Word 2007 XML Template' letter.docx, andsoffice --headless --convert-to docx letter.dotxfor the other direction. - Google Docs converts an uploaded DOTX into an ordinary Google Doc; it doesn't keep it as a template. Work and school accounts can submit a Google Doc to their organisation's template gallery, if the administrator allows it.
- In code: python-docx 1.2 refuses a DOTX ("not a Word file, content type is '…template.main+xml'"). Change the content type in
[Content_Types].xmlto the document type, or the other way round, to convert between the two without Word. - In a browser: browsers can't display DOTX files, so a link to one downloads it.
Comparison
DOTX vs DOTM, DOT, OTT and DOCX
| Extension | What it is | Structure | Macros |
|---|---|---|---|
.dotx | Word template | ZIP of XML | No |
| `.dotm` | Word macro-enabled template | ZIP of XML, plus a VBA project | Yes |
| `.dot` | Word 97-2003 template | Binary, OLE2 compound file | Yes, same extension |
| `.ott` | OpenDocument text template (LibreOffice) | ZIP of XML | Yes, same extension |
| `.docx` | Word document | ZIP of XML | No |
Choose DOTX for templates that only need text, styles and layout: it can't carry code, so it opens without macro prompts and passes mail filters. Keep a DOT only for people on Word 2003 or older, and use OTT if the people using the template work in LibreOffice.
Troubleshooting
Common DOTX problems and how to fix them
- Double-clicking the template opens Document1, not the template. That's how templates work. To edit the template, open it with File, Open in Word.
- I edited the template by accident. You opened the
.dotxitself (with File, Open) and saved. Next time, check the title bar: it shows Document1 for a new document and the template's file name when you're editing the template. - The template opens as a normal document. The file is a DOCX with a
.dotxname, or was saved by a tool that kept the document content type. Open it, then Save As Word Template, which rewrites the content type. - My template doesn't appear under File, New, Personal. It isn't in the folder Word lists. Move it to
Documents\Custom Office Templates, or point Default personal templates location (File, Options, Save) at its folder. - Documents open slowly, or say the template can't be found. The document is attached to a template on a network share or old drive that's no longer there, and Word waits for it before giving up. For Word 2007, Microsoft documented a wait of 30 to 60 seconds when the share doesn't exist. Attach the document to Normal or a local template (Developer tab, Document Template) and save it.
- Changing the template doesn't change my old documents. A document gets a copy of the styles when it's created. To pull in later changes, use Developer, Document Template, tick Automatically update document styles, and reopen it.
- It downloads as a ZIP file. The server sends
application/zipor an unknown type. Serve it with the DOTX MIME type above.
Security
Is a DOTX file safe to open?
A DOTX can't hold VBA macros; Word removes them if you save a template with macros in this format. The risks come from what the package can point to:
- Remote template injection. The
attachedTemplatelink in a document can be a web address. Word fetches that template when the document opens, which lets an attacker bring a macro-enabled template into a document that contains no macros itself. MITRE ATT&CK lists this as Template Injection (T1221). - Links, fields and embedded objects in the template are copied into every document made from it.
- Macros in other templates. Global templates such as
Normal.dotmand add-ins in Word's Startup folder can hold code; the DOTM page explains what to check.
Only install templates from sources you trust, keep Office updated, and don't enable content because a document asks you to.
Free downloads
Sample DOTX files to download
Free sample Word templates for testing uploads, file-type detection, converters and template handling. Each one is a valid ZIP package with the template content type, opens in LibreOffice as a new untitled document and converts to PDF. None contains macros.
Browsers can't show this kind of file in a page. Download it to open it in the app it belongs to.
What's inside sample-letter.dotx
Browsers can't preview DOTX files, so download it and double-click it: Word or LibreOffice opens a new, untitled letter based on it. These are the parts to look for.
Named styles
Sender Name, Sender Details, Recipient Address, Letter Date, Subject Line, Closing and Signature Name, all in
word/styles.xml. Change one style and every paragraph that uses it follows.Placeholders
Bracketed text such as
[Recipient name]in a character style called Placeholder, with a light blue shading so it's easy to spot and type over.A date field
A DATE field with the format
d MMMM yyyy, which shows the current date in each new letter, for example "27 October 2026".Header and footer
The sender block sits in the header, so it repeats on every page. The footer has a PAGE field.
Page setup
A4 with 2.5 cm side margins, stored in the section properties at the end of
word/document.xml.Document properties
Title "Letter template", a subject, keywords and the note that it's a free sample from 99helpers.com/file-types/dotx, in
docProps/core.xml.The content type
…wordprocessingml.template.main+xmlforword/document.xml. That one entry is all that separates it fromsample-letter.docx.
All sample DOTX files
Letter template
sample-letter.dotx · 22.5 KB (23,037 bytes)
A one-page A4 business letter template for a fictional studio: custom styles, bracketed placeholders, a DATE field, a header with the sender block and a footer with a page number.
- Checking that an app creates a new document from a template
- Testing file-type detection of templates
The same letter as a DOCX
sample-letter.docx · 22.5 KB (23,032 bytes)
Built from the same document as the template. Every part is identical except the content type in
[Content_Types].xml:document.main+xmlinstead oftemplate.main+xml.- Comparing a template with a document
- Testing code that must tell DOTX from DOCX
Report template (saved by LibreOffice)
sample-report.dotx · 24.3 KB (24,929 bytes)
A two-page report template with Heading 1 to 3 styles, a filled-in table of contents, a cover block with placeholders, a styled table with a caption and PAGE of NUMPAGES in the footer. Saved by LibreOffice 24.2 with its Word template filter.
- Testing templates written by another app than Word
- Checking heading styles and a TOC field survive conversion
Minimal DOTX, three parts
sample-minimal.dotx · 1.0 KB (1,059 bytes)
Only
[Content_Types].xml,_rels/.relsandword/document.xml, written by hand: no styles or properties. It's the file shown in the anatomy above.- Parser tests: don't assume optional parts exist
- Seeing the template content type on its own
Ways to test with them
- Template or document: all four files start with
50 4B 03 04, and thefilecommand calls both letters "Microsoft Word 2007+". Read the content type of/word/document.xmlin[Content_Types].xmlto tell them apart. - New document, not the file: open
sample-letter.dotxin the app you're testing. Word and LibreOffice create an untitled document; an app that opens and saves over the template has a bug. - Libraries: python-docx 1.2 loads
sample-letter.docxbut rejectssample-letter.dotxbecause of its content type. Decide whether your code should accept templates, and test both. - Uploads and MIME types: check that your server sends
application/vnd.openxmlformats-officedocument.wordprocessingml.templatefor.dotx, not the DOCX type orapplication/zip. - Conversion: convert
sample-report.dotxto PDF or DOCX and check the headings, the table of contents and the page numbers.
Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.
Put it online
Have a DOTX file? Give it a link.
Drop a Word template on 99helpers and it gets its own link, ready to share with your team. Browsers can't display DOTX files, so visitors download it and open it in Word or LibreOffice, which start a new document from it.
Questions
DOTX files, frequently asked
What is a DOTX file?
A Microsoft Word template in the Office Open XML format, used since Word 2007. Opening it creates a new, untitled document with the template's text, styles and layout.
What's the difference between DOTX and DOCX?
Inside, only the content type of the main part: …template.main+xml instead of …document.main+xml. In use, a DOCX opens itself, while a DOTX starts a new document and stays unchanged.
How do I edit a DOTX template?
Open Word first and use File, Open to open the .dotx itself; double-clicking it only creates a new document. Make your changes and save.
Where are Word templates stored?
On Windows, personal templates go to Documents\Custom Office Templates by default, and Normal.dotm is in AppData\Roaming\Microsoft\Templates. You can change the personal folder under File, Options, Save.
How do I convert a DOTX to a DOCX?
Open the template to create a new document, then save it as Word Document (.docx). With LibreOffice: soffice --headless --convert-to docx file.dotx.
Can I just rename .docx to .dotx?
Not reliably. The content type inside still says document, so apps that read it treat the file as a document. Use Save As and choose Word Template instead.
What's the difference between DOTX and DOTM?
A DOTM may contain VBA macros; a DOTX can't. Use DOTX unless the template needs code.
Can Google Docs open a DOTX file?
Yes. Google Docs converts it into an ordinary Google Doc. To reuse it as a template there, keep it as a file to copy, or submit it to your organisation's template gallery if your work account allows that.
Related formats
Other file types explained
Keep going
Related
Sources
- IANA: application/vnd.openxmlformats-officedocument.wordprocessingml.template
- ECMA-376: Office Open XML file formats
- Microsoft Support: Create a template
- Microsoft Support: Change the Normal template (Normal.dotm)
- Microsoft Support: Slow performance creating a document from a template on a network share
- MITRE ATT&CK: Template Injection (T1221)
Last reviewed 27 October 2026.