Everything runs locally in your browser. Your HTML is parsed on-device and never uploaded.
HTML to Markdown converter
Paste HTML on the left and get clean, portable Markdown on the right: headings, links, lists, tables and code blocks, all converted in your browser.
Output targets GitHub Flavored Markdown. Whitespace is collapsed and presentational tags such as <span> and <div> are unwrapped, so the result stays clean and portable. Review code-heavy or deeply nested markup before publishing, since merged table cells and non-semantic layouts have no exact Markdown equivalent.
What the HTML to Markdown converter does
Paste any HTML (a snippet copied from a web page, an email, a CMS field or an exported document), and this tool rewrites it as clean, portable Markdown. It reads the structure of your markup and maps each element to its Markdown equivalent: headings become number signs, <strong> and <em> become asterisks and underscores, links and images keep their targets, lists and tables are rebuilt with Markdown syntax, and <pre><code> blocks are fenced with triple backticks.
<h1>–<h6>→ headings<strong>/<em>→ bold and italic<a>/<img>→ links and images<code>→ inline code<pre><code>→ fenced code blocks<ul>/<ol>→ bullet and numbered lists<blockquote>/<hr>→ quotes and rules<table>→ GFM pipe tables
Why convert HTML to Markdown?
Markdown is the lingua franca of documentation. READMEs, static-site content, wiki pages, chat messages and note-taking apps all speak it, and it stays readable as plain text long after any styling is gone. Converting HTML to Markdown is the quickest way to move content out of a rich-text editor or an old CMS and into a Git repository, an Obsidian vault or a Jekyll, Hugo or Astro site, without dragging along a tangle of nested <div> wrappers and inline styles.
How the conversion works
The converter uses the browser's native DOMParser to turn your text into a real document object model. DOMParser builds the tree without executing scripts, so pasting untrusted HTML is safe: <script> and <style> tags are skipped, and only text and structural elements are read. The tool then walks that tree recursively, collapsing the runs of whitespace that HTML ignores and emitting Markdown block by block. Everything happens on your device; no request ever leaves the page.
Tips for clean Markdown
Feed the converter semantic HTML for the best results. Use real heading tags rather than bold paragraphs, wrap code in <pre><code> so it becomes a fenced block instead of a run-on line, and give tables a single <thead> row so the alignment separator lands in the right place. Presentational-only wrappers such as <span> and <font> are unwrapped automatically, but merged table cells and deeply nested layouts have no Markdown equivalent and will be flattened. Check those by hand before you publish.
Frequently asked questions
Does this HTML to Markdown converter work offline?
Yes. The entire tool runs in your browser with vanilla JavaScript and the native DOMParser. Nothing is sent to a server, so once the page has loaded you can convert HTML to Markdown with no internet connection and no data ever leaving your device.
Which HTML elements are supported?
Headings (h1–h6), paragraphs, bold and italic, inline code and fenced code blocks, links and images, ordered and unordered lists including nested ones, blockquotes, horizontal rules, line breaks and tables. Unknown or purely presentational tags such as span and div are unwrapped so their text survives.
Is it safe to paste HTML from an untrusted source?
Yes. The converter parses your HTML with DOMParser, which builds a document without executing any scripts, and it only reads the resulting DOM to emit text. Script and style tags are skipped entirely, so pasted markup is never run as live code.
What flavour of Markdown does it output?
It targets GitHub Flavored Markdown (GFM). Tables use pipe syntax with an alignment row, code blocks are fenced with triple backticks, and strikethrough uses double tildes, all of which render correctly on GitHub, in most static site generators and in editors like Obsidian and VS Code.
Why does my table lose its formatting?
Markdown tables are far simpler than HTML ones. Merged cells (colspan/rowspan), nested tables and block content inside a cell cannot be represented, so complex tables are flattened to plain rows. For predictable results, use a single header row and keep each cell to inline text.