Skip to content
Glossary

What is the EPUB container (OCF)?

Updated:

An EPUB file is a ZIP archive laid out by the Open Container Format (OCF): an uncompressed "mimetype" file first, a META-INF/container.xml that points to the package document, and the content files. Renaming a .epub to .zip lets you look inside.

Why it matters when you convert a PDF to EPUB

Most "broken EPUB" reports from validators start here: a mimetype file that is compressed, not first, or followed by a newline, or a container.xml that points to the wrong path. A converter has to write the archive in exactly this order, which is why zipping a folder by hand often produces an EPUB that some readers refuse.

EPUBCheck reports container problems with PKG messages (for example PKG-006 and PKG-007 for the mimetype file) and RSC-002 or RSC-003 when container.xml is missing or incomplete.

How EpubCC handles it: the engine writes the mimetype file first and stored without compression, then META-INF/container.xml pointing to OEBPS/content.opf, then the chapters, the navigation document, the stylesheet and the images, in a single pass, so the archive never depends on how a folder was zipped.

Related terms

EPUBCheck messages about this

  • PKG-006 Mimetype file entry is missing or is not the first file in the archive.
  • PKG-007 The content of the mimetype file must be the string "application/epub+zip"…
  • RSC-002 Required META-INF/container.xml resource could not be found.
  • RSC-003 No rootfile tag with media type "application/oebps-package+xml" was found in the container.
  • PKG-001 Validating the EPUB against version … but detected version ….
  • PKG-003 Unable to read EPUB file header. This is likely a corrupted EPUB file.
  • PKG-004 Corrupted EPUB ZIP header.
  • PKG-005 The mimetype file has an extra field of length …. The use of the extra field feature of the ZIP format is not permitted for the mimetype file.
  • PKG-008 Unable to read file "…".
  • PKG-009 The file name "…" contains characters that are not allowed in OCF file names: ….

Convert a PDF to EPUB
Convert up to 5 pages free, no account needed.

FAQ

What is the EPUB container (OCF)?

An EPUB file is a ZIP archive laid out by the Open Container Format (OCF): an uncompressed "mimetype" file first, a META-INF/container.xml that points to the package document, and the content files. Renaming a .epub to .zip lets you look inside.