HTML to Markdown Converter
Paste raw HTML or rich text and get clean, spec-compliant Markdown back instantly — headings, links, GFM tables, task lists, and code blocks preserved. Everything runs in your browser; the HTML never leaves your device. No signup, no ads.
How it works
The converter is a pure, deterministic transform: the same HTML and the same options always produce the same Markdown. There is no AI, no server, and no network call. Conversion happens in four steps.
- Parse.Your pasted string is parsed to a DOM tree with the browser's native
DOMParserintext/htmlmode. This tolerates malformed or partial HTML the same way a browser tab would, so you can paste a fragment without a full document wrapper. - Sanitise. When the Sanitize option is on,
<script>,<style>,<iframe>and inline event handlers are removed, and dangerous URL protocols likejavascript:are stripped from links. Nothing executable can survive into the output. - Walk and map. The tool traverses the DOM depth-first and maps each node to CommonMark 0.31.2:
<h1>–<h6>to ATX#headings (§4.2),<strong>to**bold**(§6.4),<a>to[text](url)(§6.6),<ul>/<ol>to lists (§5.2–5.3),<pre><code>to fenced code (§4.5), and<blockquote>to>quotes (§5.1). Text is escaped so stray Markdown delimiters render literally — with one nuance: an underscore inside a word (likesnake_case) is left alone, because CommonMark §6.2 already treats intraword_as literal. - GFM extensions. With GFM extras on,
<table>becomes a pipe table with a| --- |delimiter row,<del>becomes~~strikethrough~~, and a checkbox inside a list item becomes a- [x]task list item.
The element count under the output is verified two independent ways — once by walking the parsed DOM and once by scanning the raw HTML with regular expressions. When both agree, the summary shows “cross-checked by 2 methods,” the same reconciliation approach used across the site's converters. The rendered preview then re-renders the produced Markdown back to HTML as a round-trip sanity check.
Worked examples
Frequently asked questions
Sources & references
- CommonMark Specification 0.31.2 — canonical Markdown syntax
- GitHub-Flavored Markdown Spec — tables, task lists, strikethrough
- WHATWG HTML Living Standard — element semantics and the table model
- MDN — DOMParser (native in-browser HTML parsing)
The mapping rules and spec citations were last cross-checked against the CommonMark and GFM specifications on 2026-07-10. The page is reviewed whenever either specification is amended.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.