Introduction
EPUB is the open standard for ebooks. It was developed by the International Digital Publishing Forum, which merged into the W3C in 2017; EPUB 3.3 became a W3C Recommendation in 2023. An EPUB is essentially a small website in a ZIP file: the chapters are XHTML pages styled with CSS, with images, fonts and a table of contents, so the text reflows to fit any screen.
Structure
The ZIP archive must start with an uncompressed file named mimetype
whose only content is application/epub+zip, so the type can be read from
fixed bytes at the start of the file. META-INF/container.xml points to
the package document, an .opf file that holds the book’s metadata, a
manifest of every file and the spine, which sets the reading order. EPUB 3 books have
a navigation document in XHTML; EPUB 2 books use an NCX file instead.
zipmimetypeapplication/epub+zip, stored first and uncompressed20 byteszipMETA-INF/container.xml where the package document isXMLzippackage.opf metadata, manifest and spineXMLzipnav.xhtml the table of contentsXHTMLzipchapters, CSS, images, fonts the contentvaries
Links
Software
- Apple Books (macOS, iOS)
- calibre (Windows, macOS, Linux)
- Thorium Reader (Windows, macOS, Linux)
- Sigil (Windows, macOS, Linux), for editing
Developers
Reference
- EPUB 3.3, W3C Recommendation