HTML to Markdown Converter

Moving a WordPress article into Hugo, archiving a Confluence page as notes, or cleaning up a rich-text email for a docs wiki all mean converting HTML into Markdown. This converter maps headings, paragraphs, lists, links, images and code blocks to their Markdown equivalents, so the content keeps its structure without the HTML baggage.

How to convert HTML to Markdown

  1. 1

    Paste HTML

    Full pages, rich-text email bodies, or snippets: all are parsed.

  2. 2

    Convert

    Headings, paragraphs, lists, links, images and code blocks are mapped to Markdown.

  3. 3

    Copy the Markdown

    Drop the output into Obsidian, Hugo, Jekyll, Notion or a Git repo.

Mapping HTML into Markdown

The converter walks the DOM and emits Markdown for each recognised element. Wrapper tags such as <div>, <span>, <section> and <article> are dropped and their content is kept at the correct nesting level.

Element mapping

HTML Markdown output
<h1> through <h6> # to ###### headings
<strong>, <b> **text**
<em>, <i> *text*
<code> inline `text`
<pre><code> triple-backtick fenced block, with language if set
<a href> [text](url)
<img src alt> ![alt](src)
<ul><li> - item
<ol><li> 1. item
<blockquote> > quote
<hr> ---

What happens to the rest

Markdown cannot express every HTML element. Tags without a Markdown equivalent are dropped and only their text content is kept:

  • <table>: the text inside the cells survives, but the table grid is lost. Use a table-aware converter when the structure matters.
  • <del>, <u> and other inline styling: the text survives, the styling does not.
  • <video>, <audio>, <iframe>: these embeds produce nothing renderable in Markdown.
  • <details> / <summary>: the text inside is kept, the disclosure widget is not.

For lossless round-trips, convert from the original Markdown source rather than from rendered HTML.

Frequently Asked Questions

Plain <div> and <span> wrappers are dropped and their content emitted at the correct nesting level. Layout-only divs become invisible in Markdown, which is usually what you want for docs.

Yes. <pre><code class="language-js"> becomes a fenced block with js as the language hint. Indented code blocks without a language fall back to plain fenced blocks.

The text inside <table> cells is kept, but the grid itself is not: rows and columns are not preserved, so the layout is lost. Use a table-aware converter when the structure matters.

Almost, but subtle formatting (reference-style links, hard line breaks with two trailing spaces, alternative emphasis markers) may normalise. For lossless round-tripping, keep the original Markdown.

Related Tools

Tool available in other languages