RevealTheme logo

HTML to Markdown

Paste a snippet of HTML and get a quick Markdown approximation. This is a lightweight regex-based converter for common inline and block elements, not a full HTML parser.

# Title

Some **bold** text.

How to use this tool

  1. 1

    Paste or type your HTML into the input textarea.

  2. 2

    Watch the Markdown output update live in the gray panel below as you edit.

  3. 3

    Select the converted Markdown and copy it into your editor or content file.

  4. 4

    Spot-check the result and hand-fix anything the converter dropped, such as images or tables.

How does this HTML to Markdown converter actually work?

Markdown is a plain-text formatting syntax (popularized by John Gruber in 2004) that maps a small set of symbols to HTML: # for headings, ** for bold, * for italic, - for list items, and [text](url) for links. This tool runs the reverse mapping, but it does so with a handful of regular expressions rather than a real DOM parser. It rewrites <h1>, <h2>, and <h3> tags into #, ##, and ### prefixes, converts <strong> to **, <em> to *, turns each <li> into a leading dash, unwraps <p> tags into blank-line-separated blocks, and matches anchors of the exact form <a href="...">text</a>. Any remaining tags are simply stripped. Because it is regex-driven, it has real blind spots: it does not produce Markdown for images, tables, code blocks, blockquotes, h4 through h6, or ordered lists, and it cannot handle nested lists or attributes in an unexpected order. Links only convert when the href uses double quotes and the link text contains no inner tags. Treat the output as a fast first draft, then clean up by hand or move to a parser-based library like Turndown for production migrations.

Common use cases

  • Quickly turn a copied HTML paragraph from a web page into Markdown for a README or blog post.

  • Draft Markdown documentation from small HTML snippets without installing a Node toolchain.

  • Strip the tag soup out of pasted rich text down to clean headings, bold, and links.

  • Prototype a content migration to see roughly how an HTML article maps to Markdown before scripting it.

  • Convert a simple HTML bulleted list into Markdown dashes for a checklist or issue body.

  • Teach or demonstrate the relationship between HTML elements and their Markdown equivalents.

Frequently asked questions

Does this convert images or tables?
No. The converter only handles headings (h1-h3), bold, italic, links, list items, and paragraphs. Images, tables, code blocks, blockquotes, and h4-h6 are not mapped to Markdown — image and table tags are stripped out entirely, so you will need to add them back manually.
Why did my link not convert?
Anchor conversion uses a strict pattern that only matches links written as <a href="url">text</a> with double-quoted hrefs and plain text inside. If the href uses single quotes, the attributes are in a different order, or the link text contains nested tags, the anchor tag is stripped and only the text remains.
Does it handle ordered or nested lists?
No. Every <li> becomes a leading dash, so ordered (<ol>) lists come out as unordered bullets and numbering is lost. Nested lists are flattened because there is no indentation logic.
Is my HTML uploaded to a server?
No. The conversion runs entirely in your browser with JavaScript as you type. Nothing is sent over the network, uploaded, or stored, so you can safely paste private or internal content.
Why is the output messy for complex pages?
This is a regex converter, not a real HTML parser, so it does not understand document structure. Malformed markup, unusual attribute orders, and elements it does not recognize get stripped or left as leftover text. For full pages with mixed content, expect to do manual cleanup.
What should I use for a large production migration?
For converting many documents or complex HTML reliably, use a parser-based tool such as Turndown (JavaScript) or Pandoc. They build a proper DOM and support images, tables, code blocks, and nested lists that this lightweight tool intentionally skips.

Related tools