HomeFile Converter ToolsHTML to Markdown
H→MD
File

HTML to Markdown Converter

Convert HTML to Markdown using Turndown.js. Live side-by-side preview. Handles headings, bold, italic, links, images, lists, tables, code blocks, and blockquotes. Upload .html files or paste raw HTML.

✍ Turndown.js engine👁 Live preview📄 Upload HTML file📋 Copy Markdown
Converters:
🔒 100% Private — All conversion runs in your browser. No files are uploaded to any server.

📖 How to Use HTML to Markdown

  1. 1
    Paste HTML or upload a file

    Paste raw HTML into the input panel or drop an .html file. The Markdown output appears in real time on the right. Turndown.js converts HTML semantic elements to their Markdown equivalents.

  2. 2
    Check the Markdown output

    Review the converted Markdown — headings become # symbols, bold becomes **text**, links become [text](url), code blocks become backtick fences. Tables are converted to Markdown pipe-table format.

  3. 3
    Copy or download

    Click Copy Markdown to copy to clipboard, or Download .md to save as a Markdown file. The output is clean, readable Markdown compatible with GitHub, Obsidian, Notion, Jekyll, Hugo, and all major Markdown renderers.

💡 Quick Reference

HTML Markdown
<h1>Title</h1> # Title
<strong>bold</strong> **bold**
<a href="url">text</a> [text](url)
<code>code</code> `code`

Frequently Asked Questions — HTML to Markdown

What HTML elements are converted to Markdown?

Headings (h1–h6) → # to ######. Bold (strong, b) → **text**. Italic (em, i) → *text*. Links (a href) → [text](url). Images (img) → ![alt](src). Unordered lists (ul/li) → - item. Ordered lists (ol/li) → 1. item. Code (code) → `code`. Code blocks (pre) → ```code```. Blockquotes (blockquote) → > text. Tables (table/tr/td) → pipe table format. Horizontal rules (hr) → ---.

What happens to HTML elements with no Markdown equivalent?

Some HTML has no Markdown equivalent: div, span, section, article become plain text with their content preserved. Inline styles (color, font-size) are stripped. class and id attributes are removed. data-* attributes are ignored. Complex nested tables may not convert perfectly. iframes, scripts, and style tags are stripped. If a precise layout is needed, keep HTML rather than converting.

What is Turndown.js?

Turndown is an open-source JavaScript library (github.com/mixmark-io/turndown) that converts HTML to Markdown. It handles the full range of HTML elements and provides a plugin system for custom rules. It is used by many popular Markdown editors and CMS platforms. This tool uses Turndown to provide reliable, standards-compliant conversion entirely in your browser.

Can I convert a full HTML webpage to Markdown?

Paste the full HTML of a page and Turndown will convert it, but the output will include navigation menus, footers, sidebars, and other boilerplate. For article extraction (content only), tools like Mozilla Readability (used in Firefox Reader Mode) first extract the main content before converting. For Google Docs exported HTML, this tool works excellently — just paste the HTML and get clean Markdown.

Why do some links or images look wrong in the output?

Relative URLs in HTML (href="/about" or src="../images/photo.jpg") remain relative in the Markdown output. If the Markdown is used in a different context (e.g. a GitHub README), relative URLs may not resolve correctly. For portability, use absolute URLs in the original HTML. Images with data-src lazy loading attributes may not convert correctly — check that the img src attribute contains the actual URL.

What is Markdown used for?

Markdown is a lightweight markup language designed to be readable as plain text and convertible to HTML. Common uses: GitHub README files and documentation, static site generators (Jekyll, Hugo, Gatsby, Eleventy), note-taking apps (Obsidian, Notion, Typora), content management (Ghost, WordPress with Markdown plugin), API documentation (Swagger, ReadTheDocs), and as input for AI models (ChatGPT, Claude accept Markdown formatting).