Skip to content

HTML to Markdown Converter

Paste HTML to get clean Markdown for a README, wiki or static site, or paste Markdown to get HTML. A rendered preview shows how the result will look.

Drop an HTML or Markdown file here

Or paste straight into Input below.

.html, .htm, .md, .markdown and .txt files. Read on your device.

Conversion options

Auto detect picks the direction. The preview is always sanitized.

Waiting for input
Ready. Paste HTML or Markdown, or choose a file to begin.
StatusWaiting
Detected Input—
DirectionAuto
Input Size0
Output Size0
Blocks / Lines0

Input & Converted Output

Paste HTML or Markdown on the left. The converted result appears on the right.

No action yet Line 1, Col 1

Input

Editable 0 chars
1
Ready for input No file loaded
Detection idle

Output

Result preview 0 chars
1
No output yet Ready to download
Type idle

Rendered Preview

The converted result as it will look once rendered. Scripts and event handlers are removed.

Converted content preview will appear here.

Input Analysis

Headings, links, lists, images and code found in the input.

Run the tool or click Analyze Input to inspect the current content here.

Result Snapshot

Direction, output type, line count and size.

Snapshot idle
Detected Input—
Output Type—
Heading Style—
Bullet Style—
Blocks / Lines0
Output Size0 B

Runs in your browser. Nothing you type, paste or open here is uploaded.

To convert HTML to Markdown, paste your HTML into the Input box. The converter detects the tags and shows Markdown in Output as you type, with a rendered preview below. Choose heading, bullet and code block styles in Conversion options, then select Copy output or Download to save a .md file. Paste Markdown instead to get HTML.

How to convert HTML to Markdown

  1. Add your HTML. Paste it into the Input box, or select Select file to load an .html, .htm, .md, .markdown or .txt file.
  2. Check the direction. Auto detect picks HTML → Markdown when the input starts with a tag or is mostly HTML. Set Conversion to Markdown → HTML to go the other way.
  3. Pick a style. Choose Markdown Heading Style, Bullet Marker and Code Blocks. Keep raw HTML blocks leaves elements Markdown can't express as HTML.
  4. Preview and save. Check the Rendered Preview, then select Copy output or Download.

What the HTML to Markdown converter keeps

The conversion uses Turndown, an open-source HTML to Markdown library. Headings, paragraphs, bold and italic text, links, images, ordered and unordered lists, blockquotes, inline code, code blocks and horizontal rules all map to standard Markdown, and the GitHub Flavored Markdown plugin adds tables, strikethrough and task lists. Script and style tags are dropped completely, so you don't get stray JavaScript or CSS in your Markdown file.

HTMLMarkdown output
<h2>Setup</h2>## Setup
<strong>bold</strong>**bold**
<em>italic</em>_italic_
<a href="/docs">Docs</a>[Docs](/docs)
<blockquote>Note</blockquote>> Note
<li>Item</li> in a list- Item

With Keep raw HTML blocks ticked, <iframe>, <sub>, <sup>, <details> and <summary> stay as HTML, since Markdown has no syntax for them. Whether that HTML displays depends on where the Markdown is rendered, since some sites strip tags such as iframes for security. Class names, inline styles and IDs are dropped.

Convert an HTML table to Markdown

HTML tables become GitHub Flavored Markdown pipe tables. The table needs a header row (<th> cells or a <thead>); a table without one is left as HTML, since pipe tables always start with a header. Strikethrough (<del> or <s>) becomes ~text~, and checkboxes at the start of list items become task list items such as - [x] Done.

The pipe syntax looks like this. The first row is the header, the second row of dashes separates it from the body, and colons set alignment:

| Plan | Price |

| :--- | ---: |

| Basic | $5 |

| Pro | $12 |

Going the other way works: in Markdown → HTML mode, pipe tables like this one become a proper <table> with <thead> and <tbody>. To build a table visually and copy its HTML, use the HTML table generator.

Markdown to HTML

Switch Conversion to Markdown → HTML, or paste Markdown with no HTML tags and Auto detect does it for you. The Markdown is parsed with the marked library, which supports GitHub Flavored Markdown, including tables, strikethrough and fenced code blocks. With Beautify HTML output on, each block is placed on its own indented line so the result is easy to read and paste into a template.

Auto detect treats input as HTML when it starts with a tag, or when it has tags but no Markdown syntax. Markdown with a few inline tags, such as a <sup> or <br>, stays Markdown. If it guesses wrong, set the direction by hand. If you need to reformat a large HTML file before converting, run it through the HTML formatter first.

Formatting options explained

  • Markdown Heading Style: # Heading (ATX) writes every level with hash marks. Setext for H1/H2 underlines level 1 and 2 headings with = and - instead, an older style some writers prefer.
  • Bullet Marker: dash, asterisk or plus. All three render the same; pick the one your project's style guide uses.
  • Code Blocks: triple backticks or tildes. Tildes help when the code itself contains backticks.
  • Rendered Preview: always cleaned with DOMPurify and shown in a sandboxed frame, so scripts and event handlers in pasted content can't run.
  • Trim input and Collapse blank lines: remove leading and trailing whitespace, and squeeze runs of blank lines down to a single blank line.

Markdown itself was created by John Gruber in 2004, with help from Aaron Swartz, as a plain-text format that's easy to read before it's rendered.

Frequently asked questions

Can I convert Markdown to HTML here too?

Yes. Paste Markdown without any HTML tags, or set Conversion to Markdown → HTML. Download then saves an .html file.

Does it convert HTML tables to Markdown tables?

Yes. Tables with a header row become GitHub Flavored Markdown pipe tables. Strikethrough and task-list checkboxes convert too. A table without a header row is kept as HTML.

Are CSS classes and inline styles kept?

No. Markdown has no way to store classes, IDs or styles, so they're dropped. Script and style elements are removed entirely.

Can I convert a whole web page?

Yes. Paste the page's HTML source. Navigation, footers and sidebars are converted too, so it's usually cleaner to paste only the article section.

Is my HTML uploaded?

No. Conversion runs in your browser. The Turndown, marked and DOMPurify libraries load from ToolzyLab's own server, and your content never leaves your device.

Which Markdown flavor does the output use?

HTML to Markdown produces GitHub Flavored Markdown: standard Markdown plus pipe tables, strikethrough and task lists, which GitHub, GitLab, Obsidian and most static site generators read. Markdown to HTML accepts GitHub Flavored Markdown too.

Updated 11 October 2026Reviewed by the ToolzyLab teamHow we test our tools