MarginaGet Margina
Articles

Published

What an EPUB Actually Is — A Reader's Anatomy of the Format

An EPUB is a small website packed inside a zip file. Here's what's actually in one, why it reflows, and how a calm reading app opens it on your phone.

An EPUB is a small website packed inside a zip file. That sentence is almost the whole story — but the details are worth a few minutes, because once you've seen what's inside one, reading on a phone stops feeling mysterious.

So: a short anatomy lesson. What's actually in the file. Why the text reflows. Where you tend to meet the format. And how Margina opens one without asking anything of you.

What's actually inside the file

The zip and the mimetype

Take any .epub, duplicate it, and rename the copy to .zip. Double-click. The directory inside is plain and surprisingly human-readable. Technically, an EPUB is a ZIP archive with a particular structure inside.

The first file in the archive is always a tiny one called mimetype. It's uncompressed on purpose and contains exactly one string: application/epub+zip. A fingerprint. Any program that opens the archive can read those bytes immediately and know what it's looking at, without unpacking anything else.

META-INF and container.xml

A folder called META-INF holds container.xml, a small file that points to the brain of the book: the package document.

The package, the manifest, and the spine

The package document — usually content.opf — does three things. It carries the metadata (title, author, language, identifier). It lists every file in the archive in a manifest (chapters, images, fonts, stylesheets). And it lays out a spine: the order those files should be read in. The spine is what makes an EPUB feel like a book rather than a folder of pages.

Web content, just packaged

The chapters themselves are written in XHTML, styled with a subset of CSS, with SVG and optionally JavaScript. The same stack a website uses. An EPUB, in other words, is a small offline website with a table of contents.

Reflowable, not paginated

Why an EPUB looks different on every screen

A printed book has pages. A PDF has pages. An EPUB, by default, has none. Open one on a phone and the text wraps to the screen. Bump the font size and the line breaks change. That property is called reflow, and it's why an EPUB feels at home on a 6-inch phone, a 13-inch tablet, and a small e-ink reader without anyone fussing over pinch-and-zoom. The "page numbers" some apps show are estimates; the text underneath is the constant.

Fixed-layout EPUB exists for designed pages

A fixed-layout flavour of EPUB 3 exists for cases where pagination is the point: children's picture books, comics, manga, designed cookbooks, some textbooks. The format supports both modes.

The honest comparison with PDF

PDF freezes the page. EPUB freezes the meaning. Neither is "better" in the abstract — they answer different questions. A novel is usually happier as an EPUB because what you want is the prose, sized for your eye. A typeset poem or a contract, where the line breaks matter, tends to prefer PDF. A reading app that handles both saves you from having to pick a side.

Where you'll meet an EPUB

The public-domain library

Project Gutenberg, Standard Ebooks, the Internet Archive — that trio, plus a handful of smaller archives, is the practical front door to roughly everything out of copyright. The downloads are almost always EPUB.

Bookstores and your own drafts

Apple Books, Google Play Books, Kobo, and most independent ebook sellers sell EPUB files. Word, Pages, Scrivener, Vellum, and Adobe InDesign all export to it — the practical path for a writer who wants to read their own draft chapter on a phone, the way a reader would.

A short history note

EPUB became an official standard in September 2007 through the IDPF, superseding the older Open eBook (OEB) format from 1999. The current version, EPUB 3.3, was finalized at the W3C on 25 May 2023. Amazon's Kindle only began accepting EPUB through Send to Kindle in 2022. The format is standardized as ISO/IEC TS 30135 and is open — no per-publisher licensing fee, no gatekeeper.

How Margina handles an EPUB

You drop the file in via the share sheet — from Files, Mail, or any browser. Margina opens it without asking for an account, because there is no account.

The app renders the XHTML and CSS the way a small, careful browser would. Text reflows for your screen. The font is adjustable. The margins are yours. Hold on a passage to highlight it, write a note in the margin the same way. The annotations live next to the file, not on a server.

Close the book on page eighty-four. Come back in a week. You land on page eighty-four. Resume-where-you-stopped works the same whether the file is EPUB, PDF, Word, or plain Markdown. Backup is to your own iCloud or Google Drive, so the library stays yours. The free tier covers your first handful of documents on the App Store and Google Play.

Frequently Asked Questions

Is an EPUB really just a ZIP file?

Yes. The .epub extension is a ZIP archive with a specific structure inside — a mimetype file as the first entry, a META-INF directory with container.xml, and a package file (usually content.opf) that lists every resource and the reading order. Rename a copy to .zip and a desktop archiver will unpack it.

What's the difference between EPUB and PDF for reading?

PDF pins each page to a fixed size, so the layout is identical on every screen. EPUB reflows the text — line breaks, page breaks, and font size adjust to the device. A novel reads better as an EPUB on a phone; a legal contract or a typeset poem usually reads better as a PDF.

Why didn't the Kindle read EPUB for years?

Amazon used its own MOBI and AZW formats and only added native EPUB acceptance through the Send to Kindle service in 2022. EPUB is older than the Kindle, but it lived outside the Kindle ecosystem until then.

Is EPUB an open format?

Yes. EPUB is published by the W3C with the IDPF and standardized as ISO/IEC TS 30135. Anyone can produce or read an EPUB without paying a license. DRM is an optional layer some publishers add on top; it isn't part of EPUB itself.

Closing note

An EPUB is not a mystery. It's a small, inspectable container of web content — a zip with a manifest and a reading order. Knowing what's inside makes it easier to trust the file, and easier to choose a reader that respects it. More from the Margina notebook when you want it.