MDConverter
Universal In-Browser Converter
100% Client-Side Private

Make an EPUB E-book from Markdown

Write or paste Markdown and download an EPUB 3 e-book: chapters split at your headings, a clickable table of contents, title and author from front matter, and code, tables, images and equations formatted for e-readers. Every file passes EPUBCheck, so it opens in Apple Books, Kobo, Google Play Books, Calibre and Send to Kindle.

  • Free, no watermark
  • No sign-up
  • Files never leave your browser
Try an example:
Paste Markdown or an AI chat answer, or drop a .md / .txt file. Runs in your browser. Nothing is uploaded.
Input · Markdown
Result · EPUB e-book (.epub)
Your e-book is ready · 3 chapters

EPUB 3 with a table of contents, for Apple Books, Kobo, Google Play Books, Calibre and Send to Kindle.

Contents
  1. Chapter 1: Arrival
  2. Chapter 2: The Logbook
  3. Chapter 3: The First Storm

The Lighthouse Keeper

Chapter 1: Arrival

The boat left her on the jetty with two suitcases and a box of books. The lighthouse was taller than the photographs had suggested.

“You’ll get used to the stairs,” the boatman said. “Everyone does, eventually.”

Chapter 2: The Logbook

Every keeper before her had written in the same logbook:

Year Keeper Storms logged
1952 T. Reyes 14
1968 M. Okafor 22

She added her name to the bottom of the list.

Chapter 3: The First Storm

It arrived on the fourth night, exactly as the barometer had warned.

Words:124
Characters:664
Read time:~1 min
Headings:4
AI tokens:~165
Updates as you type
Markdown → EPUB e-book (.epub)
Quick Tutorial

How to Convert Markdown to EPUB in 3 Simple Steps

No installation or registration required. Follow these steps to convert and export your files in seconds.

1

Write or paste your book

Use # or ## headings for chapters. Add front matter (title, author, lang) or fill in the fields above the preview.

2

Check the chapters

The preview shows how many chapters were found; open Contents to see their titles.

3

Download the EPUB

Click “Download .epub” and open it in your reader, or send it to your Kindle.

Known Limitations of Markdown to EPUB

What this converter does not do (yet), and what to do instead.

  • No cover image yet; the book has a text title page. Add a cover in Calibre or your publishing platform.
  • Images must be embedded in the Markdown; images linked from the web become links.
  • MathML support depends on the reader (Apple Books, Kobo and Thorium display it; some readers show the formula as text).
  • Footnotes ([^1]) are not turned into EPUB pop-up notes.
Syntax Cheat Sheet & Translation Guide

Markdown ↔ EPUB Syntax Cheat Sheet & Reference Guide

Side-by-side syntax comparison and quick reference guide. Look up how headings, code blocks, tables, and typography elements translate between Markdown and EPUB. Click any snippet to copy.

Syntax ElementMarkdown SourceEPUB EquivalentBehavior & Notes
Front matter
--- title: The Lighthouse Keeper author: Ada Writer ---
dc:title, dc:creator in content.opf; title page
lang: sets the book language (default en)
Chapters
## Chapter 1: Arrival
chapter-001.xhtml + table of contents entry
Split at the first heading level that repeats
Math
$$\bar{x} = \frac{1}{n}\sum x_i$$
MathML (<math>…</math>)
The chapter is flagged as containing MathML, as EPUB requires
Embedded image
![Map](data:image/png;base64,…)
images/image-1.png inside the book
Web images become links
Internal link
[see chapter 3](#chapter-3-the-first-storm)
chapter-003.xhtml#chapter-3-the-first-storm
Links to headings in other chapters still work
Showing 5 syntax mappings← Swipe to view full table →
Format Comparison Matrix

Markdown vs. EPUB — Deep Feature Analysis

Understanding the architectural trade-offs, ecosystem compatibility, and optimal workflows for each format.

Evaluation DimensionMarkdown CharacteristicsEPUB CharacteristicsVerdict
Reading on phones and e-readersPlain text with symbolsReflowable pages, fonts, night mode, bookmarksEPUB for reading
NavigationScroll through one fileTable of contents and chapter jumpsEPUB for long documents
Writing and editingAny text editor, version controlNeeds an EPUB editorKeep Markdown as the source; export EPUB when you publish
3 architectural dimensions evaluated← Swipe to compare →

When to Use Markdown

Best for fast, distraction-free drafting, Git version-controlled documentation, developer pull requests, and multi-format source authoring.

When to Convert to EPUB

Best for delivering formal client assets, corporate stakeholder review, publication on specialized platforms, or high-fidelity visual presentation.

Real-World Workflows

Who Relies on Markdown to EPUB?

Explore how engineering teams, technical writers, and data analysts streamline daily operations.

Writers

Reading your draft as a book

Export the manuscript and read it on a phone or e-reader — the change of format makes problems easier to spot.

Impact: A real e-book from your draft in seconds.
Teachers and trainers

Course notes for offline reading

Turn lesson notes with code and formulas into an e-book students can read without a connection.

Impact: Readable on any device, with a table of contents.
Bloggers and newsletter writers

Collecting posts into a book

Paste a series of posts, one per heading, and give readers a downloadable EPUB.

Impact: A bonus for subscribers with no design work.
Best Practices & Pitfalls

Pro Tips & Edge Cases Handled for Markdown to EPUB

Practical advice for achieving high-fidelity conversions and resolving syntax edge cases.

Developer Pro Tips

  • Put a single # Book Title at the top and use ## for chapters — the title then stays out of the chapter list.
  • Start each chapter with its own heading; text before the first chapter becomes an “Introduction”.
  • Converting a Word manuscript? Use Word to Markdown with images embedded, then paste the result here.
  • To go the other way, EPUB to Markdown turns a DRM-free e-book back into editable text.

Edge Cases Resolved Automatically

⚠️ HTML in the Markdown that is not valid XHTML
Resolution: Unclosed tags are closed, void elements like <br> are self-closed, entities like &nbsp; become numeric, and scripts are removed, so strict readers do not reject the chapter.
⚠️ Tables with column alignment
Resolution: GFM alignment is written as CSS (text-align), because the HTML align attribute is not allowed in EPUB 3.
⚠️ A # comment inside a code block
Resolution: Code blocks are skipped when looking for chapter headings, so a Python or shell comment never starts a chapter.
Frequently Asked Questions

Frequently Asked Questions About Markdown to EPUB

Comprehensive answers to common technical, formatting, security, and compatibility questions.

Paste your Markdown here and click “Download .epub”. Each repeated top-level heading becomes a chapter with an entry in the table of contents. On the command line, Pandoc does the same with pandoc book.md -o book.epub; this page needs no install and shows the chapter list before you download.

Under The Hood

How the Markdown to EPUB Engine Works

Every step below runs in your browser tab; your content is never sent to a server.

01

Lexical Tokenization

Raw Markdown stream is parsed into syntax tokens with boundary and nesting validation.

02

AST Tree Construction

Tokens are mapped into a standardized in-memory Abstract Syntax Tree structure.

03

Semantic Translation

AST nodes are translated into compliant EPUB elements, headings, and tables.

04

Client-Side Serialization

Output is generated directly in your browser, so it is ready to copy or download immediately.

Pipeline Architecture Specification

Front matter is read for title, author and language, and the Markdown is split into chapters at the first heading level that repeats. Each chapter is rendered with marked (GitHub Flavored Markdown) and highlight.js; LaTeX becomes MathML with KaTeX; embedded images are stored as files; headings get ids so internal links can point across chapters. The HTML is re-serialised as well-formed XHTML (void elements closed, presentational attributes turned into CSS) and packed with JSZip into an EPUB 3 container with a nav document, an NCX and a package document.

Processing Engine
marked + KaTeX (MathML) + XHTML serialiser + JSZip, in your browser
Specification Standards
EPUB 3.3 (validated with EPUBCheck) with EPUB 2 NCX
Execution Latency
Under a second for a novel-length book
Privacy SLA
100% client-side (nothing is uploaded)

Why Choose MDConverter for Markdown to EPUB?

Valid EPUB 3 (checked with EPUBCheck) with an EPUB 2 table of contents for older readers
Chapters split at the first heading level that repeats — # chapters, or ## chapters under a # book title
Title, author and language from YAML front matter, the first heading, or the fields above the preview
Tables, code blocks with highlighting, task lists and links; LaTeX math as MathML
Images pasted into the Markdown are packed into the book
Built in your browser — your manuscript is never uploaded

100% Client-Side Privacy & Security Guarantee

Unlike online converters that upload your files to a remote server, MDConverter runs every conversion with JavaScript inside your browser tab. Your documents are never uploaded, so they never leave your machine.

Documents & Office Files

Move Markdown in and out of Word, PDF, PowerPoint, EPUB, OneNote, RTF, HTML, plain text and images.

Reverse directionEPUB to Markdown ConverterConvert EPUB E-books to MarkdownAlso usefulMarkdown to PDF ConverterConvert Markdown to Clean, Print-Ready Vector PDF DocumentsAlso usefulMarkdown to Word ConverterConvert Markdown to Word Documents (.docx) OnlineAlso usefulMarkdown to HTML ConverterConvert Markdown to Clean, Semantic HTML5Also usefulMarkdown to Plain Text ConverterMarkdown to Plain Text — Strip Markdown FormattingAlso usefulMarkdown to RTF ConverterConvert Markdown to Rich Text Format for TextEdit & WordPad
Browse all Markdown converters