How to Create an EPUB File

An EPUB is a ZIP containing XHTML files, CSS, images, and a manifest. You don't need to build that by hand. Pick the method that matches how your content already exists.

From Word or Google Docs

Export to .docx first (Google Docs: File → Download → .docx), then convert with Calibre:

  1. Open Calibre, click "Add books," select the DOCX
  2. Select the book → Convert books → Output format: EPUB
  3. Under "Metadata": set title, author, cover image
  4. Click OK → right-click → Save to disk

Use Word's built-in Heading 1/2 styles. Calibre builds the TOC from those. Plain bold text is invisible to it.

For a scriptable pipeline (CI, batch conversion), Pandoc is cleaner:

pandoc input.docx -o book.epub --epub-cover-image=cover.jpg --toc --metadata title="Title" --metadata author="Name"

From Markdown or HTML

Pandoc handles multi-file assembly natively:

pandoc ch1.md ch2.md ch3.md -o book.epub   --metadata title="My Book" --metadata author="Name"   --epub-cover-image=cover.jpg --toc --toc-depth=2

Each file becomes a chapter. H1 → chapter title in the TOC. H2 → sub-entry with --toc-depth=2. Output is valid EPUB 3.

From existing EPUBs

If you have content split across multiple files — chapters exported separately, a series, PDFs converted to EPUB individually — merge them without code:

  1. Go to the EPUB merger
  2. Upload files and drag to set order
  3. Merge and download
  4. Use the metadata editor to set title, author, and cover on the combined file

Free tier: up to 10 files, 10MB each. Pro: up to 500 files, 100MB per file.

When you need full HTML/CSS control

Sigil is a free open-source EPUB editor that works directly with the book's internal XHTML and CSS. Use it for custom fonts, complex layouts, or fixed-layout pages. Significantly more work than Calibre or Pandoc, but nothing limits what you can do with the output.

Things that break EPUBs

  • Absolute CSS positioning — EPUB is reflowable. Fixed pixel positions break on different screen sizes.
  • Absolute links internally — links between chapters and to images must use relative paths.
  • Oversized images — 1500px on the long side is enough. High-res photos bloat the file. Compress afterwards if needed.
  • Not testingsend to Kindle and open in Apple Books. Both render slightly differently and expose different problems.

After creating

  • Validate — catches structural errors, broken links, and missing manifest entries before you distribute
  • Fix the metadata — title, author, language, description all flow to library views and store listings
  • Compress — typical savings are 30–70% depending on image content

Related

Try it now — free

Edit EPUB metadata online. Change title, author, description, language, publisher. Free ebook metadata editor - no software needed.

Edit EPUB Metadata →

Found this helpful? Share it