Ebooks

How to create an EPUB

EPUB is the ebook standard, and every major retailer takes it — including Amazon, which converts it on upload. If you make one file for ebooks, make this one.

The hard part is not producing the file. It is understanding that an ebook has no pages, which invalidates most of what you know about laying out a printed book.

What an EPUB actually is

An EPUB is a zip file with a specific structure inside it: one or more XHTML documents holding your text, a stylesheet, your images, a navigation document describing the table of contents, and a manifest listing the lot.

That is worth knowing even if you never open one, because it explains the single most important property of the format. Your text is marked up as structure — this is a heading, this is a paragraph, this is a block quote — and the reading app decides how that structure looks. You do not control the appearance. You control the meaning.

Reflowable
Text rewraps to the reader's screen, type size and margins. There are no pages, and page numbers are meaningless.
EPUB 3
The current version. Supports better accessibility metadata, mathematics, and media overlays. Use it; EPUB 2 is legacy.
Fixed-layout EPUB
A variant where pages ARE fixed. Correct for children's picture books, comics and cookbooks; wrong for anything text-led.

What changes from print

The conventions that do not survive the move from print to ebook.
PrintEPUB
Page numbers and folios Meaningless — the reader's device paginates
Running heads Supplied by the reading app, if at all
Fixed margins Set by the reader in their app's settings
Absolute type sizes (12pt) Relative sizes (1em, 1.2em) so the reader's choice wins
Chapters starting on a recto No such thing as a recto; chapters simply start
Blank pages Never — they become stray empty screens
Indent-only paragraphs Indent or space, but the reader's app may override
Hand-typed table of contents A navigation document generated from the headings
Scene break as a blank line Blank lines collapse — use a styled element

Getting the structure right

Almost every EPUB problem is a structure problem. The checklist:

  • Real headings, in order, without skipping levels. h1 for the book or chapter, h2 beneath it, h3 beneath that.
  • One XHTML document per chapter. A single-file EPUB is technically valid and painful to read on older devices.
  • A navigation document generated from those headings — never typed, because a typed one goes stale the moment you rename a chapter.
  • A declared language on the root element. Absent is not neutral: it makes a screen reader guess, and it usually guesses English.
  • Alt text on every image that carries meaning, and empty alt on every image that is decoration.
  • Semantic markup for the parts a reader navigates by — the epigraph is a blockquote, the scene break is an hr or a styled div, not a paragraph of asterisks.

Front matter in an ebook

Shorter than print, and in a different order, because a reader on a store's sample sees the first 10% of the file and you do not want that to be four blank pages and a dedication.

  • No half title, no blank versos — both are print-only conventions.
  • Title page, copyright page, then straight into the book. Dedication and epigraph if you have them, kept brief.
  • The table of contents is the navigation document. A visible contents page as well is optional and often skipped in fiction.
  • Move the acknowledgements to the back. In an ebook they are between the reader and the story.

Retailer differences

One EPUB is accepted everywhere, but the platforms are not identical and a few differences are worth knowing:

Amazon KDP
Converts your EPUB to its own format on upload. Check the result in Kindle Previewer, not in a generic EPUB reader — the conversion changes things.
Apple Books
The strictest validator of the major stores, and the most faithful to your CSS. If it passes here it passes everywhere.
Kobo
Accepts EPUB directly and renders it fairly literally.
Draft2Digital
Distributes one EPUB to many stores. Build to the generic profile rather than to any one retailer's quirks.

Alhora exports per-retailer variants of the same book — Kindle, Apple Books, Kobo and a generic build — rather than one file that has to satisfy all four.

Validating and testing

  1. Run EPUBCheck. It is free, it is what the retailers run, and a failure is a rejection.
  2. Open the file in Kindle Previewer and in Apple Books. Read a chapter in each.
  3. Change the type size twice in each app. Anything that is going to break will break here.
  4. Turn on a screen reader and listen to the first page. It is uncomfortable the first time and it finds things nothing else does.
  5. Check the navigation document actually jumps to the right chapters.

Questions, answered

What is the difference between EPUB and MOBI?

MOBI was Amazon's old format and is retired — Amazon stopped accepting it for new uploads in 2021 and Send-to-Kindle no longer takes it. EPUB is the standard everywhere, Amazon included. If someone tells you to make a MOBI, they are working from instructions written before 2022.

Can I just convert my PDF to EPUB?

Technically yes, and the result is reliably bad. A PDF is a set of fixed pages; converting it produces text with page breaks, running heads and page numbers embedded in the middle of the prose. Always build the EPUB from the manuscript, not from the print file.

Do I need to know HTML and CSS?

No, if you use formatting software — it writes both for you. It helps to know that is what is inside an EPUB, because it explains why ebook layout works the way it does: an EPUB is a zip file containing XHTML documents, a stylesheet, your images, and a manifest.

Should I embed fonts in an EPUB?

Usually not. Most readers have chosen their preferred font and many reading apps override yours anyway; embedding adds file size and licensing obligations for little gain. The exception is a book that needs a specific face for meaning rather than taste — a constructed script, heavy diacritics, a display face used as a device.

How do I check my EPUB is valid?

Run EPUBCheck, the free official validator from the W3C — every retailer runs it on upload, so failing it means a rejection. Then open the file in Kindle Previewer and in Apple Books, change the type size, and read a chapter in each. Validators catch structural errors; only reading catches design ones.

What is EPUB accessibility and do I need it?

It means the file can be read by a screen reader and navigated without sight: alt text on images, a real heading hierarchy, a declared language, and a navigation document. In the EU it is now a legal requirement for ebooks under the European Accessibility Act, which became enforceable in June 2025. Retailers are also beginning to surface accessibility metadata to buyers.

Export an EPUB that passes validation

Alhora exports EPUB 3.0 with retailer-specific variants for Kindle, Apple Books and Kobo, and audits accessibility before it writes the file.

Download Alhora free See pricing

macOS, Windows, Linux and ChromeOS. No card needed to format and preview.