All guides
Guide

How to Make an EPUB From Markdown (and a Print-Ready PDF)

Write one Markdown file per chapter, add the metadata stores need, package an EPUB 3 with navigation and a cover, validate it with EPUBCheck, and print a separate PDF interior for paperbacks.

Fastest way

Ask your AI to do it

Paste this into the AI agent you already use:

Help me use a Skill with another agent. Ask which agents and package I use, check supported locations and tools, identify any assumptions to change, and verify the workflow with a small example.

Quick answer

An EPUB is a zip of XHTML chapters, a stylesheet, images and a package file that lists them with the book's metadata. Start each Markdown chapter with a level-1 heading, convert it to well-formed XHTML, add a navigation document and a cover, put the uncompressed "mimetype" file first in the zip, and check the result with EPUBCheck before uploading.

Metadata stores read

  • Title, subtitle and author exactly as on the cover.
  • Language, which drives hyphenation and the reader's voice.
  • A description of a few sentences, shown next to the cover.
  • An identifier: an ISBN if you have one, otherwise a stable UUID.

Typography that survives readers

  • Curly quotes, real dashes and ellipses for the book's language.
  • Modest CSS so readers can change font and size.
  • Footnotes marked as footnotes so Apple Books and Kobo show them as pop-ups.
  • Alt text on every image for screen readers.

The print edition

Paperbacks need a PDF interior at the trim size, such as 6×9 inches, with a contents page that gives page numbers and chapters that open on right-hand pages. The cover for print is a separate wrap-around file sized to the page count, which the print service specifies.

Do it with an AI agent

EpubPress converts Markdown chapters into an EPUB 3 with navigation, footnotes, metadata and a cover, checks every file as XML, and prints a PDF interior with a contents page, page numbers and chapters on right-hand pages.

All guides