Skip to content
HTML to Markdown

HTML to Markdown

Convert HTML to Markdown online with a clean split editor. Paste HTML, click convert, then copy or download the Markdown for GitHub, Reddit, blogs, and documentation.

Converts HTML to Markdown using Turndown Split-screen editor (HTML input and Markdown output) Copy and download Markdown output Import HTML from URL or file Theme switcher Fullscreen editor mode

Input HTML

Paste your HTML

Output Markdown

Copy or download the Markdown

Key Features

  • Converts HTML to Markdown using Turndown
  • Split-screen editor (HTML input and Markdown output)
  • Copy and download Markdown output
  • Import HTML from URL or file
  • Theme switcher
  • Fullscreen editor mode

How to Use

  1. Paste your HTML into the input editor.
  2. Click Convert to generate Markdown.
  3. Copy or download the Markdown output.

How the converter works

Paste HTML into the left editor, or bring it in with Import File (.html, .htm, or .txt) or Import URL, and click Convert. The conversion is done in your browser by Turndown 7.2.0, an open-source HTML to Markdown library. Before converting, <script> and <style> elements are removed, and the finished Markdown is trimmed. Download saves it as converted.md.

The output style is fixed:

  • Headings use # prefixes (## Title), never underlines.
  • Code blocks are fenced with three backticks, and the language is kept when the HTML has a class such as language-bash on the <code> element.
  • Bullet lists use -, bold uses **, and italics use _.
  • Links and images are written inline: [text](url "title") and ![alt](src).
  • A horizontal rule becomes * * *, and a <br> becomes two trailing spaces followed by a line break.

Example: a documentation page from a CMS

Input HTML:

<article>
  <h2>Deploying with rsync</h2>
  <p>Run the command below from the <strong>project root</strong>. See the <a href="https://example.com/docs/deploy" title="Deploy docs">deploy guide</a> for <em>staging</em> servers.</p>
  <ul>
    <li>Build assets first</li>
    <li>Check <code>.env</code> is excluded</li>
  </ul>
  <pre><code class="language-bash">rsync -avz --exclude=".env" ./ user@host:/var/www/app
</code></pre>
  <img src="/img/deploy-flow.png" alt="Deploy flow diagram">
  <p>Price: <del>$20</del> $15<br>Updated 2026</p>
  <script>trackPageView();</script>
</article>

Markdown output:

## Deploying with rsync

Run the command below from the **project root**. See the [deploy guide](https://example.com/docs/deploy "Deploy docs") for _staging_ servers.

-   Build assets first
-   Check `.env` is excluded

```bash
rsync -avz --exclude=".env" ./ user@host:/var/www/app
```

![Deploy flow diagram](/img/deploy-flow.png)

Price: $20 $15  
Updated 2026

Things to check in the result:

  • The list items are written as - followed by three spaces. That is Turndown's default alignment and every Markdown renderer accepts it.
  • The strikethrough was lost: <del>$20</del> became plain $20, so the price line now reads as if both prices apply. Add ~~$20~~ by hand if your target supports GitHub-flavored Markdown.
  • The line after $15 ends in two spaces, invisible in most editors. Those spaces are the Markdown line break that replaced <br>.
  • The tracking script was removed completely.
  • The image path /img/deploy-flow.png is relative. It will not work if the Markdown moves to a different site, such as a GitHub README. Replace relative URLs with absolute ones where needed.

HTML that has no Markdown equivalent

Markdown covers a small subset of HTML. When Turndown meets an element it has no rule for, it keeps the text and drops the tag. In practice:

  • Tables are flattened. A two-by-two table becomes four separate paragraphs, one per cell. Core Turndown has no table rule, and neither does original Markdown.
  • <del>, <sub>, <sup>, <u>, and <mark> lose their formatting. "H2O" becomes "H2O".
  • Checkboxes in task lists are dropped, so - [x] items come out as ordinary bullets.
  • Definition lists (<dl>) become plain paragraphs.
  • Embeds such as <iframe> video players disappear entirely, along with HTML comments.
  • Classes, IDs, inline styles, and data- attributes are discarded. A styled warning box becomes ordinary text.

If any of this content matters, paste the original HTML for that part back into the Markdown file. GitHub, most static site generators, and most wikis render raw HTML inside Markdown.

Escaped characters

Turndown adds backslashes where your text would otherwise turn into Markdown formatting. The paragraph 1. Not a list is output as 1\. Not a list, and *stars* becomes \*stars\*. These escapes are correct and invisible after rendering. Do not remove them in bulk, or you may turn plain sentences into lists and italics.

When to use a different tool

  • To go the other way, from Markdown back to HTML, use Markdown to HTML.
  • To start from formatted rich text or a Word document instead of HTML source, use the AI Prompt Markdown Editor.
  • If the source HTML is minified and hard to read before converting, run it through the HTML Beautifier first.

Frequently asked questions

Why is my HTML table not converted to a Markdown table?

The converter uses the core Turndown library without the GitHub-flavored Markdown plugin, and core Markdown has no table syntax. Each cell's text comes out as its own paragraph. Rebuild the table by hand with pipe syntax, or keep the original table HTML in your Markdown file, since most Markdown renderers accept raw HTML.

Why are there backslashes in my Markdown output?

Turndown escapes characters that Markdown would otherwise treat as formatting. A paragraph starting with "1." would become a numbered list, so it is written as 1\. and literal asterisks or underscores become \* and \_. The backslashes are hidden when the Markdown is rendered, so leave them in.

Can I convert a whole web page?

You can, but you will get more than the article. The text of the title tag, navigation links, and footer are all converted too. Scripts and styles are removed. For clean results, paste only the main content element, such as the article or main block, instead of the full page source.

Does the converter keep code block languages?

Yes, when the HTML uses the common convention of a class like language-js or language-bash on the code element inside pre. The output is a fenced code block with that language after the opening backticks. A pre element with no code element inside is converted to plain text, not a code block.

Is my HTML sent to a server?

No. Turndown runs in your browser. The input is saved in your browser's local storage so it can be restored on your next visit, and Clear removes it. Import URL fetches the page directly from your browser, which only works when that site allows cross-origin requests.

Latest from Our Blog

Tips, tutorials, and insights about web development