HTML to Markdown
Convert HTML snippets to clean Markdown. Headings, links, lists, code blocks — all converted automatically.
About the HTML to Markdown Converter
Converting HTML to Markdown is useful when migrating content from a CMS to a static site generator, from web pages to README files, or to Markdown-based platforms like GitHub, Notion, or Obsidian. Markdown is cleaner, more portable, and easier to version-control in Git than HTML.
What converts cleanly and what does not
- Converts well — headings (h1-h6), paragraphs, bold, italic, unordered and ordered lists, links, images, blockquotes, inline code, and fenced code blocks.
- Lossy conversion — tables (supported in GitHub Flavoured Markdown), inline styles, and CSS classes lose their styling information.
- Dropped entirely — <script>, <style> blocks, form elements, and non-semantic <div>/<span> wrappers have no Markdown equivalent.
Common workflow
Copy HTML from a browser's View Source (Ctrl+U) or DevTools Elements panel, paste into this converter, and get clean Markdown. For best results, copy only the article body rather than the full page HTML including navigation, sidebars, and footer markup.
Markdown for documentation and wikis
Static site generators (Jekyll, Hugo, Eleventy, Astro) use Markdown as their content format. Documentation platforms (GitBook, Docusaurus, MkDocs) do the same. When migrating existing HTML documentation to one of these platforms, converting HTML to Markdown is a necessary first step. This tool handles the bulk conversion; manual cleanup of complex layouts is usually needed afterwards.
- Jekyll/Hugo sites — post content is written in Markdown; templates handle HTML wrapping
- GitHub wikis — entirely Markdown-based; paste converted content directly
- Docusaurus/MkDocs — documentation sites use .md files; conversion lets you migrate existing HTML docs
- Obsidian notes — convert web articles to Markdown for local storage in your personal knowledge base
Frequently Asked Questions
pip install markdownify then from markdownify import markdownify as md; result = md(html_string). For more control, pandoc is the most capable tool: pandoc -f html -t markdown input.html -o output.md.