HTML to Markdown Converter

Paste HTML or load an .html file and get clean, LLM-ready Markdown — noise stripped, options configurable, fully in your browser.

HTML Input

Try a sample:

Markdown Output

Markdown appears here

Paste HTML on the left or pick a sample

Details

The HTML to Markdown Converter transforms raw HTML into readable Markdown using the battle-tested Turndown library. It supports all common HTML elements — headings (h1–h6), bold, italic, links, images, ordered and unordered lists, blockquotes, code blocks, and tables. You can customise the heading style (ATX `#` signs vs setext underlines), the bullet-list marker (`-`, `*`, or `+`), and whether fenced (triple-backtick) or indented code blocks are emitted. Conversion happens entirely in your browser — no HTML is sent to a server.

Examples

Blog article HTML to Markdown

<!-- Input -->
<h1>My Article</h1>
<p>An intro with <strong>bold</strong> and <em>italic</em>.</p>
<ul>
  <li>First point</li>
  <li>Second point</li>
</ul>

<!-- Output (ATX headings, dash bullets) -->
# My Article

An intro with **bold** and _italic_.

- First point
- Second point

Headings become ATX-style hashes, inline formatting is preserved as Markdown emphasis, and list items use the configured bullet marker.

Code snippet with fenced blocks

<!-- Input -->
<pre><code class="language-js">const x = 42;</code></pre>

<!-- Output (fenced style) -->
```
const x = 42;
```

When the fenced code-block style is selected, pre/code elements become triple-backtick blocks instead of 4-space-indented blocks.

    Examples

    Convert headings and emphasis

    Input
    <h1>Title</h1>
    <p>This is <strong>bold</strong> and <em>italic</em>.</p>
    Output
    # Title
    
    This is **bold** and *italic*.

    An H1 becomes a leading #, and <strong>/<em> map to ** and * — the CommonMark equivalents produced by Turndown.

    Convert a list and a link

    Input
    <ul>
      <li>one</li>
      <li>two</li>
    </ul>
    <a href="https://example.com">Docs</a>
    Output
    - one
    - two
    
    [Docs](https://example.com)

    List items become dash bullets and an anchor collapses to [label](url), losing the tag noise but keeping the link.

    About this tool

    HTML to Markdown Converter transforms raw HTML into clean, readable Markdown using the battle-tested Turndown library. It handles the full spectrum of common HTML — headings, bold, italic, links, images, lists, blockquotes, code blocks, and tables — and strips script and style content automatically.

    Three conversion options let you tailor the output to match your project's Markdown flavour. Heading style controls whether headings are rendered as ATX hash signs or setext underlines. Bullet list marker sets the character used for unordered items: dash, asterisk, or plus. Code block style switches between fenced triple-backtick blocks and four-space-indented blocks.

    Everything runs locally in your browser. No HTML is uploaded to any server, making the tool safe for use with private or sensitive content.

    How to use

    1. Paste and convert HTML

      Paste your HTML into the input box; the Markdown result updates as you type. Use the sample chips to see a conversion immediately.

    2. Adjust conversion options

      Change the heading style (ATX # vs setext), the bullet-list marker (-, *, or +), and whether code blocks are fenced or indented. The output refreshes automatically.

    3. Copy the Markdown output

      Click Copy Markdown to copy the result to your clipboard.

    Use cases

    Moving web content into a Markdown CMS

    Turn pasted HTML from a rich-text editor or email into clean Markdown for a docs site, wiki, or static-site generator.

    Cleaning up AI or email output

    Strip inline styles and nested spans from generated HTML so only the structural Markdown remains.

    Preparing text for LLM input

    Reduce HTML to lightweight Markdown tokens before feeding content into a model, cutting tokens and noise.

    Supported HTML elements

    HTML elementMarkdown output
    h1 – h6# Heading (ATX) or underline (setext)
    strong / b**bold**
    em / i_italic_
    a href[text](url)
    ul / li- item (or *, +)
    pre / codefenced ``` or indented
    tableGFM pipe table

    Common mistakes

    Mistake:Expecting pixel-perfect round-trips back to the original HTML.

    Fix:Markdown cannot represent every HTML structure (tables, classes, inline styles). Information that has no Markdown equivalent is simplified or dropped.

    Mistake:Assuming nested tables survive conversion.

    Fix:Plain Markdown has no native table model; complex or nested tables often flatten to text. Keep the original HTML if tabular fidelity matters.

    Mistake:Forgetting that raw HTML inside the source may be retained.

    Fix:Turndown passes through unknown or allowed HTML tags by default; review the output if you need pure Markdown with no embedded tags.

    Frequently asked questions

    References & standards