The package document, usually named content.opf or
package.opf, is the centre of an EPUB: container.xml points
to it, and it lists the book’s metadata, every file in it and the reading order. It is
XML in the namespace http://www.idpf.org/2007/opf, with media type
application/oebps-package+xml. Relative URLs in it are resolved from the
package document’s own folder. This page follows EPUB 3.3; the
last section lists what differs in EPUB 2 (OPF 2.0.1).
package
The root element. Its children, in this order: metadata (one),
manifest (one), spine (one), guide (optional,
legacy), bindings (optional, deprecated), collection (any
number).
| Attribute | Status | Meaning |
|---|---|---|
version | Required | 3.0 for every EPUB 3 version (3.0, 3.0.1, 3.2, 3.3); 2.0 for EPUB 2. This is the only reliable way to tell the versions apart. |
unique-identifier | Required | The id of the dc:identifier that identifies the book, also used as the key for font obfuscation. |
prefix | Optional | Declares prefixes for property vocabularies, as pairs: prefix="foaf: http://xmlns.com/foaf/spec/". See prefixes. |
xml:lang | Optional | The language of the package’s text. |
dir | Optional | Text direction of the package’s text: ltr, rtl or auto. |
id | Optional | An ID. |
metadata
Holds Dublin Core elements (namespace http://purl.org/dc/elements/1.1/,
prefix dc), meta elements and link elements.
Three Dublin Core elements and one meta are required.
| Element | Number | Attributes | Meaning |
|---|---|---|---|
dc:identifier | 1 or more | id | An identifier: a UUID (urn:uuid:…), ISBN (urn:isbn:…), DOI and so on. The one named by unique-identifier must have an id. |
dc:title | 1 or more | dir, id, xml:lang | A title. The first is the main title; others can be typed with title-type. |
dc:language | 1 or more | id | A language of the content, as a BCP 47 tag such as en-GB. |
meta property="dcterms:modified" | Exactly 1 | When the book was last changed, as CCYY-MM-DDThh:mm:ssZ in UTC. With the unique identifier it identifies this exact release. | |
dc:contributor | Any | dir, id, xml:lang | Someone who contributed in a secondary role. |
dc:coverage | Any | same | The place or time the content covers. |
dc:creator | Any | same | An author or other main creator, in display order. |
dc:date | At most 1 | id | The publication date, in W3C date format (2026, 2026-11, 2026-11-12…). |
dc:description | Any | dir, id, xml:lang | A description. |
dc:format | Any | id | The format; rarely used. |
dc:publisher | Any | dir, id, xml:lang | The publisher. |
dc:relation | Any | same | A related resource. |
dc:rights | Any | same | A rights statement. |
dc:source | Any | id | The work this one is derived from, such as the printed edition’s ISBN. |
dc:subject | Any | dir, id, xml:lang | A subject, optionally coded with authority and term. |
dc:type | Any | id | The nature of the content, such as dictionary or index. |
meta
A meta element states one property. Its text is the value.
| Attribute | Meaning |
|---|---|
property | Required. The property, from the vocabulary below or from a prefixed vocabulary (dcterms:modified, schema:accessMode…). |
refines | Optional. #id of the element or resource this statement is about. Without it, the statement is about the whole publication. |
scheme | Optional. The system the value is taken from, such as marc:relators. |
id, dir, xml:lang | Optional. ID, text direction and language. |
Meta properties
Properties without a prefix come from the package’s default meta vocabulary
(http://idpf.org/epub/vocab/package/meta/#):
| Property | Refines | Value |
|---|---|---|
alternate-script | any | The value of the refined element in another script or language, such as an author’s name in Japanese; carries its own xml:lang. |
authority | dc:subject | The subject scheme, such as BISAC or a URL; at most one. |
belongs-to-collection | publication or another collection | The name of a series or set the book belongs to. |
collection-type | belongs-to-collection | series (published in order, possibly open-ended) or set (a finite group). |
display-seq | any | The order in which repeated elements should be displayed: a whole number. |
file-as | any | A sort form, such as Wells, H. G.. |
group-position | belongs-to-collection and others | The position in the collection: a number or dotted numbers such as 2.2.1. |
identifier-type | dc:identifier, dc:source | The identifier’s type, usually as an ONIX code with scheme="onix:codelist5" (for example 15 for ISBN-13). |
meta-auth | – | Deprecated. Who supplied the metadata. |
role | dc:creator, dc:contributor, dc:publisher | The role, usually a MARC relator code with scheme="marc:relators": aut author, edt editor, ill illustrator, trl translator, nrt narrator and so on. |
source-of | dc:source | pagination: the page numbers in the book come from this source. |
term | dc:subject | The subject’s code in the scheme given by authority. |
title-type | dc:title | main, subtitle, short, collection, edition or expanded. |
Other properties found in packages come from the reserved prefixes: Media Overlays
(media:duration, media:narrator,
media:active-class, media:playback-active-class), fixed layout
(rendition:layout, rendition:orientation,
rendition:spread, rendition:flow,
rendition:viewport (deprecated)) — see
content and layout — and accessibility
metadata from schema.org (schema:accessMode,
schema:accessModeSufficient, schema:accessibilityFeature,
schema:accessibilityHazard, schema:accessibilitySummary) and
the a11y: vocabulary (a11y:certifiedBy,
a11y:certifierCredential, a11y:certifierReport,
a11y:exemption).
link
Points to a resource about the publication, such as a metadata record.
| Attribute | Meaning |
|---|---|
href | Required. The resource, in the container or remote. |
rel | Required. Space-separated relationships: see below. |
media-type | Required when the resource is in the container. |
properties | Optional. onix: the record is an ONIX record. |
refines | Optional. What the link is about, as #id. |
hreflang, id | Optional. The resource’s language; an ID. |
rel value | Meaning |
|---|---|
alternate | An alternate form of the publication or of a resource, such as a PDF; used with other rels. |
record | A metadata record for the publication (ONIX, MARC and so on, told apart by media-type and properties). |
voicing | An audio recording of how to pronounce the refined element, such as an author’s name. |
marc21xml-record, mods-record, onix-record, xml-signature, xmp-record | Deprecated forms of record and of a signature link. |
manifest
Lists every file of the publication except mimetype, the
META-INF files and the package document itself, with one
item each. Remote resources (audio, video, fonts) that are part of the
rendering are listed too.
| Attribute | Status | Meaning |
|---|---|---|
id | Required | The item’s ID, used by the spine and by fallback. |
href | Required | The file, relative to the package document. |
media-type | Required | Its MIME type. Types outside the core media types need a fallback. |
fallback | When needed | The id of an item to use instead when the reading system does not support this one; chains may be several items long and must end in a core type. |
properties | Optional | Space-separated properties: see below. |
media-overlay | Optional | The id of the SMIL media overlay that goes with this content document. |
Item properties
| Property | Meaning |
|---|---|
cover-image | The cover image. At most one item. |
mathml | The document contains MathML. |
nav | The navigation document. Exactly one item. |
remote-resources | The document refers to resources outside the container. |
scripted | The document contains scripts or forms. |
svg | The document contains SVG (inline or in a foreignObject). |
switch | The document uses epub:switch (deprecated). |
spine
The reading order: one itemref per content document, in order. At least
one must be linear.
| Element | Attribute | Meaning |
|---|---|---|
spine | page-progression-direction | ltr, rtl or default (the default): the direction pages turn, for example rtl for Japanese manga. |
spine | toc | Legacy: the id of the NCX item. Required in EPUB 2. |
spine | id | An ID. |
itemref | idref | Required: a manifest item’s id. Each item at most once. |
itemref | linear | yes (default) or no: auxiliary content, such as notes or answers, that is reached by links rather than by turning pages. |
itemref | properties | Space-separated: see below. |
itemref | id | An ID. |
Itemref properties
| Property | Meaning |
|---|---|
page-spread-left, page-spread-right | In a two-page spread, put this page on the left or right. |
rendition:page-spread-center | Show this page alone, centred, across the spread. |
rendition:layout-pre-paginated, rendition:layout-reflowable | Override the global layout for this document. |
rendition:orientation-auto, -landscape, -portrait | Override the orientation. |
rendition:spread-auto, -both, -landscape, -none, -portrait (deprecated) | Override when spreads are shown. |
rendition:flow-auto, -paginated, -scrolled-continuous, -scrolled-doc | Override the overflow behaviour. |
rendition:align-x-center | Centre the content horizontally. |
collection
Groups resources for a purpose: role (required) names the purpose, as a
token or an absolute URL; id, dir and xml:lang
are optional. A collection holds an optional metadata, then nested
collection elements and link elements to its members. Roles
have been defined by separate specifications, such as index and
dictionary; the EPUB 3.3 specification deprecates making new ones.
guide and bindings
guide (legacy, from EPUB 2) lists landmarks as
reference elements with type, title and
href; EPUB 3 replaces it with the
landmarks nav, and its type
values are listed there.
bindings (deprecated) maps a media type to a scripted handler:
mediaType elements with media-type and
handler attributes.
Reserved prefixes
These prefixes may be used without declaring them in prefix:
| Prefix | URL |
|---|---|
a11y | http://www.idpf.org/epub/vocab/package/a11y/# |
dcterms | http://purl.org/dc/terms/ |
marc | http://id.loc.gov/vocabulary/ |
media | http://www.idpf.org/epub/vocab/overlays/# |
onix | http://www.editeur.org/ONIX/book/codelists/current.html# |
rendition | http://www.idpf.org/vocab/rendition/# |
schema | http://schema.org/ |
xsd | http://www.w3.org/2001/XMLSchema# |
In content documents, msv and prism are also reserved
for epub:type values.
Example
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0"
unique-identifier="uid" xml:lang="en">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:identifier id="uid">urn:uuid:4f3c2b1a-1111-4c2d-8e9f-0a1b2c3d4e5f</dc:identifier>
<dc:title>The Time Machine</dc:title>
<dc:creator id="au">H. G. Wells</dc:creator>
<meta refines="#au" property="role" scheme="marc:relators">aut</meta>
<meta refines="#au" property="file-as">Wells, H. G.</meta>
<dc:language>en-GB</dc:language>
<meta property="dcterms:modified">2026-11-12T09:00:00Z</meta>
</metadata>
<manifest>
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
<item id="cover" href="images/cover.jpg" media-type="image/jpeg" properties="cover-image"/>
<item id="css" href="style.css" media-type="text/css"/>
<item id="c1" href="chapter1.xhtml" media-type="application/xhtml+xml"/>
<item id="notes" href="notes.xhtml" media-type="application/xhtml+xml"/>
</manifest>
<spine>
<itemref idref="c1"/>
<itemref idref="notes" linear="no"/>
</spine>
</package>
Differences in EPUB 2 (OPF 2.0.1)
version="2.0".- Metadata is refined with attributes in the OPF namespace instead of
meta refines:opf:roleandopf:file-asondc:creatoranddc:contributor,opf:schemeondc:identifier(such asISBNorUUID),opf:eventondc:date(creation,publication,modification).dc:datemay repeat. metahas the form<meta name="…" content="…"/>; the cover image is named by<meta name="cover" content="item id"/>, a convention many EPUB 3 books keep for older readers.dcterms:modified,link, item and itemrefproperties,media-overlay,collectionand the rendition properties do not exist.- The table of contents is an NCX
file, named by
spine toc, which is required. - The
guideis the way to mark landmarks. - Content documents are XHTML 1.1 or DTBook, styled with a subset of CSS 2; an
out-of-line XML island (
ops:switch) andtoursexist but were rarely used.