Paste any HTML fragment and get GFM Markdown instantly: <h1> becomes #, <strong> becomes **bold**, links become [text](url), tables become pipe tables, and <pre> blocks become fenced code. Runs fully in your browser, nothing uploaded. Going the other way? The Markdown to HTML converter reverses it.

Convert

0 chars
0 chars
Advertisement

HTML Tag to Markdown Cheat Sheet

HTMLMarkdownNotes
<h1> โ€ฆ <h6># โ€ฆ ######One # per level
<p>plain text + blank lineBlank line separates paragraphs
<strong>, <b>**bold**Double asterisks
<em>, <i>*italic*Single asterisks
<del>, <s>~~strike~~GFM extension
<a href>[text](url)Title kept if present
<img>![alt](src)Alt text preserved
<ul> / <ol>- item / 1. itemNesting indents 2 spaces
<li><input checkbox>- [x] doneGFM task lists
<blockquote>> quoted textEvery line prefixed
<pre><code>``` fenced ```Keeps language-* class
<code>`code`Backticks, inline
<hr>---Horizontal rule
<table>pipe tablePipes in cells are escaped
<br>two trailing spacesGFM hard line break

Tags with no Markdown equivalent (div, span, font) pass their text through. Scripts, styles, and comments are dropped.

How the HTML to Markdown Converter Works

The tool parses your markup with the browser's native DOMParser, walks the resulting tree, and rewrites each element as its Markdown equivalent. Because the real HTML parser does the reading, sloppy input (unclosed tags, missing quotes, stray entities) gets normalized before conversion instead of breaking it.

What it handles

All six heading levels, bold, italic, strikethrough, links with titles, images, nested ordered and unordered lists, GFM task lists, blockquotes (including nested ones), fenced code blocks with language detection from class="language-โ€ฆ", horizontal rules, and pipe tables with a proper header row. Pipes inside table cells get escaped so the table doesn't break.

A worked example

Feed it this snippet:

<h2>Feeding Guide</h2>
<p>Adult dogs eat <strong>2-3% of body weight</strong> per day.
<a href="/raw-dog-food-calculator/">See the calculator</a> for portions.</p>
<ul><li>Muscle meat: 80%</li><li>Edible bone: 10%</li></ul>

You get this Markdown back:

## Feeding Guide

Adult dogs eat **2-3% of body weight** per day. [See the calculator](/raw-dog-food-calculator/) for portions.

- Muscle meat: 80%
- Edible bone: 10%

The blank line between blocks is what makes it valid Markdown rather than one long paragraph, and the link survives with its path intact.

When you'd use it

Classic cases: moving a legacy HTML page into a Markdown-based static site or docs toolchain (Jekyll, Hugo, Docusaurus), cleaning up rich-text-editor export soup before committing it, and lifting formatted content out of CMSes whose only export is HTML. For recurring conversion inside a build pipeline, a library like Turndown (MIT) is the right tool; for one-off pastes, this page does it without installing anything.

Frequently Asked Questions

How do I convert HTML to Markdown?

Paste your HTML into the left box on this page and the Markdown appears on the right instantly. The converter reads your markup with the browser's own HTML parser and rewrites each element as GitHub-Flavored Markdown: h1 becomes #, strong becomes **, a tags become [text](url), tables become pipe tables, and pre blocks become fenced code blocks. Nothing is uploaded; the conversion happens in your browser.

Which HTML tags does this convert to Markdown?

Headings h1-h6, paragraphs, bold and italic, strikethrough, inline code, links with titles, images, ordered and unordered lists (nested too), task list checkboxes, blockquotes, horizontal rules, and GFM pipe tables with header rows. Code blocks keep their language when the source has a class like language-python. Tags with no Markdown equivalent, like span or div, pass their content through.

What can't be converted to Markdown?

Markdown has no representation for scripts, styles, forms, iframes, or inline styling, so those are dropped. Alignment attributes on table cells (colspan, rowspan) have no GFM equivalent either. When both Markdown and HTML describe something, like nested emphasis, the converter keeps the simpler Markdown form rather than falling back to raw HTML.

Is this a Turndown alternative?

It does the same job as Turndown, the MIT-licensed library many pipelines use, but it's a single self-contained script with no install. Turndown is the right call inside a build pipeline; this page is the right call when you just need to paste a chunk of HTML and copy Markdown out once, or when you can't add dependencies.

Does my HTML get uploaded anywhere?

No. The converter uses the DOMParser built into your browser, so your HTML never leaves the page. That makes it safe for drafts, private docs, and client content. The only network requests the page makes are for the site's own scripts.

How do I convert Markdown back to HTML?

Use the sister tool, the Markdown to HTML converter, which renders Markdown into styled HTML in the same paste-and-copy flow. Keeping both directions in one toolbox covers the two most common format-shuffling jobs in documentation work.

Advertisement