HTML to Markdown Converter
Convert HTML back into Markdown. Paste markup copied from a page, exported from a CMS, or produced by a rich-text editor, and get readable Markdown out. Heading style, bullet marker, and code block format are all adjustable, so the output matches whatever conventions your project already uses.
Text Tools
Private by default
This tool runs entirely in your browser. Your data is never uploaded to a server.
How it works
How elements are mapped
Each HTML element is matched to its closest Markdown equivalent, and anything without one is passed through as HTML. Script and style elements are removed entirely, since their contents are code rather than prose and would otherwise land in the output unquoted.
- Nested lists keep their nesting, indented by the width of the bullet marker.
- A link with no href becomes plain text — Markdown has no syntax for an anchor without a destination.
- Whitespace inside pre is preserved; whitespace elsewhere is collapsed, matching how the browser renders it.
- Markdown special characters in the text — asterisks, underscores, backticks — are escaped so they survive as literal characters.
For reference
What each element becomes
| HTML | Markdown |
|---|---|
| <h2>Title</h2> | ## Title |
| <strong>bold</strong> | **bold** |
| <em>italic</em> | *italic* |
| <a href="/x">text</a> | [text](/x) |
| <code>inline</code> | `inline` |
| <blockquote><p>q</p></blockquote> | > q |
| <table>…</table> | Kept as raw HTML |
Markdown has no table syntax in its original specification. GitHub Flavored Markdown adds one, but converting to it would guess at column alignment, so tables are passed through untouched.
How to use
4 clear steps.
Paste the HTML into the input.
Choose the heading style, bullet marker, and code block format.
Read the Markdown output.
Copy it into your editor or repository.
Good to know
Frequently asked questions
- What happens to HTML that Markdown cannot express?
- It is kept as raw HTML, which is valid inside a Markdown document. Tables, iframes, and custom elements come through this way rather than being approximated or dropped.
- Are classes and inline styles preserved?
- No. Markdown has no way to express them, so attributes carrying presentation — class, style, data-* — are dropped rather than guessed at. The text and its structure survive; the styling does not.
- Which heading style should I choose?
- ATX — the # form — for almost everything. It works at all six levels, and setext underlining only exists for levels one and two, so a document that mixes them looks inconsistent.
- Is this the reverse of the Markdown Preview tool?
- Yes, roughly. Markdown Preview renders Markdown to HTML; this goes the other way. A round trip will not be byte-identical, because both directions have choices to make about whitespace and emphasis characters.