← toolkit.bot

EPUB OPF Package Document: Structure, Metadata, and Spine Explained

June 12, 2026  ·  8 min read

Every EPUB file contains a package document — an XML file with a .opf extension (historically called content.opf or package.opf) that ties the whole ebook together. Reading systems parse it first to understand the book's structure. This guide explains each section and what EPUB 3 changed from EPUB 2.

What is the OPF document?

OPF stands for Open Packaging Format. It's an XML file inside the EPUB archive that answers three questions for the reading system:

  1. What is this book? (metadata — title, author, language, UUID)
  2. What files does it contain? (manifest — every resource listed)
  3. In what order should the content be read? (spine — reading order)

A minimal EPUB 3 OPF document:

<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         version="3.0"
         unique-identifier="bookid">

  <metadata>
    <dc:identifier id="bookid">urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890</dc:identifier>
    <dc:title>My Book Title</dc:title>
    <dc:language>en</dc:language>
    <dc:creator>Author Name</dc:creator>
    <meta property="dcterms:modified">2026-06-12T00:00:00Z</meta>
  </metadata>

  <manifest>
    <item id="nav"   href="nav.xhtml"      media-type="application/xhtml+xml" properties="nav"/>
    <item id="ch01"  href="chapter01.xhtml" media-type="application/xhtml+xml"/>
    <item id="ch02"  href="chapter02.xhtml" media-type="application/xhtml+xml"/>
    <item id="style" href="style.css"       media-type="text/css"/>
    <item id="cover" href="cover.jpg"       media-type="image/jpeg" properties="cover-image"/>
  </manifest>

  <spine>
    <itemref idref="nav"  linear="no"/>
    <itemref idref="ch01"/>
    <itemref idref="ch02"/>
  </spine>

</package>

Metadata section

The <metadata> element uses Dublin Core elements (prefixed dc:) for the core bibliographic fields:

ElementRequired?Notes
dc:identifierYesMust match unique-identifier on <package>; use UUID or ISBN
dc:titleYesBook title; repeat for subtitle with title-type refinement
dc:languageYesBCP 47 code (e.g., en, fr, zh-Hans)
dc:creatorRecommendedAuthor; use role refinement for editor, illustrator, etc.
dc:publisherOptionalPublisher name
dc:descriptionOptionalSynopsis / back-cover copy
dc:subjectOptionalRepeat for multiple subjects/categories
dc:dateOptionalOriginal publication date
meta property="dcterms:modified"Yes (EPUB 3)ISO 8601 UTC timestamp; must update on each revision

EPUB 3 also supports accessibility metadata via meta elements with schema.org properties:

<meta property="schema:accessMode">textual</meta>
<meta property="schema:accessMode">visual</meta>
<meta property="schema:accessibilityFeature">structuralNavigation</meta>
<meta property="schema:accessibilityHazard">none</meta>
<meta property="schema:accessibilitySummary">This publication meets WCAG 2.2 Level AA.</meta>

Manifest section

Every file in the EPUB must appear in the manifest — HTML chapters, CSS, images, fonts, the nav document, and the NCX (if included). Each <item> has:

Common media types:

File typemedia-type
XHTML contentapplication/xhtml+xml
CSStext/css
JPEG imageimage/jpeg
PNG imageimage/png
SVGimage/svg+xml
OTF fontfont/otf
WOFF2 fontfont/woff2
NCXapplication/x-dtbncx+xml
Nav documentapplication/xhtml+xml + properties="nav"

Spine section

The <spine> defines the default reading order. Each <itemref> references a manifest item by its id:

<spine>
  <itemref idref="nav"   linear="no"/>
  <itemref idref="cover" linear="no"/>
  <itemref idref="ch01"/>
  <itemref idref="ch02"/>
  <itemref idref="ch03"/>
</spine>

The linear="no" attribute marks items that are not part of the linear reading flow (cover page, table of contents). Readers may skip them in sequential navigation.

Key changes in EPUB 3

FAQ

Where is the OPF file located inside an EPUB?

The META-INF/container.xml file (required in every EPUB) points to the OPF file's location with a rootfile element. The OPF is typically at OEBPS/content.opf or OPS/package.opf, but the path is not fixed.

Can an EPUB have multiple OPF files?

In EPUB 3, no — only one rendition (one OPF) is supported. EPUB 3.0.1 added multiple renditions as an experimental feature, but it was never widely implemented and was removed in EPUB 3.2.

What happens if a file is in the EPUB zip but not in the manifest?

EPUBCheck will report an error. Reading systems may ignore the file entirely. Every resource referenced from content must be in the manifest.

Do I need a spine entry for every manifest item?

No. CSS, images, fonts, and the nav document do not need spine entries. Only the HTML documents that form the reading sequence belong in the spine.

Need a well-formed EPUB?
toolkit.bot generates EPUB3 output with correct OPF metadata, manifest, and spine — free, no account required.