01What is HTML to Markdown?
You have a chunk of HTML from an old CMS, a rich-text editor or a copied web page, and you want clean Markdown you can commit to Git. This converter turns pasted HTML into CommonMark, plus the two GitHub Flavored Markdown extras people use most: pipe tables and ~~strikethrough~~. The output updates as you type. Here is how it works. Your browser's own DOMParser reads the HTML into an inert document. Scripts in it never run, images never load, and nothing gets injected into the page you are looking at. The converter then walks that tree node by node. Headings become # to ######. Paragraphs get a blank line between them. <strong> and <b> turn into **bold**, <em> and <i> into *italic*, and <del> or <s> into ~~strikethrough~~. If a tag has spaces just inside it, as in <strong> word </strong>, the spaces move outside the markers, because ** word ** doesn't render as bold. Tags that Markdown has no syntax for, like <u>, <mark>, <sub>, <sup> and <kbd>, stay as inline HTML. CommonMark allows that, so they still render. Links and images keep their URL and title. A URL containing spaces or parentheses gets wrapped in angle brackets so the link doesn't break halfway. Inline code and <pre> blocks get a backtick fence longer than any run of backticks inside the code, and a language-js class becomes the fence's language tag. Lists nest to any depth, using the indentation CommonMark expects (three spaces under "1."). A start number on <ol> is kept. Tables become pipe tables, with the first row as the header and any | inside a cell escaped. A quick example: <p>Price: 5 * 3 = 15 [approx]</p> comes out as Price: 5 \* 3 = 15 \[approx\]. Those backslashes look odd, but they stop your literal asterisk and brackets from turning into emphasis or a link. Now the honest part. Merged cells (colspan and rowspan), forms and CSS layout have no Markdown equivalent, so they get flattened. Classes and inline styles are dropped. Scripts, styles and the <head> are removed entirely. The conversion happens in your tab, so the HTML you paste stays on your machine.
Developers and technical writers moving HTML content from a CMS or editor into Markdown files that live in a Git repository. The tool runs entirely in your browser, so your data never leaves your device.
02How to use HTML to Markdown
- Paste your HTML into the HTML Input box, or load one of the examples
- Read the result in the Markdown output panel, which updates on every keystroke
- Compare tables, nested lists and code blocks with the original HTML
- Click Copy Markdown and paste it into your .md file
03Worked examples
- Input:
<p>Run <code>npm i zod</code> then <strong>restart</strong>.</p> - Result:
Run `npm i zod` then **restart**. - Input:
<ul><li>One<ul><li>Nested</li></ul></li><li>Two</li></ul> - Result:
- One - Nested - Two - Nested lists are indented by two spaces per level.
- Input:
<table><tr><th>Name</th><th>Port</th></tr><tr><td>HTTP</td><td>80</td></tr><tr><td>HTTPS</td><td>443</td></tr></table> - Result:
| Name | Port | | --- | --- | | HTTP | 80 | | HTTPS | 443 | - Tables become GitHub-flavoured Markdown tables, with the header row taken from the <th> cells.
- Input:
<p>Price: 5 * 3 = 15 [approx]</p> - Result:
Price: 5 \* 3 = 15 \[approx\] - Characters Markdown would read as formatting are escaped, so the text renders exactly as written.
- Input:
<pre><code class="language-js">const a = 1;</code></pre> - Result:
```js const a = 1; ``` - The language-js class becomes the fence's language tag, so syntax highlighting survives.
04Common use cases
- Moving posts out of a WordPress or other HTML-based CMS into an Astro, Hugo or Docusaurus content folder
- Converting the HTML saved by a rich-text editor such as TipTap, Quill or CKEditor into Markdown before storing it in a repo
- Turning an HTML table of ports, endpoints or config keys into a GFM table for a README
- Pasting a code sample from a docs page and getting a fenced block with the right language tag
- Pulling the text of an HTML email or newsletter into Markdown notes
- Checking how a snippet with stray *asterisks* or [brackets] will be escaped before it lands in a Markdown file
05Tips
- Add a language-xxx class to <pre><code> (for example language-python) before converting and the fence keeps the language for syntax highlighting
- Backslashes before * [ # or a leading "1. " are deliberate escapes, so don't strip them or your text may render as a list or link
- Tables with colspan or rowspan come out flattened, so rebuild those by hand or keep them as raw HTML inside the Markdown
- Underline or highlight done only through CSS is lost. Use <u> or <mark> in the source and it survives as inline HTML
06Related concepts
CommonMark, GFM, Turndown.js, MDX.
Frequently Asked Questions
What is HTML to Markdown?
HTML to Markdown is a free, browser-based developer tool on AIDToolStack. Convert HTML to clean Markdown preserving headings, links, lists, and tables. It requires no installation or sign-up and works entirely in your browser.
Is HTML to Markdown free to use?
Yes. No sign-up, no fees and no usage cap.
Does HTML to Markdown store my data?
No. It runs in your browser; nothing is uploaded.