Skip to content

HTML to Markdown Converter

Paste your HTML code below and get clean, readable Markdown output. Handles headings, lists, tables, code blocks, links, images, and nested formatting.

Related Tools

Strip HTML Tags Markdown Editor Markdown to HTML Converter Rich Text to Markdown Rich Text to HTML Converter

How to Use

  1. Paste Your HTML — Type or paste your HTML code into the input area. The converter accepts any valid HTML including headings, paragraphs, lists, tables, code blocks, links, images, and formatting tags.
  2. View the Markdown — The converter instantly generates clean Markdown syntax. The Markdown tab shows the raw output, while the Preview tab renders that Markdown with WritePadPro's built-in Markdown renderer so you can check headings, lists, links, and tables at a glance (other Markdown renderers may differ slightly).
  3. Copy or Download — Click Copy Markdown to copy the output to your clipboard, or Download .md to save it as a Markdown file. The converter also shows size comparison between the HTML input and Markdown output.

About the HTML to Markdown Converter

The HTML to Markdown Converter turns HTML source into Markdown you can keep in a README, a wiki, a static site generator or a notes app. Paste page source, a CMS export or an HTML snippet. You get the Markdown text plus a Preview tab that renders it, so you can check headings, lists and tables before copying. It is mostly used to move content out of a CMS or website into Markdown files.

How the conversion works

Your HTML is parsed with the browser's own DOMParser into an inert document, so scripts in it never run. The converter then walks the element tree:

Plain text is escaped where it would otherwise turn into Markdown: *, backticks, brackets and backslashes get a backslash, and < becomes &lt;. Underscores are escaped only at word edges, so my_var stays readable.

Worked example

Input:

<h2>Setup</h2>
<p>Run <code>npm i</code> &amp; read
 <a href="https://example.com"
 title="Docs">the <b>docs</b></a>.</p>
<ul>
 <li>Fast</li>
 <li>Private
  <ul><li>No uploads</li></ul>
 </li>
</ul>
<table>
 <tr><th>Plan</th>
 <th align="right">Price</th></tr>
 <tr><td>A|B</td><td>$5</td></tr>
</table>
<p><span style="font-weight:bold">Big</span>
 my_var *star* <u>under</u></p>
<script>alert(1)</script>

Output:

## Setup

Run `npm i` & read [the **docs**](https://example.com "Docs").

- Fast
- Private
  - No uploads

| Plan | Price |
| --- | ---: |
| A\|B | $5 |

Big my_var \*star\* under

The script is gone, the nested list is indented and the pipe is escaped. The bold that came from a style attribute is lost, and so is the underline.

Limitations

Practical tips

Parsing and conversion run inside your browser tab, so the HTML you paste is never uploaded.

Frequently Asked Questions

What HTML tags does this converter handle?

The converter handles all common HTML elements: headings (h1-h6), paragraphs (p), bold (strong, b), italic (em, i), strikethrough (del, s), links (a), images (img), code (code), code blocks (pre > code with language detection), blockquotes, ordered lists (ol), unordered lists (ul) with nested lists indented under their parent item, task lists with checkboxes, tables with alignment (pipe characters inside cells are escaped), horizontal rules (hr), line breaks (br), and nested structures. Script, style, form, and iframe tags are stripped. Links that use javascript:, data:, or similar unsafe addresses are reduced to their text, and images are kept only when their source is http, https, a relative path, or an embedded PNG, GIF, JPEG, or WebP image.

How does it handle complex nested HTML?

The converter uses the browser's built-in DOMParser to create a proper DOM tree from your HTML, then recursively walks the tree converting each node to its Markdown equivalent. This means it correctly handles nested bold inside links, lists inside blockquotes, code inside paragraphs, and other complex structures that regex-based converters often break on.

Will it clean up messy HTML from Word or Google Docs?

Partially. The converter strips script, style, form, and embed tags automatically. It converts formatting tags to Markdown equivalents regardless of how many extra classes or styles they have. However, for heavily formatted Word/Docs content with complex layouts, you may want to use our Rich Text to Markdown tool which is specifically designed for that use case.

Does it preserve code block languages?

Yes. If your HTML code block has a language class like class="language-javascript" or class="language-python" on the code element inside a pre tag, the converter preserves the language hint in the Markdown output as a fenced code block: ```javascript ... ```.

Does this tool send my HTML to a server?

No. All parsing uses the browser's native DOMParser API — your HTML is processed entirely on your device. Nothing is transmitted over the network, stored remotely, or shared with any third party. This makes it safe to convert proprietary code, private documents, and confidential content.