Skip to content
Toolcroft

HTML to Markdown Converter - Free Online Tool

Text Tools

Convert HTML to Markdown instantly in your browser. Supports headings, lists, tables, links, images, code blocks, and more. No server, no signup.

HTML Input
Markdown Output
  • Headings: h1 through h6, in ATX or setext style
  • Text formatting: bold, italic, strikethrough, inline code
  • Code blocks: pre / code with language class
  • Links and images: with href, src, alt, and title attributes
  • Lists: ordered and unordered, with nesting support
  • Tables: converted to GFM pipe table syntax
  • Blockquotes: with > prefix
  • Horizontal rules: hr -> ---

How to use this tool

  1. Paste or load HTML. Paste HTML into the left input panel or load a local .html or .htm file.
  2. Choose options. Select your preferred heading style, bullet character, and whether to keep unknown tags.
  3. Copy or download Markdown. The Markdown appears instantly on the right. Copy it or download it as a .md file.

Element conversion reference

HTML elementMarkdown output
<h1>–<h6>#–###### (ATX style)
<strong>, <b>**text**
<em>, <i>*text*
<a href="url">[text](url)
<img src="url" alt="...">![alt](url)
<code>backtick-wrapped inline code
<pre><code>fenced code block (```)
<ul> / <ol>- item / 1. item
<blockquote>> text
<table>GFM pipe table syntax
<hr>---
<del>~~text~~

Limitations

Not all HTML converts cleanly to Markdown. Common problem areas include:

  • Complex tables with merged cells (colspan/rowspan)
  • Deeply nested or inconsistently structured lists
  • Inline styles and <div>/<span> wrappers with no semantic meaning
  • HTML comments, <script>, and <style> blocks

Output from these elements may need manual cleanup after conversion.

Use cases

  • Converting CMS-exported HTML into documentation (Docusaurus, MkDocs, GitBook)
  • Migrating legacy web pages to static site generators
  • Extracting content for plain-text publishing or email newsletters
  • Reducing HTML bloat when copying content between platforms

How HTML becomes Markdown

The converter uses the browser's built-in DOMParser API to parse your HTML into a proper DOM tree, then walks each node to produce clean Markdown. This means it correctly handles nested structures and doesn't get confused by attributes or multi-line elements the way a simple regex approach would.

Semantic elements are mapped to their Markdown equivalents: headings become ATX or Setext headings, lists become indented list markers, and code blocks become fenced blocks with a detected language class when one is present. Tables are formatted as GitHub Flavored Markdown pipe tables. The first table row is used as the header, so check the result when your source has no explicit header row.

For example, a CMS article with a title, paragraphs, a feature list, and a code sample can become a README section without copying and reformatting each block by hand. Paste the source or load a local .html or .htm file; the file is read on this device and is never uploaded. The converter accepts up to 200,000 characters of HTML, and selected files must be no larger than 1 MB.

Markdown cannot represent every HTML detail. The walker drops scripts and styles, unwraps common layout containers, and strips unknown tags by default; turn on “Keep unknown tags” when you need unsupported markup preserved. CSS appearance is not carried over, and merged table cells or deeply nested lists may need hand cleanup. For formatted text copied directly from a webpage, use the Clipboard to Markdown tool instead.

Frequently asked questions

What HTML elements are supported?

The converter handles headings (h1–h6), paragraphs, bold, italic, strikethrough, code, code blocks, blockquotes, unordered and ordered lists, links, images, tables, horizontal rules, and common block elements like div and section.

Does it handle tables?

Yes. HTML tables are converted to GitHub Flavored Markdown (GFM) pipe tables, including a separator row after the header.

What happens to HTML that has no Markdown equivalent?

By default, unknown or unsupported tags are stripped and only their inner text content is preserved. Enable "Keep unknown tags" to retain the raw HTML in the output.

Is my content sent to a server?

No. All processing happens entirely in your browser using the built-in DOMParser API. Nothing is sent to any server.

Can I load an HTML file?

Yes. Choose a local .html or .htm file, up to 1 MB. Its contents are read in your browser, and the converter accepts up to 200,000 characters of HTML.

Browse all text tools