Skip to content

HTML to Markdown

✨ Converts as you type 0 lines · 0 B

Markdown

Paste HTML on the left

Clean Markdown will appear here
Nothing to convert yet

HTML to Markdown Converter – Free Online Tool

What is an HTML to Markdown Converter?

It reads HTML and writes the same content as Markdown, the plain-text format with # headings, **bold** and - lists. So <h2>Shopping</h2> becomes ## Shopping and <a href="…">the list</a> becomes [the list](…).

Why would you want that? Markdown is much nicer to read and edit than HTML, and it’s what GitHub, static site generators like Hugo, Jekyll and Astro, docs tools and note apps like Obsidian use. It’s the quick way to move an old blog post, a page from a CMS or a chunk of docs into a Markdown world, or to give clean text to an AI tool. This converter handles GitHub Flavored Markdown too, so tables, strikethrough and task lists come along. It all runs in your browser and nothing is uploaded.

How to Use It – Step by Step

Five short steps. Paste the examples into the tool above to try them.

Step 1 Paste or Open Your HTML

Get your HTML into the left panel. Pick whichever is easiest:

  • Paste it: a snippet, or a whole page from your browser’s “View source”.
  • Open a file: click the upload button, or drag an .html file onto the tool.
  • Click Sample: loads a small API guide with lists, code, a table and a quote.

The Markdown on the right updates a moment after you stop typing.

Try it: text, bold, italic and a link

HTML:

<h2>Shopping</h2>
<p>Buy <strong>milk</strong> and <em>bread</em>.
See <a href="https://example.com/list">the list</a>.</p>

Markdown:

## Shopping

Buy **milk** and *bread*. See [the list](https://example.com/list).

💡 The line break inside the <p> was just spacing in the HTML, so it’s gone. Browsers ignore it too.

Step 2 Lists, Even Nested Ones

Bullet lists get a dash, numbered lists get numbers, and a list inside a list item is indented under it. Numbered lists keep their start number if the HTML has one.

Try it: a nested list and a numbered list

HTML:

<ul>
  <li>Apples</li>
  <li>Pears
    <ul><li>green ones</li></ul>
  </li>
</ul>
<ol>
  <li>Wash</li>
  <li>Eat</li>
</ol>

Markdown:

- Apples
- Pears
  - green ones

1. Wash
2. Eat

Step 3 Tables Become Pipe Tables

A table with a header row (<th> cells) turns into a GitHub-style pipe table. A table without a header row stays as HTML, because Markdown tables can’t exist without one, and most Markdown renderers show HTML tables just fine.

Try it: a pricing table

HTML:

<table>
  <thead>
    <tr><th>Plan</th><th>Price</th></tr>
  </thead>
  <tbody>
    <tr><td>Free</td><td>$0</td></tr>
    <tr><td>Pro</td><td>$9</td></tr>
  </tbody>
</table>

Markdown:

| Plan | Price |
| --- | --- |
| Free | $0 |
| Pro | $9 |

Step 4 Code Blocks Keep Their Language

<pre><code> becomes a fenced code block. If the code has a class like language-js (the convention most highlighters use), the language goes after the backticks, so GitHub and your docs site can color it. Inline <code> becomes `backticks`.

Try it: a JavaScript snippet

HTML:

<pre><code class="language-js">const total = a + b;</code></pre>

Markdown:

```js
const total = a + b;
```

Step 5 Pick Your Style, Then Copy or Download

The options above the output let you match your project’s style: Headings as # Heading or underlined, Bullets as -, * or +, and Code as fenced or indented blocks. The defaults are what most projects use. Your choice is remembered in this browser.

Try it: underlined headings and * bullets

HTML:

<h1>Title</h1>
<h2>Subtitle</h2>
<ul><li>One</li></ul>

Markdown:

Title
=====

Subtitle
--------

* One
  • Copy: puts the Markdown on your clipboard.
  • Download: saves it as a .md file, named after the page title.
  • Going back? The Markdown to HTML converter turns Markdown into HTML with a live preview.

💡 Messy HTML in, messy Markdown out. If the source has unclosed or badly nested tags, run it through the HTML Fixer first.

Frequently Asked Questions

What HTML can be turned into Markdown?

Everything Markdown has a symbol for: headings, paragraphs, bold and italic, links, images, bullet and numbered lists (nested too), blockquotes, code, code blocks, horizontal rules, strikethrough, task-list checkboxes and tables. Things Markdown can’t describe, like colors, classes or layout divs, are dropped and only their text is kept.

Why is my table still HTML in the output?

Markdown tables need a header row. If your table has no <th> cells (or no <thead>), the converter keeps it as HTML so nothing gets lost, and most Markdown renderers, GitHub included, display HTML tables just fine. Add a header row and it becomes a pipe table.

What happens to scripts, styles and the <head>?

They’re skipped. <script>, <style>, <noscript>, iframes, dropdown menus and everything in <head> aren’t content, so they don’t belong in Markdown. You can paste a whole saved web page and you’ll get just the readable part.

Which options should I pick?

“# Heading” headings, “-” bullets and ``` fenced code are what GitHub, most static site generators and most linters expect, so the defaults are a safe choice. Underlined headings only work for levels 1 and 2, and indented code blocks can’t say which language the code is.

Why are some characters escaped with a backslash?

Characters like *, _, # or [ mean something in Markdown. If your text really contains them, for example “5 * 3” or “#1 tip”, the converter puts a \ in front so they show up as plain characters instead of turning into formatting.

Is my HTML uploaded anywhere?

No. The HTML is parsed and converted right in your browser with the open-source Turndown library. Nothing is sent to a server, so it’s fine to paste private pages or work docs.

Can I go the other way, Markdown to HTML?

Sure, the Markdown to HTML converter on this site does that, with a live preview of the result.