What is an EPUB file?
It is a ZIP archive with a website inside it. That is not an analogy — you can rename the
file to .zip, unzip it, and read the book as
ordinary HTML pages. Almost everything people find strange about ebooks follows from that
one fact.
Rename it and look
Here is the whole of a real one — Project Gutenberg’s Pride and Prejudice, 546 KB on disk, 23 entries:
bytes
mimetype 20
META-INF/container.xml 252
OEBPS/content.opf 4,727
OEBPS/toc.ncx 116,641
OEBPS/pgepub.css 735
OEBPS/0.css 3,033
OEBPS/…1342-h-0.htm.html 54,002
OEBPS/…1342-h-1.htm.html 55,981
… 13 more, 45–73 KB each
OEBPS/…1342-h-14.htm.html 31,491
OEBPS/wrap0000.html 431
OEBPS/…_cover.jpg 225,286
─────────
23 entries 1,217,117
No proprietary container, no binary blob. The novel is fifteen HTML files and two stylesheets;
content.opf is the index that ties them together and
toc.ncx is the table of contents. It is 1.2 MB of files
compressed to 546 KB, because it is a zip. The largest single item is the cover photograph, which
is bigger than a third of the book’s text.
Two of those entries are load-bearing rules rather than content. mimetype must be the first entry in the archive and must be stored uncompressed, so that a reader can identify
an EPUB by looking at the first few dozen bytes without unzipping anything. And
META-INF/container.xml is the only file whose path
is fixed by the standard — everything else can be laid out however the publisher likes, which is
why the folder here is called OEBPS in this book and
something else in the next one.
Three hops to the text
Finding the words is a chain of three lookups, and it is the same chain in every EPUB ever made:
- 1.
container.xmlnames the package document. It is 252 bytes and does nothing else. - 2. The package document — the
.opfholds the metadata (title, author, language, identifier), then a manifest listing every file in the book, then a spine. - 3. The spine is the reading order: which of the manifest’s files are content, and in what sequence. Everything not in the spine is a resource — an image, a stylesheet, the cover.
The manifest and the spine are different lists on purpose, and conflating them is the classic way to write a converter that loses chapters while still producing a plausible-looking file.
The metadata is more useful than it looks. The dc:language field is why our converter hyphenates a French novel
with French rules and an English one with English rules — patterns encode one language’s morphology
and do not transfer. When we first ran English patterns over Les Misérables, its
loose lines improved to 13.2% against 6% for the English books; with the French patterns it
landed at 7.5%, in line with the rest.
There are no pages in there
This is the part that trips people up. An EPUB does not contain pages, page numbers, or line breaks. It contains a continuous flow of text, and the reading app decides where that flow breaks — at the moment you open it, using your font, your text size, your screen and your margins.
We can put a number on how unfixed that is. Setting Pride and Prejudice at 6×9 inches in a classic novel style gives 415 pages. Switching on hyphenation — changing nothing about the book, the size or the typeface — gives 411. Choose A4 instead and it is different again. There is no correct page count to preserve, because the book never had one.
That is why ebook readers show a percentage, or a location number, or an estimate that changes when you bump the font size. It is also why citing an ebook is awkward, and why publishers who need stable pagination — legal texts, textbooks — ship a PDF instead. EPUB versus PDF is that trade-off and almost nothing else.
A spine item is not a chapter
The spine looks like a chapter list. It is not, and assuming it is produces some of the strangest ebook behaviour you will meet.
Pride and Prejudice has 61 chapters. The EPUB above has 16 spine items. The package document says why, in its own generated comments:
<!--Chunk: size=62728 Split on div-->
The book was cut into files by byte size, at whatever <div> happened to be nearby. Four chapters to a file, give or take. So a reader that keys "next chapter"
off the spine will skip four chapters at a time, and a converter that starts a new page per spine
item will set CHAPTER V. halfway down a page. We shipped exactly that bug and fixed it
by cutting at headings instead.
The other direction is worse. A publisher’s EPUB 3 sample of the Mahabharata in our test corpus has 2,014 spine items for one book. Spine items are files, and files are a packaging decision.
Fixed-layout EPUBs, which are barely EPUBs
There is a variant — fixed layout, or pre-paginated — where the publisher declares that each document is one designed page, at one size, and the reader must not reflow it. Comics, children’s picture books, cookbooks and textbooks use it.
It solves the layout problem by giving up the only advantage EPUB has. A fixed-layout EPUB shrinks to illegibility on a phone in exactly the way a PDF does, because it has become one in all but encoding. If a book is fixed-layout, converting it to PDF gains you nothing that matters and our converter does not offer to; it is built for books that are mostly text.
DRM: the part the converter sites skip
A book you bought is usually not the file described above. Two separate things are going on:
- Kindle books are not EPUB. Amazon uses AZW3 and KFX. Send-to-Kindle has accepted EPUB uploads since 2022, so the format goes in — but what comes back out of your library is not an EPUB.
- DRM'd EPUBs unzip fine and are still unreadable. The archive opens,
the structure is all there, and the XHTML documents inside are encrypted — a
META-INF/encryption.xmlentry lists which ones. The key is tied to your account and held by the retailer’s software, not stored in the file.
So: we cannot open a DRM'd book, and neither can any other tool that runs in a browser tab. There is no clever parsing that gets around a missing key. If you need one as a document, the route is whatever export the retailer offers, or none.
Most EPUBs are not DRM'd. Everything from Project Gutenberg, Standard Ebooks, most academic publishers, most self-published books, most things you were emailed and every EPUB you made yourself opens straight up.
What to do with one
- Read it. Apple Books on Mac and iOS; Calibre or Thorium on Windows and Linux; Google Play Books on Android. No desktop browser opens EPUB on its own.
- Print it, or give it fixed pages. Convert it to PDF — in your browser, with real typesetting, so the text stays selectable and searchable rather than becoming pictures of text.
- Look inside it. Rename to
.zip. It costs nothing and it is the fastest way to find out whether a file is what it claims to be.
Reading an EPUB should not require uploading it
Unzipping an archive and parsing XHTML is something browsers have done natively for twenty years. There is no model, no server-side step and nothing heavy about it: the largest book in our test corpus — 1.75 million characters, 974 pages once set — parses, typesets and renders to PDF in about two and a half seconds in a tab.
Which means a converter that asks you to upload your book is not doing so for technical reasons. Ours runs entirely in your browser and your files are never uploaded.
Questions
- What is an EPUB file?
- A ZIP archive containing a small website: XHTML documents for the text, CSS for the styling, images, and two index files that say what is in the box and in what order to read it. EPUB is the open ebook standard, maintained by the W3C, and it is what almost every ebook shop except Amazon sells.
- Can I really rename an EPUB to .zip and open it?
- Yes, and it is the fastest way to understand the format. Change the extension to .zip, unzip it, and you get the whole book as ordinary HTML files you can open in a browser one at a time. Nothing is hidden and nothing is encrypted — unless the book has DRM, in which case the archive still opens and the documents inside are unreadable.
- Why does my EPUB have no page numbers?
- Because it has no pages. An EPUB stores the text as one continuous flow and the reading app decides where lines and pages break, using your font, your text size and your screen. Change any of those and the page count changes. That is the design, not a defect — it is why an ebook is readable on a phone.
- How do I open an EPUB file?
- On a Mac or iPhone, Apple Books opens it by double-clicking. On Windows, no reader ships with the system: Calibre, Thorium and Microsoft’s Store readers all work. No desktop browser opens EPUB natively — Edge had a reader and removed it in 2019. If you want it as a document rather than in a reader, convert it to PDF.
- What is the difference between EPUB 2 and EPUB 3?
- EPUB 2 (2007) is XHTML 1.1 with an NCX file for the table of contents. EPUB 3 (2011, and current) is HTML5 with a real navigation document, plus support for MathML, embedded audio and video, and read-along audio. Readers handle both, and so does the converter here. In practice you rarely need to know which you have.
- Why can’t I open the ebook I bought from Kindle or Kobo?
- Kindle books are not EPUB at all — they are AZW3 or KFX. Books from Kobo and Google Play usually are EPUB, but wrapped in DRM: the XHTML inside is encrypted, and the key belongs to your account rather than to the file. The retailer’s own app is the only thing that can open it. No browser tool can, including this one.
| Keep reading | What it covers |
|---|---|
| EPUB vs PDF | Which format you want, and what converting between them costs. |
| EPUB to PDF | The converter itself — four book styles, real type, no upload. |
The archive listing, the Split on div comment and the spine count
were read from Project Gutenberg’s Pride and Prejudice EPUB on 24 August 2026. Page counts,
hyphenation figures and timings are our own, measured across a 14-book corpus while building the
converter in August 2026.