Skip to content

Markdown to EPUB converter

Markdown to EPUB is built by our document engine as an EPUB 3 package with generated navigation files, a title page, XHTML chapters, and default reader CSS.

  • Converted with Document engine · input deleted within 24 h
  • Free: 5 conversions a day · 5 MB each
  • Higher limits →

From real runs

What you get — and what changes

  • EPUB container Kept

    Our document engine produced a valid EPUB with mimetype, META-INF/container.xml, content.opf, nav.xhtml, toc.ncx, one title page, and one body XHTML file.

  • Markdown headings Kept

    The H1 and H2 headings became XHTML sections and appeared in both nav.xhtml and toc.ncx with links into the chapter file.

  • Front matter metadata Changed

    The YAML title and author became OPF metadata and a title page, while the generated language value was the neutral C locale.

  • Pipe tables Kept

    The Markdown table became an XHTML table with right alignment on the numeric column and table styling supplied by stylesheet1.css.

  • Footnotes Changed

    Markdown footnotes became EPUB footnote anchors and end-of-document aside elements rather than inline reader notes.

  • Code fences Kept

    The TypeScript fence became a sourceCode pre/code block with our document engine's syntax-highlighting CSS embedded in the chapter.

  • Local images Changed

    The local image became a link to assets/pixel.png with Tiny pixel as link text, and X-Warnings reported one image replacement.

  • Citation markers Changed

    The test citation stayed visible as [@doe2026] with citation markup, but no bibliography entry was generated.

Sample conversions

Field ledger with title metadata

Input
Markdown file with YAML title and author, H1/H2 headings, a table, inline math, one footnote, a TypeScript fence, and a relative PNG image.
Output
5.5 KB EPUB containing OPF metadata, nav.xhtml, toc.ncx, stylesheet1.css, title_page.xhtml, and ch001.xhtml. The relative image was replaced by a link to assets/pixel.png, and X-Warnings reported one image could not be embedded.

Reader navigation check

Input
The same Markdown converted with the toc option so the generated ebook could be unzipped and checked for reader navigation artifacts.
Output
nav.xhtml listed Field Ledger α and Results table, toc.ncx repeated those entries, and content.opf marked structuralNavigation and tableOfContents as accessibility features.

A real Markdown → EPUB run

We converted our Markdown sample (472 B) with Document engine on 2026-09-11. It took 30 ms and produced a 5 KB EPUB file, 12× larger than the input. The engine raised no warnings.

Input · sample.md · 472 B

3 headings, 1 table, 4 list items, 0 code blocks, 0 image references

Headings
3
Tables
1
List items
4
Code blocks
0
Images
0
Lines
13

Output · sample.epub · 5 KB

EPUB 3.0: 3 content documents, 0 images, EPUB 3 nav, no cover

Version
3.0
Content documents
3
Images
0
Table of contents
EPUB 3 nav
Cover
no cover

Options and when to change them

toc
Use when H1/H2 structure should be exposed in nav.xhtml and toc.ncx for ebook readers.

Do it yourself

pandoc

bash
pandoc book.md -t epub -o book.epub --toc

Our API runs pandoc with sandboxed image replacement, so local commands may embed assets that the service turns into source links.

Markdown to EPUB by API or MCP

The HTTP API and the MCP server run the exact engine this page uses (Document engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=md&to=epub.

curl
curl -X POST https://filetypeconverters.com/api/v1/convert \
  -H "Authorization: Bearer $FTC_API_KEY" \
  -F "file=@input.md" -F "from=md" -F "to=epub" \
  --output output.epub
API reference

When this is the wrong conversion

  • If you need a print-ready page layout, use /convert/md-to-pdf instead of an EPUB package.
  • If collaborators must edit the result in Word, use /convert/md-to-docx and keep the source Markdown for version control.
  • If local images must be embedded, convert them to data URIs before upload or use a packaging workflow that sends assets too.

Markdown to EPUB questions

Does Markdown to EPUB create a real table of contents?

Yes. In the tested run, our document engine wrote both nav.xhtml and toc.ncx, and the H1/H2 headings linked into the generated chapter XHTML.

Are local Markdown images embedded in the EPUB?

No. With the sandboxed our document engine route, the tested local image was replaced by a link to assets/pixel.png and the response carried an X-Warnings image-replacement header.

What CSS does the EPUB use?

Our document engine included stylesheet1.css with a reset, Georgia body text, heading spacing, table rules, and footnote styles. It is reader-oriented default CSS, not site branding.

Will Markdown citations become an EPUB bibliography?

A bare [@key] marker stayed visible and was tagged as a citation. It did not become a bibliography because no bibliography data traveled with the uploaded Markdown.