TL
Tool Lab
💰捐贈
💰捐贈

HTML to Markdown

Convert HTML to clean Markdown text. Supports headings, lists, bold, italic, links, images, code, and tables.

HTML Input
Markdown Output

About This Tool

The HTML to Markdown Converter transforms HTML markup into clean, readable Markdown text. Paste any HTML snippet or full page source and get the equivalent Markdown output instantly. The converter handles headings, paragraphs, bold, italic, links, images, code blocks, lists, blockquotes, horizontal rules, and basic tables.

Conversion runs in your browser using the native DOMParser API. Script and style tags are stripped from the output. Nested HTML elements are traversed recursively to produce correctly indented Markdown list items and nested blockquotes.

How to Use

  1. Paste your HTML into the input area, or click Sample to load an example.
  2. Click Convert to generate Markdown output.
  3. Review the result in the output panel on the right.
  4. Click Copy Markdown to copy the output to your clipboard.

Supported HTML Elements

h1–h6 → # headings. p, br → paragraphs and line breaks. strong/b → **bold**. em/i → *italic*. del/s → ~~strikethrough~~. code → `inline code`. pre → fenced code blocks. a → [text](url) links. img → ![alt](src) images. ul/ol/li → unordered and ordered lists. blockquote → > quotes. hr → ---. Basic table → Markdown table. script and style tags are stripped.

Use Cases

Content editors migrating articles from a CMS (WordPress, Drupal) to a Markdown-based platform convert exported HTML to clean Markdown. Developers extracting content from web scraping results convert HTML to Markdown for storage in text files or databases. Technical writers convert legacy HTML documentation to Markdown for publishing in GitHub wikis or MkDocs sites.

FAQ

  • Does it handle the full HTML spec? — No. It handles common content elements. Complex layouts with divs, CSS classes, and JavaScript are stripped or simplified.
  • Are tables converted? — Basic tables (thead, tbody, tr, th, td) are converted to GitHub Flavored Markdown table syntax.
  • Are inline styles preserved? — No. Inline styles and CSS classes are stripped. Only semantic HTML tags are converted to Markdown equivalents.