HTML to Markdown Converter
Convert HTML markup back into clean, readable Markdown syntax.
Client-Side Execution & Privacy Guarantee
This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.
HTML from CMSs, emails, or web pages often contains far more markup than a Markdown document needs. This converter walks the DOM and emits readable Markdown that preserves structure and meaning while dropping styles, classes, and scripts.
Supported constructs follow CommonMark plus GitHub Flavored Markdown extensions for tables, strikethrough, and task lists. The result is plain text you can paste into a README, wiki, or static-site source.
Element mapping
Headings h1 through h6 become ATX-style # to ######. Strong and em become ** and _. Links keep their href and text. Unordered and ordered lists retain nesting via indentation.
Simple tables become GFM pipe tables. Blockquotes, code blocks, and images are preserved. Divs and spans that carry no semantic weight are removed, leaving their text content.
What is lost or rewritten
Attributes such as class, id, style, and event handlers disappear. Colspan and rowspan in tables have no Markdown equivalent and are flattened. Relative URLs stay relative unless a base is supplied.
Inline HTML is retained only when it cannot be expressed in Markdown and is considered safe. Scripts, iframes, and form elements are stripped entirely.
Practical conversion tips
Start with clean, semantic HTML for the best result. Layout tables and deeply nested divs produce less readable Markdown. After conversion, review tables and lists for alignment and spacing.
If the source contains custom elements or complex widgets, expect them to be reduced to their text content. Use the Markdown preview tool on this site to verify rendering.
When to use this tool
- You need to turn a CMS export or email into a Markdown document.
- Documentation was written in HTML and must move to a Git repository.
- You want a readable version of a web page snippet without the surrounding markup.
- You are preparing content for a static site generator that expects Markdown.
How to use the HTML to Markdown Converter
- Paste the HTML fragment or full document into the input.
- Optionally set a base URL so relative links resolve correctly.
- Choose heading style and whether to emit GFM tables.
- Generate the Markdown.
- Copy the result and paste it into your editor or repository.
- Preview the Markdown to confirm tables and lists look correct.
Worked examples
Basic document
<h1>Notes</h1><p>A <strong>clear</strong> starting point.</p><ul><li>First</li><li>Second</li></ul><p>See <a href="https://example.com">the site</a>.</p>
# Notes A **clear** starting point. - First - Second See [the site](https://example.com).
Headings, emphasis, lists, and links convert directly.
Simple table
<table><tr><th>Item</th><th>Status</th></tr><tr><td>Draft</td><td>Done</td></tr><tr><td>Review</td><td>Open</td></tr></table>
| Item | Status | | --- | --- | | Draft | Done | | Review | Open |
A basic HTML table becomes a GFM pipe table.
Common mistakes and tips
- Remove unnecessary wrapper divs before conversion for cleaner output.
- Complex tables with merged cells will need manual adjustment after conversion.
- Always check that code blocks retain their language identifiers if present.
- If the HTML came from a rich-text editor, expect some residual spans that the converter will strip.
Frequently asked questions
Does it support GitHub Flavored Markdown tables?
Yes. Simple tables are converted to pipe tables. Merged cells are flattened.
What happens to images?
img tags become Markdown image syntax with the alt text and src preserved.
Are relative links rewritten?
Only if you supply a base URL. Otherwise they remain relative.
Can I keep some HTML?
Inline HTML that has no Markdown equivalent is retained when it is safe. Scripts and styles are removed.
Does the tool upload the HTML?
No. Conversion runs entirely in the browser.