HTML to Markdown Converter

Convert HTML documents and fragments into clean GitHub Flavored Markdown with tables, code blocks, links, images, and lists.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
HTML input
0 lines · 0 charsHTML
Markdown output
0 lines · 0 chars

About This Tool

Converts raw HTML snippets, CMS exports, and documentation fragments into clean, readable CommonMark and GitHub Flavored Markdown.

Uses a deterministic HTML tokenizer that strips <script>, <style>, and HTML comments while preserving headings, emphasis, code fences with language classes, task lists, blockquotes, and tables.

Key Features

  • Full block & inline coverage: Handles h1-h6, p, strong/b, em/i, del/s, code, pre, a, img, ul, ol, checkbox task lists, blockquote, table, and hr.
  • GFM table reconstruction: Converts <table>, <thead>, <tbody>, <tr>, <th>, and <td> structures into Markdown pipe tables.
  • Language-aware code fences: Extracts class="language-*" from <pre><code> blocks to emit tagged fenced code blocks.
  • Script & style stripping: Automatically removes <script>, <style>, and <!-- comment --> blocks before generating Markdown.

Frequently Asked Questions

What happens to <script> and <style> blocks in pasted HTML?
Script tags, inline stylesheet blocks, DOCTYPE declarations, and HTML comments are stripped prior to conversion so they do not pollute your Markdown output.
How are code blocks with syntax highlighting classes converted?
If a <pre><code class="language-ts"> element includes a language-* class, the converter attaches that language identifier to the opening code fence (```ts).
Does it convert HTML tables to Markdown?
Yes. HTML tables are converted into GitHub Flavored Markdown pipe tables, and any literal pipe characters inside cells are escaped as \|.
Is my HTML sent to any external server?
No. The tokenizer and Markdown serializer execute locally in your browser.