HTML to Markdown Converter

Convert HTML to clean Markdown — supports tables, code blocks, links, and images

Markdown output will appear here...

What is HTML to Markdown Converter?

HTML is the structural language of the web — every web page, email template, and rich-text editor outputs HTML. Markdown is a lightweight plain-text format used in GitHub READMEs, Notion, Obsidian, Ghost CMS, documentation sites, and static site generators. Converting HTML to Markdown lets you take existing web content — blog posts, documentation, email templates — and use it in any Markdown-based system without manual rewriting. This converter handles all common HTML elements including headings, bold and italic text, links, images, ordered and unordered lists, tables, code blocks with language hints, and strikethrough text. It also strips script and style tags, decodes HTML entities, and produces clean GitHub Flavored Markdown.

How to Use

  1. Paste your HTML code into the left panel — you can paste a full HTML document or just a fragment.
  2. Click "Convert" to transform the HTML into Markdown.
  3. Review the output in the right panel and copy it to your clipboard.
  4. Use "Load Sample" to see how different HTML elements convert to Markdown syntax.

Why Use This Tool?

Converts all common HTML elements: headings, bold, italic, links, images, lists, tables, and code blocks
Preserves code fences with language hints extracted from class="language-*" attributes
Decodes HTML entities (&, <, >,  , numeric entities) into their proper characters
Strips script, style, and invisible tags automatically so only content remains
Pure browser-based processing — your content never leaves your machine

Tips & Best Practices

  • For cleaner output, paste only the <body> content rather than a full <html> document with head and meta tags.
  • Deeply nested HTML (tables inside lists, divs inside paragraphs) may not convert perfectly — review the output.
  • Inline CSS (style="...") and class attributes are stripped since Markdown has no concept of styling.
  • Use a Markdown preview tool after converting to verify the final rendering looks correct.
  • The output is GitHub Flavored Markdown (GFM) compatible, so it works in GitHub, GitLab, and most Markdown renderers.

Frequently Asked Questions

How are HTML elements mapped to Markdown syntax?

Headings (h1-h6) become # markers, <strong> and <b> become **bold**, <em> and <i> become *italic*, <a> becomes [text](url), <img> becomes ![alt](src), <ul>/<li> becomes - items, <ol>/<li> becomes 1. items, <code> becomes `backticks`, <pre><code> becomes fenced code blocks, <table> becomes pipe tables, and <del> becomes ~~strikethrough~~.

When should I NOT use this converter?

Avoid this tool when your HTML uses features that Markdown cannot represent — such as complex layouts with CSS Grid or Flexbox, embedded iframes, interactive forms, or deeply nested div structures with semantic meaning. Also, HTML with extensive inline styles will lose all visual formatting in the Markdown output.

Does this support GitHub Flavored Markdown (GFM)?

Yes. The output uses GFM syntax: ~~strikethrough~~ for <del>, pipe tables for <table>, and fenced code blocks with language hints. It is compatible with GitHub READMEs, GitLab, and any renderer that supports GFM.

Why does my table look different after conversion?

Markdown tables require all rows to have the same number of cells, and complex HTML tables with colspan, rowspan, or nested tables cannot be faithfully represented in Markdown. The converter outputs a best-effort table; you may need to manually adjust merged cells or split complex tables.

What happens to inline CSS and class attributes?

CSS classes, IDs, and inline styles are stripped during conversion — Markdown has no concept of styling. The semantic meaning (heading level, bold, italic) is preserved but all visual styling is lost.

Is my content sent to any server?

No. All conversion runs entirely in your browser. Your HTML content and the generated Markdown never leave your device. No data is collected, stored, or transmitted to any server.

Real-world Examples

Blog Post HTML to Markdown

Convert an HTML blog post into Markdown for a static site generator like Hugo or Jekyll.

Input
<h1>Getting Started with JWT</h1>
<p>JSON Web Tokens (<strong>JWT</strong>) are a compact way to represent claims.</p>
<h2>Structure</h2>
<ul>
  <li><strong>Header</strong> — algorithm and token type</li>
  <li><strong>Payload</strong> — the claims data</li>
  <li><strong>Signature</strong> — verifies integrity</li>
</ul>
Output
# Getting Started with JWT

JSON Web Tokens (**JWT**) are a compact way to represent claims.

## Structure

- **Header** — algorithm and token type
- **Payload** — the claims data
- **Signature** — verifies integrity

API Docs Table to Markdown

Convert an HTML table from API documentation into a Markdown table for a README.

Input
<h2>API Endpoints</h2>
<table>
  <tr><th>Method</th><th>Path</th><th>Description</th></tr>
  <tr><td>GET</td><td>/api/users</td><td>List all users</td></tr>
  <tr><td>POST</td><td>/api/users</td><td>Create a user</td></tr>
  <tr><td>DELETE</td><td>/api/users/:id</td><td>Delete a user</td></tr>
</table>
Output
## API Endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /api/users | List all users |
| POST | /api/users | Create a user |
| DELETE | /api/users/:id | Delete a user |

Related Tools