This article describes the technical specifications of the OpenDocument office document standard, as developed by the OASIS industry consortium. A variety of organizations developed the standard publicly and make it publicly accessible, meaning it can be implemented by anyone without restriction. The OpenDocument format aims to provide an open alternative to proprietary document formats.

Document representation The OpenDocument format supports the following two ways of document representation:

As a collection of several sub-documents within a package, each of which stores part of the complete document. This is the common representation of OpenDocument documents. It uses filename extensions such as .odt, .ott, .ods, .odp ... etc. The package is a standard ZIP file with different filename extensions and with a defined structure of sub-documents. Each sub-document within a package has a different document root and stores a particular aspect of the XML document. All types of documents (e.g. text and spreadsheet documents) use the same set of document and sub-document definitions. As a single XML document – also known as Flat XML or Uncompressed XML Files. Single OpenDocument XML files are not widely used, they are also unsupported on some office software which claims to support ODF (Microsoft Office applications version 2007 to 2013 do not recognize them). Filename extensions for a single OpenDocument XML documents are not defined in the OpenDocument technical specification, but commonly used are .xml, .fodt, .fods, ... etc.

The recommended filename extensions and MIME types are included in the official standard (OASIS, May 1, 2005, and its later revisions or versions). The MIME types and extensions contained in the ODF specification are applicable only to office documents that are contained in a package. Office documents that conform to the OpenDocument specification but are not contained in a package should use the MIME type text/xml.

The MIME type is also used in the office:mimetype attribute. It is very important to use this attribute in flat XML files/single XML documents, where this is the only way the type of the document can be detected (in a package, the MIME type is also present in a separate file mimetype). Its values are the MIME types that are used for the packaged variant of office documents.

Documents The most common file extensions used for OpenDocument documents are .odt for text documents, .ods for spreadsheets, .odp for presentation programs, and .odg for graphics. These are easily remembered by considering ".od" as being short for "OpenDocument", and then noting that the last letter indicates its more specific type (such as t for text). Here is the complete list of document types, showing the type of file, the recommended file extension, and the MIME Type:

File type Extension MIME Type ODF specificationText.odt application/vnd.oasis.opendocument.text1.0Spreadsheet.odsapplication/vnd.oasis.opendocument.spreadsheet1.0Presentation.odpapplication/vnd.oasis.opendocument.presentation1.0Drawing.odgapplication/vnd.oasis.opendocument.graphics1.0Chart.odcapplication/vnd.oasis.opendocument.chart1.0Formula.odfapplication/vnd.oasis.opendocument.formula1.0Image .odiapplication/vnd.oasis.opendocument.image1.0Master Document.odmapplication/vnd.oasis.opendocument.text-master1.0Database.odbapplication/vnd.sun.xml.basenot defined in ODF 1.0/1.1 specifications;used in OpenOffice.org 2.xapplication/vnd.oasis.opendocument.baseODF 1.2;used in OpenOffice.org 3.xapplication/vnd.oasis.opendocument.databasedefined in IANA registrationall OpenDocument single/flat XML filesnot definedtext/xml1.0

Templates OpenDocument also supports a set of template types. Templates represent formatting information (including styles) for documents, without the content themselves. The recommended filename extension begins with ".ot" (interpretable as short for "OpenDocument template"), with the last letter indicating what kind of template (such as "t" for text). The supported set includes:

File type Extension MIME Type ODF specificationText.ottapplication/vnd.oasis.opendocument.text-template1.0Spreadsheet.otsapplication/vnd.oasis.opendocument.spreadsheet-template1.0Presentation.otpapplication/vnd.oasis.opendocument.presentation-template1.0Drawing.otgapplication/vnd.oasis.opendocument.graphics-template1.0Chart template.otcapplication/vnd.oasis.opendocument.chart-template1.0Formula template.otfapplication/vnd.oasis.opendocument.formula-template1.0Image template.otiapplication/vnd.oasis.opendocument.image-template1.0Web page template.othapplication/vnd.oasis.opendocument.text-web1.0

Capabilities As noted above, the OpenDocument format can describe text documents (for example, those typically edited by a word processor), spreadsheets, presentations, drawings/graphics, images, charts, mathematical formulas, and "master documents" (which can combine them). It can also represent templates for many of them.

The official OpenDocument standard version 1.0 (OASIS, May 1, 2005) defines OpenDocument's capabilities. The text below provides a brief summary of the format's capabilities.

Metadata The OpenDocument format supports storing metadata (data about the data) by having a set of pre-defined metadata elements, as well as allowing user-defined and custom metadata. The format predefines the following metadata fields:

Generator Title Description Subject Keywords Initial Creator Creator Printed By Creation Date and Time Modification Date and Time Print Date and Time Document Template Automatic Reload Hyperlink Behavior Language Editing Cycles Editing Duration Document Statistics

Content OpenDocument's text content format supports both typical and advanced capabilities. Headings of various levels, lists of various kinds (numbered and not), numbered paragraphs, and change tracking are all supported. Page sequences and section attributes can be used to control how the text is displayed. Hyperlinks, ruby text (which provides annotations and is especially critical for some languages), bookmarks, and references are supported as well. Text fields (for autogenerated content), and mechanisms for automatically generating tables such as tables of contents, indexes, and bibliographies, are included as well.

The OpenDocument format implements spreadsheets as sets of tables. Thus it features extensive capabilities for formatting the display of tables and spreadsheets. OpenDocument also supports database ranges, filters, and "data pilots" (known in Microsoft Excel contexts as "pivot tables"). Change tracking is available for spreadsheets as well.

The graphics format supports a vector graphic representation, in which a set of layers and the contents of each layer is defined. Available drawing shapes include Rectangle, Line, Polyline, Polygon, Regular Polygon, Path, Circle, Ellipse, and Connector. 3D Shapes are also available; the format includes information about the Scene, Light, Cube, Sphere, Extrude, and Rotate (it is intended for use as for office data exchange, and not sufficient to represent videos or other extensive 3D scenes). Custom shapes can also be defined.

Presentations are supported. Users can include animations in presentations, with control over the sound, showing a shape or text, hiding a shape or text, or dimming something, and these can be grouped. In OpenDocument, much of the format capabilities are reused from the text format, simplifying implementations. However, tables are not supported within OpenDocument as drawing objects, so may only be included in presentations as embedded tables.

Charts define how to create graphical displays from numerical data. They support titles, subtitles, a footer, and a legend to explain the chart. The format defines the series of data that is to be used for the graphical display, and a number of different kinds of graphical displays (such as line charts, pie charts, and so on).

Forms are specially supported, building on the existing XForms standard.

Objects A document in OpenDocument format can contain two types of objects, as follows:

Objects that have an OpenDocument representation. These objects are: Formulas (represented as MathML) Charts Spreadsheets Text documents Drawings Presentations Objects that do not have an XML representation and only have a binary representation. Examples for these kinds of objects are raster images, recorded audios and videos, and OLE objects.According to the OpenDocument 1.0 specification, OLE is defined in Kraig Brockschmidt, Inside OLE, Microsoft Press, 1995, .

Use of Microsoft Object Linking and Embedding (OLE) objects limits the interoperability, because these objects are not widely supported in programs for viewing or editing files (e.g. embedding of other files inside the file, such as tables or charts from a spreadsheet application in a text document or presentation file). If a software that understands an OLE object is not available, the object is usually replaced by a picture (bitmap representation of the object) or not displayed at all.

Formatting The style and formatting controls are numerous, providing a number of controls over the display of information.

Page layout is controlled by a variety of attributes. These include page size, number format, paper tray, print orientation, margins, border (and its line width), padding, shadow, background, columns, print page order, first page number, scale, table centering, maximum footnote height and separator, and many layout grid properties.

Headers and footer can have defined fixed and minimum heights, margins, border line width, padding, background, shadow, and dynamic spacing.

There are many attributes for specific text, paragraphs, ruby text, sections, tables, columns, lists, and fills. Specific characters can have their fonts, sizes, generic font family names (roman serif, swiss sans-serif, modern monospace, decorative, script or system), and other properties set. Paragraphs can have their vertical space controlled through attributes on keep together, widow, and orphan, and have other attributes such as "drop caps" to provide special formatting. The list is extremely extensive; see the references (in particular the actual standard) for details.

Spreadsheet formulas OpenDocument version 1.2 fully describes mathematical formulas displayable on-screen. It is fully capable of exchanging spreadsheet data, formats, pivot tables, and other information typically included in a spreadsheet. OpenDocument exchanges formulas as values of the attribute table:formula.

The allowed syntax of table:formula was not defined in sufficient detail in the OpenDocument version 1.0 specification, which defined spreadsheet formulas using a set of simple examples showing, for example, how to specify ranges and the SUM() function. The OASIS OpenDocument Formula sub group therefore standardized the table:formula in the OpenFormula specification. For more information see the OpenFormula article.

Encryption When an OpenDocument file is password protected the file structure of the bundle remains the same, but contents of XML files in the package are encrypted using the following algorithm:

The file contents are compressed with the DEFLATE algorithm. A checksum of a portion of the compressed file is computed (SHA-1 of the file contents, or SHA-1 of the first 1024 bytes of the file, or SHA-256 of the first 1024 bytes of the file) and stored, so password correctness can be verified when decrypting. A digest (hash) of the user-entered password in UTF-8 encoding is created and passed to the package component. ODF versions 1.0 and 1.1 only mandate support for the SHA-1 digest here, while version 1.2 recommends SHA-256.