HTML to Markdown Converter Online Free
Paste HTML and get clean Markdown instantly. Handles headings, lists, links, images, tables, code blocks, and inline formatting. Everything runs in your browser with no data sent anywhere.
Converting HTML to markdown by walking the actual DOM, not the source string
The reliable way to turn HTML into markdown is to stop treating it as text. This tool loads your markup into a detached div element using innerHTML, lets the browser’s own parser build a real DOM tree out of it, and then recurses through that tree node by node. That sidesteps the usual regex nightmare of matching nested tags, because the browser has already done the nesting for you.
Nothing leaves your machine during this process. There is no network request in the script at any point, and the conversion, the live preview, and the download all run against data sitting in your browser’s memory.
The recursive node walker
Every DOM node falls into one of two categories the walker cares about: a text node, whose content is returned directly with internal line breaks collapsed to spaces, or an element node, whose tag name decides what markdown syntax wraps its children.
innerHTML, which triggers the browser’s HTML parser and gives you a genuine element tree, error recovery included.
tagName, lowercased, is checked against roughly twenty five branches: headings become # through ######, strong and b become double asterisks, em and i become single asterisks, s and del become double tildes.
[text](url "title") construct. Code fences read the language-xxx class on a nested code element to fill in the fence’s language tag.
querySelectorAll('tr'), the first row becomes the header, and a separator row of triple dashes is generated to match the header column count exactly, including padding for rows with fewer cells.
Quote titles are inlined directly into the parenthesis, no escaping step. If your source HTML has a link title containing a double quote, the output markdown will look slightly malformed at that spot, since the converter does not currently escape quote characters inside the title string. Worth a manual check on link heavy documents pulled from a CMS.
What each tag becomes
| HTML | Markdown output |
|---|---|
| h1 to h6 | One to six hash marks, with a blank line on each side |
| strong, b | Wrapped in double asterisks |
| em, i | Wrapped in single asterisks |
| s, strike, del | Wrapped in double tildes (GFM strikethrough) |
| a | [text](href) or [text](href "title") when a title attribute is present |
| img |  |
| ul / ol | Bullet character of your choice, or a numbered list rebuilt from list position |
| blockquote | Each line prefixed with > |
| pre > code | Fenced block with the language tag pulled from the language-xxx class |
| table | Pipe-delimited GFM table with a generated header separator row |
The two output views
Plain markdown
The raw converted text, ready to paste into a README, a static site generator, or a documentation platform that accepts standard or GitHub Flavored Markdown.
Rendered preview
A lightweight regex-based renderer turns the generated markdown back into HTML so you can sanity-check the result visually. It is intentionally simpler than the DOM-based converter and exists only for a quick visual check, not as a full markdown parser.
Three checkboxes change conversion behavior directly: GitHub Flavored Markdown extensions, table conversion, and code block conversion. Turning table conversion off leaves table markup to fall through to the generic block handler, which strips the tags but keeps the cell text running together, so leave it on for anything with real tabular data. A fourth option controls whether list markers use asterisks or hyphens, which matters only for personal or team style preference since both render identically in any markdown processor.
Converters and Markdown specs
- GitHub Flavored Markdown Spec defines the table syntax and strikethrough extension this tool targets.
- MDN, Element.innerHTML explains the parsing step the converter relies on to build its DOM tree.
- Turndown is the well known npm library that does the same DOM-to-markdown conversion with a plugin system, worth knowing if you need this at build time in Node.
- John Gruber’s original Markdown syntax is the baseline spec that GFM extends.
Migration jobs this solves
Pulling a blog post out of a CMS export into a Markdown based static site, converting scraped documentation pages into README friendly text, turning an HTML email template into a plain markdown draft for editing, and stripping a page down to structured text before feeding it into a note taking app that stores everything as markdown.
FAQ: HTML to Markdown Converter Online Free
Yes. No signup, no payment, and no usage limits. The tool is free permanently.
No. All conversion happens inside your browser. Nothing leaves your device.
GFM is a Markdown extension used by GitHub, GitLab, and many documentation tools. It adds support for tables, strikethrough, task lists, and fenced code blocks with syntax highlighting.
Yes. Enable the Convert tables option to get GFM pipe table syntax with header separators and aligned columns.
Structural tags like div and section are flattened. Enable Strip remaining HTML to remove any unsupported tags and keep only plain Markdown content.
Yes. Click the Preview tab in the output panel to see a rendered version of the Markdown before downloading.
From the blog
Deep dives on the things these tools touch
Minification, UUID collisions, diffing API responses, and the other questions that come up around this toolset.