🔄 HTML to Markdown Converter
Convert HTML code snippets, articles, and rich text to clean GitHub-flavored markdown with code fences, headers, blockquotes, and lists.
Parsed with the browser’s own HTML parser, so entities decode, attribute order does not matter, and nested lists survive. Nothing is uploaded.
What HTML to Markdown Converter Does
Converting HTML to Markdown is mostly about deciding what to throw away. Markdown has perhaps a dozen constructs; HTML has hundreds of elements and unlimited attributes. Everything that does not map has to be dropped, flattened or inlined, and different converters make different choices.
The choices that are not optional are the ones about correctness. Entities must be decoded, or "&" ends up in your Markdown as four literal characters. Text must be escaped, or a product name containing an asterisk turns into italics. And attribute order must not matter, which sounds obvious until you meet a converter built from regular expressions, where an image written with alt before src silently loses its alt text.
This one parses the HTML with the browser's own parser and walks the resulting tree, which is why nested lists, emphasis inside links and tables all survive. A regex-based converter cannot handle any of those, because regular expressions cannot match balanced tags.
What it will not do is invent structure. If the source is a wall of divs with styling instead of headings and lists, the Markdown will be a wall of paragraphs, because the semantics were never there to convert.
How to Use HTML to Markdown Converter
- Paste your raw HTML code into the input editor
- Watch the clean Markdown output generate instantly on the right
- Click Copy Markdown to copy to your clipboard
Formula Used by HTML to Markdown Converter
The mapping
h1–h6 → # … ###### · strong/b → ** · em/i → * · a → [text](href) · img →  · ul/ol → - and 1. · blockquote → > · pre/code → ``` · table → GFM pipe table
- escaping
- backslash, backtick, asterisk, underscore, brackets, parentheses, hash, plus, hyphen, exclamation, pipe and > in body text
- not escaped
- the contents of code and pre, which are literal by definition
Worked example
<p>Ben & Jerry’s sell 5 * 3 flavors</p>
- The parser decodes & to & and ’ to a curly apostrophe
- The asterisk in the body text is escaped to \*, so it stays an asterisk
Result: Ben & Jerry’s sell 5 \* 3 flavors — which renders back as the original sentence rather than starting an emphasis run.
What survives, and what does not
| HTML | Result |
|---|---|
| Headings, paragraphs, lists, links, images | Converted directly |
| Nested lists | Converted, with indentation |
| Tables | GFM pipe tables — a Markdown extension, not core |
| Blockquotes and code blocks | Converted, with the code language preserved from a class |
| Bold and italic inside links | Converted; regex converters usually break here |
| div and span with styling | Flattened — Markdown has no equivalent |
| Classes, ids, inline styles, data attributes | Dropped |
| Forms, scripts, iframes, video | Dropped |
How to Read Your Result
Expect to edit the result
A conversion of anything real needs a pass by hand. Complex layouts, footnotes, figure captions and anything relying on CSS for meaning will need decisions no converter can make for you.
Check the flavor you are targeting
Tables come out as GitHub Flavored Markdown, which is not part of CommonMark. They render on GitHub, GitLab and most static site generators, and not everywhere. If your destination is strict CommonMark, tables will appear as literal pipes.
Escaping looks noisy and is correct
Seeing \* and \_ scattered through the output is unsettling, but each backslash is there because that character would otherwise be read as formatting. Removing them silently changes what the document says.
Limitations & Accuracy Notes
- Semantic structure only. Layout, styling and anything that depended on CSS is lost, because Markdown cannot express it.
- Definition lists, footnotes, figure captions and ruby annotations have no Markdown equivalent and are flattened.
- Tables are converted as GFM extensions; complex tables with merged cells cannot be represented at all.
- Inline HTML in the source is not passed through — it is converted or dropped.
- Very large documents are limited by browser memory, since everything is parsed in the tab.
Frequently Asked Questions
How does HTML to Markdown conversion work?
Is HTML conversion performed securely?
What happens to HTML that has no Markdown equivalent?
Are inline styles preserved?
Is my HTML uploaded?
Why does pasted content from a word processor produce messy output?
Will it convert tables?
Are links and images kept?
References & Further Reading
- CommonMark specification — The core syntax being targeted
- GitHub Flavored Markdown specification — The extension that defines the pipe tables produced here