HTML to Markdown Converter Online

Convert HTML to Markdown instantly in your browser. Supports all common HTML elements.

HTML INPUT
MARKDOWN OUTPUT

When an HTML to Markdown converter is the right tool

Docs and CMS exports often arrive as HTML when you would rather edit Markdown. This page is for that direction: paste HTML on the left and get Markdown on the right, updating as you type. It handles common blocks and inline tags with regular expressions, without a DOM parser.

It is the wrong tool for tables or nested lists. After you convert, preview the result with Markdown Preview, or go the other way with Markdown to HTML.

Use cases

Turning a short article or README fragment into Markdown

Headings, paragraphs with bold and italic, lists, fenced code, blockquotes, and double-quoted links usually survive. Load Sample pastes a small page that includes all of those if you want to try that first.

Extracting prose from a messy export

script and style blocks are dropped, remaining tags are stripped, and extra blank lines are collapsed. You still need to read the output around components, tables, and custom attributes that the rewriter does not understand.

Capturing a code sample with its language

A <pre><code class="language-javascript"> block becomes a ```javascript fence. A pre without that class becomes an unlabeled fence.

How conversion works

The input is normalized to newlines, scripts and styles are removed, then block tags (headings, lists, pre, blockquote, hr, p, div) are rewritten, then inline tags, then remaining markup is stripped and a small set of entities is decoded. Empty input leaves the output empty. You can copy the result when it is present.

Example — headings, emphasis, and a list
<h1>Hello, World!</h1>
<p>This is a <strong>bold</strong> and <em>italic</em> example.</p>
<ul>
  <li>Item one</li>
  <li>Item two</li>
</ul>

# Hello, World!

This is a **bold** and *italic* example.

- Item one
- Item two

That is the usual shape for a simple article fragment. Inline code, links, and language fences in the built-in sample follow the same rules.

Example — a table is flattened to cell text
<table>
  <tr><th>A</th><th>B</th></tr>
  <tr><td>1</td><td>2</td></tr>
</table>

AB12

There is no pipe table in the output. If you need a Markdown table, build it another way, or start from already-tabular Markdown.

What this tool does not do

It does not convert tables, keep nested lists, or preserve inline markup inside headings and list items. It does not parse single-quoted links or images. Nothing is sent to a server. To indent the HTML first, use the HTML Formatter.

How to use HTML to Markdown

  1. Paste your HTML, or use Load Sample for a short demo document.
  2. Read the Markdown as it updates, especially around tables and nested lists.
  3. Copy the result when it looks right, or Clear to start over.

Frequently asked questions

Which HTML elements are converted?

Headings h1–h6 become atx headings. Paragraphs, divs, strong/b, em/i, del/s, inline code, links with a double-quoted href, images with a double-quoted src (and optional alt), ul/ol lists, blockquotes, hr, br, and pre/code blocks are rewritten. A pre > code element whose class contains language-name becomes a fenced block with that language.

Are tables and nested lists supported?

No. A table is not turned into a Markdown table; the cell text is concatenated after the tags are stripped, so a small two-by-two table can become a string such as AB12. Nested lists are flattened: inner tags are stripped, and you may get a single item that contains the child text. Convert tables and nested lists another way if you need the structure.

What happens to formatting inside headings or list items?

Heading and list-item content is tag-stripped before the Markdown is written, so a strong or a link inside an h1 or an li is lost and only the text remains. Inline formatting is preserved in paragraphs and divs, where strong, em, code, and links are processed first.

How are scripts, styles, and entities handled?

script and style blocks are removed. A handful of named entities (&amp;, &lt;, &gt;, &quot;, &#39;, &nbsp;) and decimal numeric entities are decoded. Hex entities such as &#xA0; are not. Images or links that use single quotes for src or href are not recognized and are stripped.

Is my HTML sent to a server?

No. Conversion runs in your browser as you type. Closing the tab discards what you pasted. Do not paste pages that contain secrets or private user data if you would not be comfortable with them sitting in memory on this device.

Is there a file size limit?

There is no server-imposed limit, because nothing is uploaded. A few thousand lines is usually comfortable. A large exported page can make the tab feel slow; in that case, convert a smaller fragment.

Related tools and guides

References

  • CommonMark and GitHub Flavored Markdown describe the target syntax, including tables, which this page does not emit.
  • This converter is a set of regular expressions run in the browser, not a DOM-based library such as Turndown. Unexpected or incomplete markup can be only partially converted.