Markdown to EPUB Converter
Transform markdown documents into professional EPUB3 ebook files ready for publishing. Generates proper book structure, table of contents, metadata, and styling—perfect for self-publishing, documentation, or distributing written content.
Perfect for authors, technical writers, documentarians, and anyone wanting to convert markdown content into professional ebook format.
Core Features
EPUB Generation
Markdown Processing:
- Parse headers, lists, code blocks, tables
- Handle links, images, and formatting
- Escape HTML characters safely
- Preserve document structure
Book Structure:
- Automatic table of contents from headers
- Chapter detection and organization
- Proper XHTML 1.1 formatting
- UTF-8 encoding throughout
Metadata Support:
- Title, author, language
- ISBN, publisher, date
- Description and subjects
- Rights and contributors
Styling & Layout:
- Professional typography
- Code syntax highlighting
- Responsive tables
- Mobile-friendly formatting
How It Works
Input: Markdown document
# My Book Title
## Chapter 1: Introduction
This is the opening chapter with **bold** text
and *italic* emphasis.
### Section 1.1
Some content with a [link](https://example.com).
## Chapter 2: Deep Dive
More content with code:
```python
def hello():
print("Hello, world!")
```
Output: EPUB3 file
- Properly formatted chapters
- Table of contents with links
- Embedded metadata
- Professional styling
- Valid EPUB structure
Usage Examples
Convert from markdown file:
Convert my document.md to EPUB format with:
- Title: "Complete Python Guide"
- Author: "Jane Developer"
- Language: English
Convert from raw text:
Turn this markdown into an EPUB:
# The Art of Code Review
## Introduction
[paste your markdown content]
With custom metadata:
Create EPUB from README.md with metadata:
- Title: Project Documentation
- Author: Engineering Team
- Publisher: Acme Corp
- Date: 2024-10-24
EPUB Structure
Generated file contains:
book.epub/
├── META-INF/
│ └── container.xml # Points to content.opf
├── OEBPS/
│ ├── content.opf # Package metadata
│ ├── toc.ncx # Navigation control
│ ├── stylesheet.css # Book styling
│ ├── chapter001.xhtml # Chapter 1
│ ├── chapter002.xhtml # Chapter 2
│ └── images/ # Embedded images
└── mimetype # EPUB identifier
Markdown Support
Headings:
# Chapter (becomes chapter break)
## Section (becomes ToC entry)
### Subsection
Text Formatting:
**Bold text**
*Italic text*
***Bold and italic***
`Inline code`
Links:
[Link text](https://example.com)
[Internal link](#section-id)
Images:

Code Blocks:
```python
def example():
return "Syntax highlighting preserved"
```
Lists:
- Unordered list item
- Another item
- Nested item
1. Ordered list
2. Second item
Tables:
| Header 1 | Header 2 |
|----------|----------|
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |
Metadata Configuration
Required metadata:
title: "Book Title"
author: "Author Name"
language: "en" # ISO 639-1 code
Optional metadata:
isbn: "978-3-16-148410-0"
publisher: "Publisher Name"
date: "2024-10-24" # ISO 8601 format
description: "Book description for readers"
subjects: ["Technology", "Programming"]
rights: "© 2024 Author Name. All rights reserved."
contributors: ["Editor Name", "Illustrator Name"]
Table of Contents
Auto-generated from headers:
Table of Contents
├─ Chapter 1: Introduction
│ ├─ 1.1 Background
│ └─ 1.2 Objectives
├─ Chapter 2: Getting Started
│ ├─ 2.1 Installation
│ └─ 2.2 Configuration
└─ Chapter 3: Advanced Topics
├─ 3.1 Best Practices
└─ 3.2 Troubleshooting
Styling Options
Default styling includes:
- Readable serif font for body text
- Monospace font for code blocks
- Appropriate line spacing
- Responsive image scaling
- Professional code block formatting
- Clean table styling
Customizable:
- Font families
- Color schemes (ensure e-ink compatibility)
- Spacing and margins
- Code highlighting themes
E-Reader Compatibility
Tested on:
- Amazon Kindle (via KDP)
- Apple Books
- Google Play Books
- Kobo e-readers
- Calibre
- Adobe Digital Editions
EPUB3 Standard:
- Full compliance with IDPF specification
- Passes EPUBCheck validation
- Accessible to screen readers
- Reflowable content for all screen sizes
Publishing Workflow
1. Write in Markdown
Use any markdown editor:
- VS Code
- Obsidian
- Typora
- Plain text editor
2. Convert to EPUB
Generate EPUB with proper metadata
3. Validate
Check with EPUBCheck tool
Test on target e-readers
4. Publish
Upload to:
- Amazon KDP (Kindle)
- Apple Books
- Google Play Books
- Smashwords
- Self-hosted distribution
Common Use Cases
Technical Documentation:
- API reference guides
- User manuals
- Developer handbooks
- Architecture documentation
Self-Publishing:
- Fiction novels
- Non-fiction books
- Short story collections
- Poetry compilations
Educational Content:
- Course materials
- Study guides
- Textbook supplements
- Training manuals
Internal Distribution:
- Company handbooks
- Process documentation
- Meeting notes archives
- Research reports
Best Practices
For Best Results:
- ✅ Use semantic heading hierarchy (h1, h2, h3)
- ✅ Include descriptive alt text for images
- ✅ Test on multiple e-readers
- ✅ Validate with EPUBCheck
- ✅ Keep file size reasonable (under 50MB)
- ✅ Optimize images before embedding
Avoid:
- ❌ Skipping heading levels (h1 to h3)
- ❌ Using HTML when markdown suffices
- ❌ Very large image files
- ❌ Complex table nesting
- ❌ Absolute positioning or fixed layouts
- ❌ Custom fonts without licensing
Image Handling
Supported formats:
- PNG (preferred for diagrams)
- JPEG (preferred for photos)
- GIF (basic support)
- SVG (limited e-reader support)
Optimization:
- Resize to reasonable dimensions (max 1200px width)
- Compress images appropriately
- Use web-optimized formats
- Consider e-ink display limitations
Advanced Features
Chapter Breaks:
# Chapter 1: Beginning
Content here...
---
# Chapter 2: Continuing
Next chapter starts here...
Frontmatter:
# Title Page
**Book Title**
*by Author Name*
---
# Copyright
© 2024 Author. All rights reserved.
---
# Dedication
For my readers...
---
# Chapter 1: Story Begins
Footnotes:
This is a statement[^1].
[^1]: This is the footnote explanation.
About This Skill
This skill was created by smerchek for writers and publishers.
Philosophy: Markdown is perfect for writing—focused, distraction-free, version-controllable. EPUB is perfect for reading—portable, accessible, professional. This skill bridges the gap, letting you write in markdown and publish in EPUB.
Standards: Generates valid EPUB3 files following IDPF specifications with proper XHTML 1.1 structure and UTF-8 encoding.
Converts markdown documents into professional EPUB3 ebook files with proper structure, styling, table of contents, and metadata for publishing or distribution.