HTML to Markdown Converter Online – Convert HTML & Tables to GFM

Convert raw HTML code, web page snippets, and HTML tables into clean, readable GitHub Flavored Markdown (.md) in real time. Ideal for migrating blog posts to static site generators (Astro, Hugo, Next.js, Jekyll), preparing clean documentation for GitHub READMEs and Obsidian notes, or compressing web HTML into lightweight Markdown context for AI/LLM prompts.

Quick Presets:

Lines: 0

Words: 0

Characters: 0

How to Convert HTML to Markdown Online

  1. Paste Your HTML Code: Enter or paste your HTML snippet (or an entire web page's source code) into the HTML Input box on the left, or click Load Sample HTML to test with headings, task lists, code blocks, and an HTML table.
  2. Customize Markdown Syntax: Use the Markdown Syntax Styles panel on the right to choose ATX (#) or Setext (===) headings, fenced (```) or indented code blocks, and inline ([text](url)) or reference-style ([text][1]) links.
  3. Toggle GFM & Cleanup Filters: Keep Convert HTML <table> to GFM pipe tables and Strip <script>, <style> & <svg> tags checked to generate clean, noise-free Markdown automatically as you type.
  4. Copy or Download .md: Click Copy to Clipboard to paste your Markdown into GitHub, Obsidian, Notion, or VS Code, or click Download .md to save it directly as a Markdown file.

HTML to Markdown Conversion Reference Cheat Sheet

Our converter supports both standard CommonMark and GitHub Flavored Markdown (GFM) extensions:

Element HTML Input Markdown Output
Headings (H1–H6) <h1>Title</h1> / <h2>Subtitle</h2> # Title / ## Subtitle (or Setext === / ---)
Bold & Italic <strong>Bold</strong> & <em>Italic</em> **Bold** & *Italic* (or __Bold__ & _Italic_)
Strikethrough (GFM) <del>Deprecated</del> or <s>Removed</s> ~~Deprecated~~
Links & Images <a href="https://example.com">Docs</a> [Docs](https://example.com) or [Docs][1]
Task Lists (GFM) <li><input type="checkbox" checked> Done</li> - [x] Done
Fenced Code Blocks <pre><code class="language-js">...</code></pre> ```js ... ``` (automatically detects language class)
HTML Tables (GFM) <table><tr><th>A</th><th>B</th></tr>...</table> | A | B |
| --- | --- |

Why Convert HTML to Markdown?

  • Static Site & CMS Migrations: Effortlessly migrate legacy HTML articles or WordPress exports into Markdown/MDX files for modern frameworks like Astro, Next.js, Hugo, Eleventy (11ty), Docusaurus, and Jekyll.
  • AI & LLM Context Preparation: Converting raw web HTML into clean Markdown strips away DOM wrapper bloat and reduces token counts by 60% to 80% while preserving semantic hierarchy, tables, and code blocks for ChatGPT, Claude, and Gemini prompts.
  • Knowledge Base & Note-Taking Apps: Clip web documentation and save it cleanly into Obsidian, Notion, Logseq, or GitHub Wikis.

Frequently Asked Questions

Does this tool convert HTML <table> elements into Markdown tables?

Yes! When Convert HTML <table> to GFM pipe tables is checked (enabled by default), any HTML table is automatically transformed into a GitHub Flavored Markdown pipe table, including column alignment rules (:---, :---:, ---:) read from align or text-align styles.

What is the difference between ATX and Setext headings?

ATX style uses hash symbols before the heading (# Heading 1 through ###### Heading 6) and is recommended for almost all modern Markdown parsers. Setext style underlines level-1 headings with equals signs (===) and level-2 headings with hyphens (---).

What happens when I uncheck "Preserve hyperlinks"?

Unchecking Preserve hyperlinks removes the URL markup while keeping the clickable anchor text inside your sentence (so <a href="https://example.com">our guide</a> becomes plain our guide rather than disappearing).

How can I convert Markdown back into HTML?

If you need to convert Markdown syntax into HTML code, use our companion Markdown to HTML Converter linked in the Related Tools section below.