Markdown to EPUB

Nothing you choose here leaves your browser, and nothing is downloaded to make it work — no parser, no library, nothing. You can also paste instead of choosing a file.

…or drop a file anywhere on this page.

A book from a Markdown file, split into chapters at your headings.

This is the one people write plainly and then need in a format an e-reader accepts. The document is turned into HTML, split at the top-level headings, and written as a valid EPUB 3 with a table of contents built from those same headings. Every structural rule the format has is followed, including the one that catches everybody: the mimetype entry first in the archive and stored uncompressed.

Which Markdown, exactly

There is no single Markdown, and a converter that does not say which one it speaks has told you nothing. There is the original 2004 script, CommonMark (which pinned down what the original left ambiguous), GitHub Flavored Markdown — CommonMark plus a few additions — and a dozen dialects beyond that. The same file genuinely produces different documents in different tools.

This reads CommonMark, plus the three GFM additions people actually use: tables, strikethrough and task lists. So: headings both ways round, emphasis and strong, code spans and fenced code with a language, links and reference links, images, autolinks, ordered and unordered lists nested to any depth, tight and loose lists, blockquotes, thematic breaks, hard line breaks and backslash escapes.

It does not read footnotes, definition lists, citations, maths, or the attribute and directive syntaxes that particular tools add. Those come through as the characters you typed, rather than disappearing without a word.

Raw HTML is shown, not run — on purpose

CommonMark lets you write HTML inside Markdown and passes it straight through. This escapes it and shows it as text. That is a deliberate difference and not an oversight: what this page hands back is a file you download and open in a browser, and a converter that quietly carried a <script> out of somebody's document and into that file would not be doing you a favour. If you want the HTML rendered, the document you want is HTML, not Markdown.

How it is checked

Against pandoc, which is the reference implementation most people would reach for and was written by other people over fifteen years. A document covering every construct listed above goes through both, and the two outputs are compared on the sequence of elements, the words in order, and every link and image address.

Not on the HTML text itself, which would be a test of formatting: two correct implementations disagree about whitespace and about attributes that carry no meaning. A comparison that goes red for reasons nobody can act on is a comparison people stop reading.

What it will not do

It will not split a document that has no headings. Markdown with no # in it becomes one chapter and a contents page with one entry, which is honest rather than useful — add headings and it becomes a real book.

It does not fetch anything your document refers to. A picture at a web address stays a reference to that address, because going to get it would mean this page contacting another site — the one thing it promises never to do. And it is not a linter: it converts what you wrote rather than telling you what you should have written.

Where to go next