16 / Create · Markdown → EPUB

Markdown to EPUB converter

From Markdown to a real book.

Convert a Markdown file or pasted draft into an EPUB with chapters, navigation and book metadata. Choose the heading level for chapter breaks, review the detected list, and rename or exclude chapters before exporting. Use the preview to check which formatting survives before opening the finished book in your reading app.

  • Markdown or plain text, up to 10 MB
  • Review chapters before the EPUB is built
  • Runs in this tab; nothing is uploaded
All tools
Opening your workspace…

At a glance

Markdown to EPUB quick specs

Verified
Input
Markdown (.md, .markdown) or pasted text
Output
EPUB 3 with chapter splits, contents & metadata
Scope & limit
Up to 10 MB per file
Processing
Local in your browser — files never upload
Price & account
Free; no sign-up or install required
Key boundary
Review chapter breaks before export; remote image URLs are not fetched

From file to finished

How to convert Markdown to EPUB

  1. Paste Markdown into the editor, choose a .md, .markdown or .txt file with Choose a file, or press Try sample Markdown to load the three-chapter example.

  2. Pick # heading or ## subheading under Split on, then press Review chapters. A file load or the sample runs this step automatically; any later edit to the text or the level disables the download until you review again.

  3. In the Chapters list, untick a row to leave it out, type a new title to rename it, or use Include all and Clear selection. The preview follows the row you select and shows the rendered body.

  4. Fill in Book title, Author if you want one, and Language code. A loaded file seeds the title from its name with the extension removed; blanking the title stops the download with a sentence asking for one.

  5. Press Download EPUB and check the status line: it reads EPUB created. Your download should start automatically. The file is named after the title with unsafe characters replaced.

Formats and inputs

Supported Markdown formats and inputs

Markdown is source text with formatting notation; EPUB is a package of reading documents and navigation. Different Markdown dialects add tables, task lists, footnotes or math, so a .md extension does not guarantee those features convert here. Heading detection and rendering are separate steps: check the chapter list as well as the preview. Relative image paths are not a bundled folder of assets.

InputSupportWhat to expect
UTF-8 .md or .markdown with # headingsBest fitThe recommended split level turns each top-level heading into a chapter; ## and deeper headings stay inside it as subheadings. This is the shape the sample and the documentation pages use.
Pasted Markdown, including text with no headingsWorksPaste and press Review chapters; no file means no 10 MB check, but the 5 million character limit is not applied to pasted text either. No headings yields one untitled chapter.
Plain .txt without headingsWorksThe text becomes a single chapter whose contents entry falls back to Chapter. Split level has nothing to match, so the preview and the EPUB show one long document.
GFM tables, fenced code, strikethrough and autolinksWorksmarked runs with gfm enabled, so pipe tables, language-classed code blocks, strikethrough and bare URLs render. Task-list boxes are removed by the sanitizer, leaving the item text.
Raw HTML such as span, div or a style attributePartialDOMPurify keeps common inline and block tags and strips script, style, iframe, form controls and event handlers. A layout built from raw HTML may survive but is not guaranteed to look the same.
Images referenced by URL or relative pathPartialA remote https image keeps its src and is not packaged; a relative path loses its src entirely; a base64 data:image stays inline. No image is added to the EPUB manifest or an images folder.
Footnotes written as [^1]Not supportedNo footnote extension is enabled. The marker and the definition remain literal text in the paragraph, and nothing links them or moves the note to the end of the chapter.
A file over 10 MB, text over 5 million characters or more than 1,000 chaptersNot supportedEach limit has its own refusal message. Split the manuscript into volumes, choose the other heading level, or paste only the part you need.

What it can do

What Markdown to EPUB can do

Split on the heading level your file already uses

Pick # heading or ## subheading in the Split on menu and press Review chapters. The rule matches exactly that level, so a ## line never splits a level-one book, while a hash at the start of a line inside a fenced code block does. A file with no match becomes one chapter labelled no heading (whole text).

Rename or exclude a chapter without editing the source

Every detected chapter becomes a row with an editable title and a checkbox. Clear the tick to leave that chapter out of the spine, the navigation document and the NCX; type in the field to change the title above the text and in both contents lists. Include all and Clear selection flip every row at once. The Markdown is never modified.

See the rendered chapter before you commit to the export

The preview renders the selected chapter with marked and passes it through DOMPurify, the same path the book uses. Pipe tables, language-classed code blocks, strikethrough, autolinks and allowed raw HTML appear as they will in the XHTML. Task-list checkboxes are stripped, so the item text stays without its box.

Set the metadata a reading app actually displays

Book title, Author and Language code become dc:title, dc:creator and dc:language in the package document. The title also names the download, with unsafe characters replaced and the base name trimmed to 120 characters. Author is optional and omitted when blank; the language must look like en, en-US or zh-Hans.

Download a standard EPUB 3 with two tables of contents

The archive holds a stored mimetype first, META-INF/container.xml, OEBPS/book.css, one chapter-N.xhtml per included chapter, nav.xhtml, toc.ncx and content.opf. The spine follows the sidebar order, so renaming or excluding a row changes the reading order without editing the Markdown. No cover, font or image folder is added.

After you run it

What you get from Markdown to EPUB

The download is a single EPUB 3 file. These are the parts you can check, and the signals that tell you the split and the metadata were applied rather than ignored.

What you getWhat it means
An .epub named after the book titlesafeFilename keeps spaces, replaces characters such as / and : with -, trims the base name to 120 characters and appends .epub.
One XHTML document per included chapterchapter-1.xhtml onward, in sidebar order; an unticked row has no file, and a renamed title becomes both the visible h1 and the document title.
nav.xhtml and toc.ncx with the same entriesBoth lists are written from the included rows, which is what a reader shows as the chapter menu and what an older reader uses instead.
Package metadata from the three fieldscontent.opf carries dc:title, dc:language and, when an author is given, dc:creator, plus a generated urn:uuid identifier and a dcterms:modified timestamp.
A completion message and a downloadThe status line says the EPUB was created and the file lands in the downloads folder. Download EPUB can be pressed again to rebuild from the current rows.
A heading-only page for a heading with no textA chapter whose heading is followed immediately by another heading still exports, as a page containing just its h1. It is not an error, and unticking that row removes it.

When people reach for it

Common Markdown to EPUB use cases

Use an EPUB proof when a manuscript or document should be read outside its writing app. Check specialized syntax and linked assets first, particularly when the source was designed for a repository or publishing framework.

If you need to…What this tool does
Turn a finished README or documentation folder into a tablet bookJoin the pages with # headings, paste the result, keep only the chapters that belong in the book and download; the source files are not modified.
Package a serialized essay or newsletter into chaptersPut each installment under one heading, choose the matching level, exclude any heading that is only a title page and export one file whose contents list follows the series order.
Make a course handout from notes with one heading per lessonLoad the notes, review the lessons as chapters, fill in a title and an optional author and language, then send the EPUB to a reader instead of a long document.
Give a beta reader a book file instead of a Markdown fileSet the title and author, download the EPUB and share that; the text is escaped into XHTML, so the reader never sees hashes, pipes or backticks.
Rebuild a book after renaming sectionsReview the chapters, rename only the affected rows and download again; the source Markdown keeps its old headings while the book gets the new titles.
Make a small EPUB to test a reading app or an e-ink deviceKeep one or two chapters, use a short title and download; the archive is small enough to sideload, and the chapter and contents behaviour is the same as in a full book.

Why use it

Why turn Markdown notes or drafts into an EPUB

This workflow suits a draft that already uses headings and needs a reading edition. It makes chapter boundaries reviewable without requiring a command-line build, while leaving the Markdown source available for future editing and version control.

Proof the draft in an actual ebook workflow

A document that looks right in a code editor can read differently after reflow on an e-reader. Creating an EPUB gives you a practical proof copy for checking section length, headings and navigation away from the writing environment.

Resolve chapter boundaries before the book leaves the editor

A manuscript may use one heading level for its title and another for chapters. Selecting the split level and reviewing the list reduces the chance of distributing a book with one enormous chapter or dozens of accidental breaks.

Keep the manuscript as the source of future editions

An export is easier to reproduce when the editable original remains authoritative. Correct prose and heading patterns in Markdown, then regenerate the reading copy, rather than making unsynchronized text revisions in both Markdown and the EPUB.

Know when a publishing toolchain adds necessary control

A custom cover design, asset collection or specialized syntax may need an editor or template-based pipeline. The visible conversion boundaries help you make that decision early, instead of assuming that every feature of your Markdown app is portable.

When it does not work

Why Markdown to EPUB may fail

The page refuses a file or a build at fixed points, and each refusal has its own sentence. Two of them run before any parsing; the rest change what reaches the chapter list or the XHTML. The wording below is what the page prints.

  • The chosen file is larger than 10 MB

    The size check runs before the bytes are decoded and prints This file is larger than 10.0 MB. Choose a smaller file to keep this browser responsive. Split the source or paste only the volume you need.

  • The file text is over 5 million characters

    After decoding, the loader counts characters and stops with This text exceeds 5 million characters. Split it into smaller books. Pasting the same text is not counted by that check, but the tab still holds it in memory.

  • More than 1,000 headings match the chosen level

    The split produces more than a thousand chapters, so the scan clears the list and prints More than 1,000 chapters were detected. Choose a narrower heading level. A loose pattern or repeated hashes inside the prose can produce this.

  • Review chapters is pressed with an empty editor

    Whitespace only reaches the analyze step and returns Add some Markdown before reviewing your chapters. Nothing is built, and an earlier chapter list is cleared rather than kept.

  • The language field carries an underscore or one letter

    The EPUB writer accepts two to eight letters followed by hyphen-separated subtags, so en_US and e fail with Use a language code such as en, en-US, fr or zh-Hans. The value is not repaired for you.

  • A code comment becomes a chapter

    The splitter runs on the raw text before Markdown parsing and has no fence tracking, so a line starting with # inside a fenced shell block matches. The chapter list shows the comment as a title and the fence is cut in two.

  • An image disappears after export

    DOMPurify keeps only http(s), mailto, ftp, #, / and base64 image URIs on src. A relative path such as pics/cover.png is removed with its attribute, so the paragraph keeps the alt text and loses the picture.

Repair paths

How to fix common Markdown to EPUB issues

Match the sentence in the status line to a row. Four rows are refusals you cannot override; the last three are structural surprises you can work around by editing the source or the chapter list.

What you seeLikely causeWhat to do
“This file is larger than 10.0 MB…”The byte gate runs before decodingCompress or split the source, or paste one chapter at a time; the limit is fixed and no setting raises it.
“This text exceeds 5 million characters…”The character count runs after the file is decodedSplit the manuscript into volumes and build one EPUB per part; pasting bypasses this check but not the memory cost.
“More than 1,000 chapters were detected…”The chosen heading level matches too many linesSwitch to ## subheading if the top level is noisy, remove duplicated hashes, or split the file before reviewing.
“Add some Markdown before reviewing your chapters.”The editor is empty or holds only whitespacePaste the text, load a file or press Try sample Markdown, then review; there is nothing to build from an empty box.
“Use a language code such as en, en-US, fr or zh-Hans.”The tag contains an underscore, a space or one letterReplace it with a two-to-eight-letter tag and optional subtags, for example en, fr-CA or zh-Hans; the underscore is not converted.
The chapter list starts at a shell commentThe splitter reads the raw text without tracking code fencesChange the comment or raise the split level, then review and untick the false chapter; the preview shows the broken fence.
A picture is missing in the EPUBA relative image source is removed by the sanitizerUse an absolute https URL and accept that it stays a link, or inline a small picture as a data:image; nothing is packaged either way.

Plain-language notes

Key Markdown and EPUB terms explained

These are the terms that decide what the splitter does, what the sanitizer keeps and what the exported package contains. Each entry maps to a control or a file you can inspect.

ATX heading

A heading written with one to six hash marks at the start of a line, optionally closed by more hashes. The splitter matches only the exact level chosen in the menu and keeps the rest of the line as the chapter title.

Split level

The heading depth that starts a new chapter: level one for a # line, level two for a ## line. Deeper headings stay inside the chapter as h3 to h6 elements, and a file with no match becomes one chapter.

GFM

GitHub Flavored Markdown, the dialect marked is asked to parse. It adds pipe tables, task lists, fenced code, strikethrough and bare-URL autolinks to CommonMark. The page enables it, then passes the HTML through DOMPurify.

Sanitizer

DOMPurify removes forbidden elements and attributes after parsing: scripts, styles, frames, forms, media, event handlers and unsafe URLs. It is why a relative image loses its source and why a task-list checkbox disappears while its text remains.

XHTML

The XML form of HTML that EPUB readers expect. Each included chapter becomes its own XHTML document with an h1 carrying the chapter title, the sanitized body and a link to book.css; ampersands and angle brackets are escaped.

OPF package

content.opf lists every chapter in the manifest and fixes the reading order in the spine. It also carries the title, language, optional author, a urn:uuid identifier and a modification timestamp, and points at the navigation and NCX files.

Navigation document and NCX

nav.xhtml is the EPUB 3 contents list; toc.ncx is the older format kept for readers that ignore the newer file. Both are written from the included chapter rows, so they list the same titles in the same order.

Data URI

An image encoded into the Markdown or HTML itself, starting with data:image/ and a base64 payload. It survives sanitizing and travels inside the XHTML, unlike a relative path, which is stripped, or a remote URL, which stays a link to the network.

CommonMark and extended Markdown

CommonMark describes core Markdown syntax. Tables, task lists, footnotes and math vary across extensions and parsers. A file that renders in one writing app may therefore need adjustment before becoming a predictable EPUB in another converter.

Other ways to do it

Markdown to EPUB vs. alternatives

If the job is more than Markdown plus a contents list, one of these is the better first stop. The trade-off column is what choosing it costs you.

OptionBetter whenTrade-off
pandoc with an EPUB templateThe source mixes Markdown with citations, math, custom CSS or a cover, and the conversion must run in a script over many files.Requires an install, a template and command-line flags; there is no chapter preview before the file is written.
Calibre Convert books or Edit bookThe book already exists as a draft EPUB, or the title needs a cover, series, publisher and a metadata dialog.A desktop conversion or editing workflow adds its own settings and package transformations. Inspect those results against this page’s fixed reading stylesheet and visible chapter selection.
SigilChapters need XHTML-level edits, a hand-built stylesheet or a cover page that must sit in the spine.Installs an editor and expects XHTML knowledge; rebuilding from Markdown later would discard the edits made in Sigil.
A small script with JSZip or a libraryThe same template must be applied to dozens of manuscripts on a schedule, with tests around the output.Maintain parsing, assets, metadata and package construction in code. That investment is useful for recurring builds; validate the output when the source or dependencies change.
Leaving the text as MarkdownThe reader opens Markdown directly, or the file is a README that never needs to leave the repository.No EPUB is created. Rendering, metadata and navigation depend on the Markdown app, which may be sufficient when the document will stay in that environment.

Your files and this tool

Privacy, accuracy and Markdown to EPUB limits

The text stays in the tab. What leaves the browser is the page itself and the requests that load it, not the Markdown or the EPUB.

  • The chosen file is read with the File API and decoded in memory; no request carries its bytes, and the editor content lives only in the page. Closing or reloading the tab discards it.
  • The EPUB is assembled in memory and offered as a blob download. The tool writes nothing to localStorage or IndexedDB, and there is no draft to recover after a reload.
  • Opening the page loads the site scripts and styles, and the shared analytics tag sends a page-view request. None of those requests includes the text or the file.
  • Try sample Markdown loads an example string that is already inside the page script, so pressing it makes no request; nothing about your own text is involved.
  • The output is not checked with EPUBCheck or any validator. A successful download means the archive was built and offered, not that every reading system will accept it.
  • Nothing is added beyond title, author, language, chapters and a generated identifier and timestamp: no cover, publisher, series, description or reading-order metadata beyond the spine.

A little more detail

Frequently asked questions about Markdown to EPUB

How should I prepare YAML front matter and a manuscript title?

Do not assume that front matter from a writing app becomes EPUB metadata automatically. Enter the intended title, author and language in this page’s metadata fields, then inspect the rendered preview for any source front matter that should not appear as prose. Check the selected split level too: a single manuscript title should not accidentally become the only detected chapter.

Does it split on ## as well as #?

It splits on exactly one level at a time, chosen in the Split on menu: # heading for level one or ## subheading for level two. Level one ignores ## lines, and level two ignores # lines. Headings at level three and deeper never start a chapter; they stay inside the current chapter as h3 to h6. If no line matches, the whole text becomes a single chapter, shown as no heading (whole text) and titled Chapter in the export.

Why did a line inside my code block become a chapter?

The splitter runs before Markdown parsing and looks for a hash at the start of a line; it does not track fenced code. A shell comment such as # install inside a fenced block therefore matches at level one, and the chapter is cut in the middle of the fence. The preview shows the damage: the first chapter ends with an empty code element. Change the comment, raise the split level, or untick the false chapter and keep the rest.

Will my images be included in the EPUB?

No image is packaged. A remote https image keeps its src, so an online reader may fetch it, but the book itself contains only a link. A relative path such as pics/map.png loses its src during sanitizing because the page cannot resolve it against the folder the .md file came from. A base64 data:image is the one form that travels inside the XHTML, at the cost of a much larger chapter file. No images folder or manifest entry is written.

Can I use tables, task lists and footnotes?

Tables, fenced code, strikethrough and autolinks work: marked runs with GFM enabled and the preview shows them. Task lists are partial: the checkbox input is forbidden by the sanitizer, so the item text survives with the box removed. Footnotes are not supported: a marker such as [^1] and its definition stay as literal text with no link and no endnote page. Raw HTML is kept when DOMPurify allows the tag, but script, style, frames and form controls are removed.

Is the EPUB checked or validated?

No. The page builds the archive and offers it as a download; it does not run EPUBCheck or any other validator and does not report schema errors. The structure follows EPUB 3: a stored mimetype first, container.xml, an OPF package, nav.xhtml, toc.ncx, a stylesheet and one XHTML file per included chapter. Unzipping the file is the quickest way to confirm that the chapters, contents and metadata are what you expected.

Is my writing uploaded, and does it work offline?

Nothing is uploaded. The file is read with the browser File API and the EPUB is assembled in memory; no request carries the text. The page does load its scripts, styles and the site-wide analytics tag, so the first visit needs a network connection. Once those are cached the tool keeps working, including Try sample Markdown, whose three-chapter example is a string in the page script rather than a fetched file. Closing the tab discards the text and the chapter list.

Can I control the cover, fonts or stylesheet?

No. The writer adds a fixed book.css and no cover, font, template or per-book style control. Raw HTML and inline style attributes that survive DOMPurify can change how a passage looks, but there is no setting for page margins, typefaces or a cover image. A book that needs those belongs in Sigil or Calibre’s editor after export; rebuilding it here later would discard those edits.

Can I reorder chapters in the list?

No. The chapter order follows the order of the heading lines in the text; there is no drag handle and no move button. Excluding a row removes it from the spine and both contents lists, but to move a chapter you edit the Markdown, paste or load it again and press Review chapters. Renaming a row changes its title everywhere without changing its position.