Introduction
ODT is the word processing document of the OpenDocument Format (ODF), an open standard (OASIS, ISO/IEC 26300). It holds text, styles, tables, pictures, notes, fields and tracked changes as XML, in a ZIP package, and is the default format of LibreOffice Writer.
The same package serves ODS for spreadsheets,
ODP for presentations, .odg for
drawings, .odc for charts, .odf for formulas and
.odi for images; only the media type in mimetype and the body
of content.xml differ. .ott, .ots,
.otp and .otg are the templates, .odm a master
document, and .fodt, .fods, .fodp and
.fodg the flat form: one XML file with an
office:document root, pictures inline as base64.
Structure
An ODT file is a ZIP archive. Its first entry must be
an uncompressed file named mimetype containing
application/vnd.oasis.opendocument.text, so the type can be read at a
fixed position near the start of the file. content.xml holds the text as
paragraphs (text:p), headings (text:h), lists and tables;
styles.xml holds the styles and page layouts; meta.xml holds
the title, author and statistics; and META-INF/manifest.xml lists every
file in the package. The package
page covers the ZIP rules, manifest, encryption and signatures; the
document structure page the
XML files, namespaces and metadata; the
text content page headings,
paragraphs, lists, sections, notes and tracked changes; and the
fields and indexes page every text
field and generated index. Tables,
frames, images and objects and
styles (families, master pages,
number and date styles, list styles) have their own pages, and the formatting
properties are listed attribute by attribute for
text,
paragraphs,
pages and sections,
tables and
graphics; the
comments, events and DDE page
covers comments, event listeners, formulas and DDE links, and the
forms page every form control.
Embedded charts have the charts
page (every chart element, class and attribute) and the
chart formatting page
(every chart style property).
zipmimetypeapplication/vnd.oasis.opendocument.text, stored first and uncompressed39 byteszipcontent.xml the body text, tables and framesXMLzipstyles.xml styles, page layouts, headers and footersXMLzipmeta.xml, settings.xml metadata and view settingsXMLzipPictures/ embedded imagesimageszipMETA-INF/manifest.xml every file and its typeXML
In the explorer
Drop an ODF file and its mimetype entry (or, in a flat file, its
office:document root) says what it is. The window has tabs for the
Document (a text document’s pages drawn from its styles, and its text as Markdown with lists, tables, notes, comments, tracked changes and
pictures; a spreadsheet’s sheets, a page at a time, with the charts they hold drawn; slides and drawing pages drawn as pictures, with their
notes, a list of shapes, animations and transitions; charts and formulas; a database front end’s
connection, queries and embedded tables), the Overview
(metadata, statistics, fields, links, bookmarks, form controls, formulas, named ranges, validation,
custom properties), the Package (the rules of the ZIP package checked one by one, every
part, the manifest, encryption, signatures, embedded objects, the thumbnail), the
Styles, the Names (every element and attribute counted and checked
against the OpenDocument 1.3 and 1.2 schemas) and the Settings. Every part also opens as a file of
its own; XML parts open in the XML viewer, which lists every problem.
Encrypted files are listed as encrypted; type the password in the options bar to read them. It is used for that file only and kept nowhere. Files from LibreOffice and OpenOffice.org are read as they write them, including the faulty SHA-1 start key older versions made for passwords of 52 to 55 bytes, which LibreOffice itself falls back to (tdf#114939). XML signatures are checked in full: each reference is digested (after XML canonicalisation where the signature asks for it), the signature value is verified with the key of one of the embedded certificates, and each certificate’s validity, chain links and XAdES signing-certificate digest are reported; whether a certificate is trusted is left to the reader, as a browser page has no list of roots to ask: what is checked is that each link of the chain carries a valid signature of the next certificate and that the validity dates cover the signing time and today, never that any root is one you trust. These signature methods are checked (a method not on this list is reported as not checked, with its name): RSA PKCS#1 v1.5 with SHA-1, SHA-256, SHA-384, SHA-512 and MD5, RSA-PSS (with the digest, mask function digest, salt length and trailer field the signature or certificate gives), DSA with SHA-1 or SHA-256 and ECDSA over P-256, P-384 and P-521; MD5 and DSA are worked out in this page’s own code (RFC 1321, FIPS 186) because the browser’s cryptography lacks them, and every one is tested against signatures made by OpenSSL. Macros and scripts are listed and never run, and formulas are shown, parsed, and never evaluated.
Data types and XSL values
Every attribute value and element content has a data type (OpenDocument 1.3 part 3, chapter 18). Besides the W3C XML Schema types
string, date, time, dateTime, decimal, duration,
int, integer, nonNegativeInteger, positiveInteger, double,
long, short, base64Binary, ID, IDREF, IDREFS and
NCName (18.2), these are defined (18.3):
| Type | Value |
|---|---|
angle | A double, optionally followed at once by deg, grad or rad (SVG 4.1); no unit means degrees. ODF 1.1 had no unit; omit it for compatibility. |
anyIRI | An IRI-reference (RFC 3987) in an anyURI; how a value that is not an IRI is resolved is undefined. |
boolean | true or false. |
cellAddress, cellRangeAddress, cellRangeAddressList | Spreadsheet addresses as in 9.2.1, 9.2.3 and 9.2.5 (see the ODS page). |
character | A string of one character. |
clipShape | A clip shape as in XSL 1.0 7.20.1; offsets must not use em or px. |
color | An RGB colour #rrggbb (XSL 5.9.11). |
coordinate, distance | A length: a position along an axis from the origin, and the length between two points. |
countryCode, languageCode, scriptCode, language | ISO 3166 region subtag, ISO 639 primary language subtag, ISO 15924 script subtag (RFC 5646 2.2.4, 2.2.1, 2.2.3), and a language tag with the syntax of xml:lang (the language type of XML Schema, not limited to RFC 3066). |
CURIE, CURIEs, safeCURIE, URIorSafeCURIE | RDFa 7: a compact IRI; a white-space separated list of them; one in square brackets; an IRI or a safe CURIE. |
dateOrDateTime, timeOrDateTime | An XML Schema date or dateTime; a time or dateTime. |
length, nonNegativeLength, positiveLength | A magnitude with a unit (XSL 5.9.13), which may be negative; zero or positive; positive. |
nonNegativePixelLength | A non-negative length with the unit px. |
namespacedToken | A QName matching PrefixedName of Namespaces in XML 4. |
pathData | SVG path data, matching the grammar of SVG 8.3.9. |
percent, signedZeroToHundredPercent, zeroToHundredPercent | A percentage (XSL 5.9.11), positive or negative; limited to -100% to 100%; limited to 0% to 100%. |
point3D, vector3D | Three white-space separated numbers in parentheses, (x y z); in a point3D each is followed by a unit. A vector that is a normal should be normalised. |
points | Points of two integer coordinates separated by a comma, the points separated by white space. |
relativeLength | A positive integer followed by *. |
styleName, styleNameRef, styleNameRefs | An NCName naming a style; one naming a style referred to (may be empty); a white-space separated list of them. |
targetFrameName | A target frame name as in HTML 4 6.16. |
textEncoding | An XML 1.0 4.3.3 encoding name, or x-symbol for an encoding that list does not name. |
valueType | A list of value types (the values themselves are listed where the attribute is described). |
variableName | A string naming a variable. |
Source: OpenDocument 1.3 part 3, chapter 18 (research/odt/part3-v13.html, read 27 November 2026).
Borders, shadows and padding
The fo:border, fo:border-top, -bottom, -left and -right attributes (20.183), style:shadow
(20.359) and fo:text-shadow (20.226) are strings defined by XSL 1.0 (read from research/odt/xsl/slice7.html, the W3C Recommendation of
15 October 2001):
- Border (7.29.3 for all four sides, 7.29.10 and the other sides for one):
[ <border-width> || <border-style> || <color> ], in any order. The width isthin,medium,thickor a non-negative length; the style isnone(which forces the width to 0),hidden,dotted,dashed,solid,double,groove,ridge,insetoroutset. LibreOffice writes0.51pt solid #000000,noneand2pt solid #3465a4(seen in its own test files); for adoubleborder it also writesstyle:border-line-width(20.248), three lengths: the inner line, the gap, the outer line (fo:border="0.318cm double #000000"withstyle:border-line-width="0.141cm 0.088cm 0.088cm", for example). - Shadow (XSL 7.16.5, the grammar of CSS 2
text-shadow):none, or a comma-separated list of effects, each a colour and two lengths (right of the text, below it; negative goes left and up) and optionally a third length for the blur, the colour before or after the lengths. Without a colour, the element’s colour is used. Forstyle:shadowthe shadow falls behind a paragraph, text box, page body, header, footer, table or cell, not on the text. - ODF excludes the value
inheritforstyle:shadowandfo:text-shadow.
Divergence from spec
Programs this page compares with the specification: LibreOffice Writer (the default editor of ODT, and the source of nearly every real file seen
here), Apache OpenOffice Writer (the other free office suite) and Microsoft Word (Windows, macOS). Sources: LibreOffice’s source files
ManifestImport.cxx, ZipFile.cxx, ZipPackageStream.cxx, ciphercontext.cxx; Apache OpenOffice’s
xmloff/source/core/xmlexp.cxx (trunk); Microsoft’s support article “Differences between the OpenDocument Text (.odt) format and the Word (.docx) format”;
and LibreOffice’s own test files, all read on 27 November 2026. The owner may name other programs.
| Where | Specification says | What the program does |
|---|---|---|
| Encryption of parts (Package) | ODF 1.3: PBKDF2 key derivation, AES-CBC or Blowfish CFB. | LibreOffice 7.5 and later can write and read Argon2id with AES-GCM (extension names loext:argon2-*, or manifest:argon2-*). |
Soft page breaks (text:soft-page-break, 5.6; text:use-soft-page-breaks, 19.903) | Optional; a consumer may use them but must not depend on them; a producer that does not paginate must set the attribute to false or drop it when it edits the file. | LibreOffice writes them and sets the attribute to true (files in the corpus). The explorer ends pages at the marks only when the attribute is true. |
Version written (office:version) | The version of the specification the file follows. | Apache OpenOffice’s exporter writes 1.1, 1.2, 1.3 or 1.4 by its save option (xmlexp.cxx). |
| Names outside the schema | Extensions use namespaces of their own; the schema does not list them. | LibreOffice writes loext:, calcext:, drawooo: and other names, which other programs may not read; the viewer marks them as LibreOffice extensions. |
| Features Word cannot save in ODT | Defined by the schema (tracked changes, frames, text boxes, tables). | Word: saving as .odt accepts all tracked changes; frames become text boxes; text boxes cannot be nested; tables of more than 64 columns are not supported; continuous section breaks may lose margins, headers and footers, borders and line numbering; only drop-down list content controls are kept; pictures from OpenOffice documents are not shown in Word; the number of styles grows because ODF formatting is style based. |
Not described
These pages follow the OpenDocument 1.3 specification.
Known, not yet covered
- Reference: the chapter 19 attributes of elements that text documents do not use.
- Reference: the extension names of LibreOffice (
loext,calcext,drawooo,officeooo,tableooo,chartooo,css3t,field): each of the 74 elements and 254 attributes the schema lists has a one-line meaning, shown in the Names tab. The text comes from the Document Foundation wiki’s list of LibreOffice ODF extensions and from LibreOffice’sxmloffandsc/source/filter/xmlsource; where neither says more than the name, the line is read from the name and the element it sits on, so it can be less exact than the LibreOffice source. A script (loext-source-check.mjs) checked every name against the LibreOffice source: all 328 have a token inxmltoken.cxxand are read or written by the import or export code (315 next to the extension’s own namespace constant, 12 in a file that names it;loext:text-changes-onlyappears only as a frame-style property entry, so its line says no more than that). The extensions are not in an OASIS specification, so no ODF text defines them. - Viewer: the Pages drawn section of a text document lays the pages out from the styles
(page size and orientation, margins, mirrored margins, page columns with their rule, headers and footers for the first, left and
right pages, page background colour and picture, paragraph and character formatting, borders, backgrounds, tab stops with leaders,
list styles and outline numbering, tables with spans, widths and borders, sections with columns, frames anchored as a character, to
a paragraph or to the page, footnotes at the foot of the page, charts in place, drawing shapes, page breaks and second master pages),
checked by eye against LibreOffice’s picture of the same files (
samples/odt/layout-a.odt,layout-b.odt, and LibreOffice’s ownborders_ooo33.odtandPageBackground.odt). Pages end where the file’stext:soft-page-breakmarks say (LibreOffice writes them intocontent.xml: the pages ofWavPack5FileFormat.odtandWavPack5LibraryDoc.odtcome to 6 and 33, the page counts of LibreOffice’s own PDF of them). What it does not reproduce: in a file without those marks, or whoseoffice:textlackstext:use-soft-page-breaks="true", the line and page breaks are the browser’s, so a page holds what an estimate of the text’s width says it does, not what LibreOffice puts on it (a page may end a line or two early or late, and a cut at a page end can fall inside a line); the fonts are the family the file names where the reader’s computer has it, else the generic family (serif, sans-serif, monospace) the file or the name suggests, and the fallbacks tried are listed under the pages; tab stops are placed from estimated text widths, so a right tab may be a few pixels off; flips other than mirroring are not drawn, unequal columns in a section are boxes of their own widths as the specification says (samples/odt/section-columns.odt; LibreOffice 26.8 itself draws and re-saves them equal, as 32767* and 32768*, so it is not an oracle here), a text box with columns (style:columnsin its frame style) is drawn in equal columns balanced as LibreOffice balances them (box-columns.odt); unequal widths inside a box (style:rel-width) are boxes of their own widths, and a chain’s next box takes the text the first box cannot hold, laid out at its own width and cut at a line (chain.odt; LibreOffice draws the columns equal and does not chain, so these two follow the specification only), and a picture’s crop (fo:clip) counts its lengths in the picture’s pixels at the density the picture stores (a PNG’spHYschunk in pixels per metre, a JPEG’s JFIF density in dots per inch or per centimetre; LibreOffice’s picture ofsamples/odt/crop-density.odt, a PNG storing 192 per inch, agrees), or at 96 per inch when none is stored (crop-picture.odt); other formats’ densities (Exif, TIFF, BMP, GIF) are not read. Unequal page columns (style:columnwithstyle:rel-width) are boxes of their own widths (layout-d.odt: 5 pages as in LibreOffice’s PDF); the text in them is measured at the average column width. Emphasis marks (style:text-emphasize) and rotated text (style:text-rotation-angle, anticlockwise) are drawn as LibreOffice draws them inlayout-e.odt. Frames anchored to a frame follow the specification text only: LibreOffice did not draw the inner frame of the test file, so there is nothing to compare them with. Paragraph spacing is the larger of the space below one paragraph and above the next, as in Writer; text shadows follow the XSL list. Line numbers are not drawn inside tables, as LibreOffice does not; text widths come from the Times-Roman and Helvetica advance widths (which Liberation Serif and Sans copy), and when a cut would leave fewer widow lines for the next page, fewer lines stay on this one, as in Writer. Compared with LibreOffice’s PDF oflayout-c.odtmade with every line numbered (make-layout-c.mjs 1), pages 1 to 4 end at line 45, 44, 45 and 46 in both. Keep-with-next, orphans and widows (fo:orphans,fo:widows), the repeated heading rows of a table cut across pages, line numbers (text:linenumbering-configuration: everytext:increment-th line, restarting on each page when asked, counted from the estimated lines of each paragraph, so a number can be a line off) and hyphenation (fo:hyphenate, hyphens by the browser’s dictionary for the language) are applied;samples/odt/layout-c.odtcomes to 7 pages here and in LibreOffice’s PDF. The Markdown Document section beside the pages keeps the text with its lists and tables. A chart in a text, sheet or slide document is drawn where its frame is (bar and column in clustered, stacked and percent forms, line, area, pie, ring, scatter, bubble, radar, filled radar and stock charts, from the embedded chart object, compared by eye with LibreOffice’s own pictures of the same files; three-dimensional charts are drawn flat, a ring chart and a stock chart with open, high, low and close could not be compared because LibreOffice drew nothing, or only range marks, for the test files, and the layout is the viewer’s own); EMF and WMF pictures are played into SVG by the shared metafile reader (checked on LibreOffice’s own EMF and WMF export of a drawing); an embedded OLE object that is a Word, PowerPoint or Outlook Compound File opens in that format’s viewer, and so does an Excel workbook (its cells and formula results are decoded by the XLS reader; checked on a real file,samples/odt/lo-ole-excel.odt, which LibreOffice wrote frommake-ole-calc.mjs’s document through a .doc round trip with “Excel to Calc” load off); any other OLE object (an OLE package, a Compound File of another program) opens as bytes and appears as a labelled box, and the Package tab lists what its Compound File holds: the streams, the kind (Excel workbook, Word, PowerPoint, packaged file), the\1CompObjuser type, clipboard format and class id, and for an OLE package the file name and size of the packaged file (\1Ole10Native, [MS-OLEDS] 2.3.6; the Windows Packager layout inside it is not in that specification, so it is read as Apache POI’sOle10Native.javaand oletools’oleobj.pyread it, and checked on two real packaged files from POI’s test data,poi-oleObject1.binandpoi-Notes.ole2, the second with the UTF-16 copies of the “Package2” form). A packaged file cannot be opened from the tree. Slides and drawing pages are drawn as pictures (see the ODP page for what that covers and what is outlined and listed instead). - Viewer: a
content.xmlof more than 24 MiB (once extracted) is read in pieces of whole children ofoffice:text(up to 6 MiB each, with the declarations and styles read once): the Overview, Tables, Styles and Names tabs add the pieces together (checked equal to reading the whole file on real documents and on a synthetic one with tracked changes, notes, comments and tables, and on a generated 35 MiB document), and the pages are drawn one piece at a time. Each piece starts on a new page numbered on from the piece before (the earlier pieces are laid out first for their page counts; the “of M” total counts the pieces not yet laid out at the pages per byte seen so far, so it is an estimate), so the page count is a little higher than LibreOffice’s, and the Document view is cut at 4 MiB of text. The text is also listed a page at a time, one row for each child ofoffice:text, and the file opens in the XML viewer, which reads it in windows. The whole file is held in memory to scan it, so the browser’s own limit on one array applies. (Every encrypted file of a package gets its key, however many.) - Viewer: the element and attribute check uses the schemas of OpenDocument 1.3 and 1.2
and LibreOffice’s own schema (the 1.4 draft and the
loext,calcext,drawooo,officeooo,tableooo,chartooo,css3tandfieldextension names, which it marks as LibreOffice extensions). Extension names of other programs are marked as extensions, and attributes some programs write on elements the schemas do not give them (for exampledraw:fillonloext:graphic-properties) are marked as not on that element. - Viewer: the reading view of a text document shows the first 200 rows of each table and says where the rest is: the Tables tab holds every row of every table, a page at a time. Every other list (tracked changes, comments, notes, fields, hyperlinks, bookmarks, headings, form controls, formulas) is complete and paged.
- Viewer: text hidden by character formatting and hidden sections are left out of the document view and counted in the Overview, as LibreOffice shows them on screen; its plain-text export writes the hidden text.
Unknown
- Reference: where the specification contradicts itself, which the pages note: for example
text:sort-by-positionandtext:dont-balance-text-columnsread the reverse of their names.
Links
Software
- LibreOffice Writer – free office suite’s word processor, which uses ODT by default (Windows, macOS, Linux)
- Microsoft Word – Microsoft’s word processor, which opens and saves ODT (Windows, macOS, web)
- Google Docs – online word processor that imports and exports ODT (web browsers)
- Apache OpenOffice Writer – the older free office suite’s word processor (Windows, macOS, Linux)
- Pandoc – command-line converter that reads and writes ODT (Windows, macOS, Linux)
Developers
- odfpy – library that reads and writes OpenDocument files (Python)
Reference
- OASIS Open Document Format for Office Applications (OpenDocument) TC – the committee that maintains ODF, with the current specification
- OpenDocument 1.3 part 2: Packages – the ZIP package, manifest, encryption and signatures (OASIS, 2021)
- OpenDocument 1.3 part 3: OpenDocument Schema – every element and attribute of the XML (OASIS, 2021)