Skip to content
TernTern home

What is an EPUB file?

What is actually inside the format, how EPUB 2 and EPUB 3 differ, and what opens one.

3 min read · updated

An EPUB is a website in a zip file

That is not a metaphor. Rename an .epub to .zip, unzip it, and you will find HTML documents, CSS stylesheets, image files and often embedded fonts. A reading app is essentially a small browser that knows the order to display them in.

It is an open standard, maintained today by the World Wide Web Consortium, and it is the format used by nearly every ebook seller other than Amazon.

What is inside

PartWhat it does
mimetypeA one-line file identifying the archive as an EPUB. Always first, always uncompressed.
META-INF/container.xmlPoints at the package file. The entry point for any reader.
The package file (.opf)The book’s manifest: metadata, a list of every file, and the reading order.
Content documentsThe chapters themselves, as XHTML.
NavigationA nav.xhtml document in EPUB 3, or an .ncx file in EPUB 2. This is the table of contents.
ResourcesStylesheets, images, fonts and occasionally audio or video.

The reading order lives in the package file’s spine, and it is separate from the table of contents — which is why a book can have chapters that do not appear in its contents, and contents entries that point into the middle of a chapter.

EPUB 2 and EPUB 3

  • EPUB 2 dates from 2007. Navigation lives in an NCX file, content is XHTML 1.1, and styling is fairly limited. A great many older books, including most of Project Gutenberg’s catalogue, are still EPUB 2.
  • EPUB 3 moved to HTML5 and CSS3, replaced the NCX with an HTML navigation document, and added MathML, media overlays, embedded audio and video, and proper support for right-to-left and vertical writing.

Both are still everywhere, and a converter that only handles one of them will fail on a large share of real books. Note that EPUB 3 files often still ship an NCX file for backwards compatibility.

Reflowable and fixed-layout EPUBs

Most EPUBs are reflowable: the text rearranges to fit whatever screen it lands on. A minority are fixed-layout, where the publisher has pinned every element to an exact position on a page of exact dimensions. Comics, children’s picture books, cookbooks and textbooks are usually fixed-layout.

The distinction matters when converting: a fixed-layout EPUB converts best when the output page size matches its own proportions, whereas a reflowable EPUB will happily adapt to whatever page you give it.

What opens an EPUB

  • macOS, iPhone, iPad: Apple Books, built in.
  • Windows: nothing built in. You need a reader app from the Microsoft Store or elsewhere.
  • Android: no system handler; Google Play Books can display EPUBs you upload to it.
  • Any desktop: Calibre, which is also a library manager and converter.
  • Kindle devices: not directly — Amazon uses its own formats.

If the file will not open at all, it may be damaged or DRM-protected rather than unsupported — the troubleshooting guide helps tell the difference.

Related tools

Guides worth reading