Convert HTML to Markdown format with customizable options
Convert HTML to Markdown instantly with our free online HTML to Markdown converter. This tool helps developers and content creators transform HTML code into clean Markdown syntax for documentation and content management. Simply paste your HTML and get Markdown output in real-time.
Convert HTML to clean, readable Markdown format. Perfect for converting web content, documentation, or HTML emails to Markdown.
HTML to Markdown conversion transforms HTML content into clean Markdown syntax. This is useful for migrating content from HTML-based systems to Markdown-based platforms, creating editable content from web pages, or simplifying HTML for documentation.
The converter parses HTML DOM, identifies semantic elements, and outputs Markdown equivalents. <h1> becomes #, <strong> becomes **, <a> becomes [text](url), <ul><li> becomes - items. Complex HTML may require lossy conversion or custom handling.
Conversion maps: headings to # syntax, emphasis to */** markers, links to []() syntax, images to ![]() syntax, lists to -/* or 1. prefixes, code to backticks or fenced blocks. Nested formatting, tables, and non-standard HTML require special handling.
Convert CMS HTML content to Markdown files.
<h1>Title</h1><p>Text</p> → # Title\n\nTextExtract readable Markdown from web pages.
Convert HTML emails to Markdown for archiving.
Save rich editor content as Markdown.
const TurndownService = require('turndown');
const turndown = new TurndownService({
headingStyle: 'atx', // # style headers
codeBlockStyle: 'fenced' // ``` style code
});
const html = '<h1>Hello</h1><p>World <strong>bold</strong></p>';
const markdown = turndown.turndown(html);
// # Hello\n\nWorld **bold**
// Add custom rule
turndown.addRule('strikethrough', {
filter: ['del', 's'],
replacement: (content) => '~~' + content + '~~'
});Turndown is the most popular HTML-to-Markdown converter. Supports custom rules for special elements.
from markdownify import markdownify as md
html = """
<h1>Hello World</h1>
<p>This is <strong>bold</strong> and <em>italic</em>.</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
"""
markdown = md(html, heading_style='ATX', bullets='-')
# # Hello World
#
# This is **bold** and *italic*.
#
# - Item 1
# - Item 2markdownify provides simple conversion with configurable options for different Markdown styles.
Use HTML to Markdown when migrating content to Markdown-based systems, extracting readable content from web pages, or converting WYSIWYG editor output to Markdown format.
Complex tables (use GFM tables where possible), forms, iframes, scripts, custom elements, and heavily styled content. Some converters output raw HTML for unsupported elements.