HTML to Markdown Converter
Convert HTML into clean, readable Markdown — preserving headings, links, images, lists, and tables.
Last updated: March 25, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HTML to Markdown Converter?
Markdown is a lightweight text formatting language created by John Gruber in 2004, designed to be readable as plain text while converting to valid HTML when rendered. It is now the de facto standard for developer documentation, README files, pull request descriptions, wiki pages, and static site generators (Jekyll, Hugo, Eleventy, Astro). The most widely supported variant is GitHub Flavored Markdown (GFM), which adds tables, fenced code blocks, strikethrough, and task lists.
Converting HTML to Markdown is a common need when migrating content: moving a WordPress blog to a Markdown-based CMS, converting a web-scraped article into a format for a documentation site, exporting Google Docs HTML to a Git repository, or archiving web content for long-term readability. Pure HTML is verbose and difficult to edit directly; Markdown is compact, readable, and version-control-friendly. This tool converts all standard HTML elements — headings, emphasis, links, images, ordered/unordered lists, tables, blockquotes, and code blocks — to their Markdown equivalents.
How to Use HTML to Markdown Converter
Paste your HTML code (or a full web page excerpt) into the left "HTML Input" pane
The Markdown output updates instantly in the right pane as you type or paste
Toggle "GitHub Flavored Markdown" on if your target platform supports GFM (tables, strikethrough, task lists)
Check the generated Markdown for any complex HTML that could not be automatically converted (shown as preserved HTML)
Click "Copy Markdown" to copy to clipboard, or "Download .md" to save it as a Markdown file
Common Use Cases
- Migrating WordPress blog post content into a Next.js MDX or Contentful Markdown CMS
- Converting scraped article HTML into clean Markdown for a documentation knowledge base
- Transforming Google Docs exported HTML into Markdown for a project's Git repository README
- Converting email newsletter HTML into Markdown format for archiving in a text-readable format
- Migrating legacy CMS content (Drupal, Joomla) into a modern Gatsby or Astro static site
- Converting StackOverflow answers (copy HTML) into Markdown for internal wiki documentation
- Transforming a Bootstrap-era HTML page into clean Markdown as the first step in a redesign
- Extracting and converting the body HTML from email to Markdown for clean documentation
Example Input and Output
Converting a simple HTML article excerpt to GFM Markdown:
<h2>Getting Started with CSS Grid</h2>
<p>CSS Grid is a <strong>two-dimensional</strong> layout system.
Learn more at <a href="https://css-tricks.com/snippets/css/complete-guide-grid/">CSS-Tricks</a>.</p>
<ul>
<li>Define <code>display: grid</code> on a container</li>
<li>Use <code>grid-template-columns</code> to set columns</li>
</ul>
<blockquote>
<p>Grid is the first CSS module created specifically to solve layout problems.</p>
</blockquote>## Getting Started with CSS Grid
CSS Grid is a **two-dimensional** layout system.
Learn more at [CSS-Tricks](https://css-tricks.com/snippets/css/complete-guide-grid/).
- Define `display: grid` on a container
- Use `grid-template-columns` to set columns
> Grid is the first CSS module created specifically to solve layout problems.Client-Side Processing
HTML parsing and Markdown generation run entirely in your browser using a JavaScript HTML parser and Markdown serializer. Your content is never sent to a server.
For CMS Migrations
When migrating a large number of blog posts from WordPress or Drupal, consider using the WordPress REST API or WP-CLI to export post HTML content programmatically, then running each through a Node.js turndown script (the same library used here) in batch. Do not manually paste hundreds of posts.
WYSIWYG Editor Integration
Many WYSIWYG editors (TipTap, Quill, ProseMirror, TinyMCE) output HTML internally. If your CMS requires Markdown storage, place this conversion step in your content pipeline: WYSIWYG → HTML → Markdown conversion via a library like Turndown.js → stored as .md file. Do not rely on regex-based HTML-to-Markdown conversion for production pipelines.
Frequently Asked Questions
What HTML tags can be converted to Markdown?
What is GitHub Flavored Markdown (GFM)?
What happens to CSS styles in the HTML?
Can I convert a full webpage?
What is the difference between HTML to Markdown and Markdown to HTML conversion?
Will the converter handle nested lists?
How This Tool Works
The HTML input string is parsed by the browser's native DOMParser() (DOMParser.parseFromString(html, 'text/html')), producing a real DOM tree. The converter then performs a depth-first traversal of this DOM tree, visiting each element and applying a rule set to serialize it to its Markdown equivalent. Heading tags map to # prefixes, <strong> maps to **, anchor tags serialize their href, list items recurse for nesting depth. The final Markdown string is assembled during the traversal and displayed in real time as the user types.
Technical Stack