DataHub Tools HTML to Markdown

HTML to Markdown Converter

Local-first

Convert common HTML headings, links, lists, code, and tables into Markdown.

How this tool actually works

The converter parses HTML with DOMParser and has explicit rules for headings, paragraphs, emphasis, code, links, list items, line breaks, and the first table. Unsupported structures may be flattened or omitted; this is not a high-fidelity web-page migration tool.

  • Convert common text elements
  • Convert basic links, code, and list items
  • Convert the first simple table

How to use it

  1. Paste a controlled HTML fragment rather than a complete untrusted page.
  2. Convert and compare headings, links, lists, code, and the first table.
  3. Check ordered and nested lists, images, blockquotes, scripts, styles, and merged cells manually.
  4. Edit the Markdown before publishing or importing it elsewhere.

Quick example

Example input

<h2>Guide</h2><p>Read <strong>carefully</strong>.</p><ul><li>One</li><li>Two</li></ul>

Expected result

## Guide

Read **carefully**.

- One
- Two

Ordered lists currently become unordered items, nested lists are flattened, and unsupported elements such as images and blockquotes can be lost.

Best use cases

  • Convert a simple article fragment into a Markdown draft.
  • Extract readable text structure from controlled HTML.
  • Prepare basic headings, paragraphs, links, and lists for editing.

References and scope

HTML and CommonMark have different content models. Browser error recovery can also repair malformed HTML before conversion, so output may differ from source markup.

Sources checked July 24, 2026. Specifications and platform behavior can change; verify the sources before formal use.

Known limitations

  • script, style, template, and noscript nodes are excluded.
  • Only the first table receives dedicated table conversion.
  • rowspan and colspan are expanded before Markdown table output but merged-cell semantics are flattened.

FAQ

Does it preserve every HTML element?

No. It handles a documented basic subset and drops or flattens unsupported structures.

Are ordered lists preserved?

No. Current list items are emitted as unordered Markdown bullets.

Are images converted?

No. The current explicit conversion rules do not preserve image syntax.

Does invalid HTML always produce an error?

No. DOMParser often repairs malformed HTML before the converter sees it.