MDConverter
Universal In-Browser Converter
100% Client-Side Private

Convert HTML to Clean Markdown

Paste HTML, drop a saved .html page or copy straight from a website. Headings, tables, code and links come out as clean GitHub Flavored Markdown — and for whole pages, only the main content is kept, ready for ChatGPT, Claude, docs or notes.

  • Free, no watermark
  • No sign-up
  • Files never leave your browser
Try an example:
Paste HTML code, or copy content from any web page and paste it here. Runs in your browser. Nothing is uploaded.
Input · HTML
Result · Markdown
# Migrating to Distributed Systems

Transitioning from monolithic services to **event-driven microservices** requires robust idempotency controls.

**Note:** Always enforce database constraints alongside application-level checks.

## System Health Metrics

| Cluster Region | Avg Latency | Throughput |
| --- | --- | --- |
| us-east-1 | 12ms | 42,000 rps |
| eu-central-1 | 18ms | 28,500 rps |

## Sample Invalidation Worker

```typescript
async function handleEvent(event: CacheEvent): Promise<void> {
  await redis.del(event.key);
  console.log(`Invalidated ${event.key}`);
}
```

Learn more in our [developer guide](https://docs.example.com).
Words:81
Characters:1,131
Read time:~1 min
Headings:3
AI tokens:~108
Updates as you type
HTML → Markdown
Quick Tutorial

How to Convert HTML to Markdown in 3 Simple Steps

No installation or registration required. Follow these steps to convert and export your files in seconds.

1

Paste or drop

Paste HTML or copied web content, or drop a saved .html file.

2

Check the options

Keep “Main content only” for whole pages, or convert the whole page.

3

Copy or download

Copy the Markdown or download it as a .md file.

Real output, not a mock-up

HTML to Markdown: Example Conversion

The output below was generated by the same converter that runs in the tool above, from one of its built-in samples. Load that sample in the editor to try your own changes.

Input — HTML
<!-- wp:heading {"level":2} -->
<h2>Top 5 Tools for Software Architecture</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Modern software architects rely on <strong>lightweight documentation</strong> rather than 200-page specifications.</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol>
  <li><strong>Markdown:</strong> Standardized, Git-trackable documentation.</li>
  <li><strong>Mermaid.js:</strong> Diagramming as code.</li>
  <li><strong>OpenAPI:</strong> REST contract generation.</li>
</ol>
<!-- /wp:list -->
Output — Markdown
## Top 5 Tools for Software Architecture

Modern software architects rely on **lightweight documentation** rather than 200-page specifications.

1. **Markdown:** Standardized, Git-trackable documentation.
2. **Mermaid.js:** Diagramming as code.
3. **OpenAPI:** REST contract generation.

Known Limitations of HTML to Markdown

What this converter does not do (yet), and what to do instead.

  • Rowspan and tables nested inside tables cannot be expressed in Markdown and may come out misaligned.
  • Styling (colours, fonts, underline, superscript) is dropped; only structure, emphasis, links and code are kept.
  • Embedded media (video, iframes, interactive widgets) is removed.
  • When you paste HTML source, relative links such as /img/a.png stay relative because the page address is unknown.
  • “Main content only” works from the page structure; on unusual layouts check the preview and switch to “Whole page” if something you need is missing.
Syntax Cheat Sheet & Translation Guide

HTML ↔ Markdown Syntax Cheat Sheet & Reference Guide

Side-by-side syntax comparison and quick reference guide. Look up how headings, code blocks, tables, and typography elements translate between HTML and Markdown. Click any snippet to copy.

Syntax ElementHTML SourceMarkdown EquivalentBehavior & Notes
Headings
<h1>Title</h1> <h2><a href="#setup">Setup</a></h2>
# Title ## Setup
Heading levels map one to one; #permalink links on headings are dropped.
Tables
<tr><th colspan="2">Plan</th></tr> <tr><td>Pro</td><td><ul><li>A</li><li>B</li></ul></td></tr>
| Plan | | | --- | --- | | Pro | A<br>B |
Lists, paragraphs and line breaks inside a cell are joined with <br>; a header spanning columns is padded so no cell is lost.
Code blocks
<pre class="brush: python"><code>print(1)</code></pre>
```python print(1) ```
The language is read from language-x, lang-x, highlight-source-x, brush: x or data-language.
Lists
<ol><li>One<ul><li>Sub</li></ul></li></ol>
1. One - Sub
Nested lists are indented so every Markdown renderer nests them correctly.
Links and images
<a href="/docs?utm_source=x" title="Opens in new tab">Docs</a> <img data-src="/a.png" alt="Chart">
[Docs](/docs) ![Chart](/a.png)
In “Main content only” mode, tracking parameters, tooltips and icon-only links are removed and lazy-loaded images use their real address.
Layout and page furniture
<nav>…</nav> <div class="cookie-banner">…</div> <main><p>Text</p></main> <footer>…</footer>
Text
Whole pages keep only the main content. Choose “Whole page” in Options to convert everything.
Showing 6 syntax mappings← Swipe to view full table →
Format Comparison Matrix

HTML vs. Markdown — Deep Feature Analysis

Understanding the architectural trade-offs, ecosystem compatibility, and optimal workflows for each format.

Evaluation DimensionHTML CharacteristicsMarkdown CharacteristicsVerdict
Reading and editingTags, classes and inline styles around every linePlain text with light # and ** markersMarkdown is easier to read, edit and review
Feeding a page to an LLMMarkup, scripts and menus use up the context windowOnly the article text and its structureConvert before pasting a page into ChatGPT or Claude
Version controlDiffs full of attribute and wrapper changesLine-by-line prose diffsMarkdown for docs that live in Git
Layout and stylingExact colours, columns and fontsStructure only (headings, lists, tables, emphasis)Keep the HTML when the visual design matters
4 architectural dimensions evaluated← Swipe to compare →

When to Use HTML

Best for fast, distraction-free drafting, Git version-controlled documentation, developer pull requests, and multi-format source authoring.

When to Convert to Markdown

Best for delivering formal client assets, corporate stakeholder review, publication on specialized platforms, or high-fidelity visual presentation.

Real-World Workflows

Who Relies on HTML to Markdown?

Explore how engineering teams, technical writers, and data analysts streamline daily operations.

People using ChatGPT, Claude and other LLMs

Turning a web page into clean context

Save the page (Ctrl+S / Cmd+S), drop the .html file here and paste the Markdown into your prompt. Menus, cookie banners and footers are gone, so the model reads only the article — with its headings and tables intact.

Impact: More of the context window spent on the content you care about.
Developers building RAG pipelines

Preparing scraped pages for chunking

Check how a page will look as Markdown before writing the scraper rules, or convert a handful of pages by hand. Headings make natural chunk boundaries, and tables stay as rows and columns.

Impact: Cleaner chunks and fewer tokens spent on markup.
Writers and site owners

Moving posts from WordPress or another CMS to Markdown

Paste the post HTML (WordPress block comments are ignored) and get a .md file for Astro, Hugo, Jekyll, Docusaurus or a GitHub README.

Impact: No manual clean-up of wrapper divs and inline styles.
Best Practices & Pitfalls

Pro Tips & Edge Cases Handled for HTML to Markdown

Practical advice for achieving high-fidelity conversions and resolving syntax edge cases.

Developer Pro Tips

  • Copying from a website? Select the text, copy, and paste here: the editor reads the page’s HTML from the clipboard, not just the plain text.
  • For a whole page, enter its address in URL to Markdown, or save it with Ctrl+S (Cmd+S) and drop the .html file here. “Main content only” in Options is on by default.
  • Need the navigation and footer too? Switch Options › Content to “Whole page”.
  • Converting a Word document? Word to Markdown reads the .docx directly and keeps more of the structure than its HTML export.
  • Leaving Notion? Notion to Markdown cleans a whole Markdown export, including the links between pages.

Edge Cases Resolved Automatically

⚠️ Lists or paragraphs inside table cells
Resolution: GFM cells are single lines, so the parts are joined with <br>, which GitHub and most renderers show as a line break.
⚠️ A table heading that spans several columns
Resolution: The header row is padded to the table’s width so no column is cut off.
⚠️ Code that itself contains ``` fences
Resolution: The code block uses a longer fence (````) so the inner backticks stay part of the code.
⚠️ Lazy-loaded images with a placeholder src
Resolution: The real address from data-src is used, made absolute when the page address is known.
Sister Platform ToolkitMarkdownTables.com

Converting HTML Table Elements to Markdown?

MDConverter converts full HTML documents and web articles. If you only need to paste raw HTML <table> snippets and clean up column alignments, try our sister tool MarkdownTables.com.

Open HTML Table to Markdown
Sister ToolMarkdownPreview.net

Preview Your Converted Markdown Before Using It

After converting HTML back to Markdown, verify it renders correctly using MarkdownPreview.net — a live in-browser Markdown renderer that shows you the final output in seconds.

Open Markdown Previewer
Frequently Asked Questions

Frequently Asked Questions About HTML to Markdown

Comprehensive answers to common technical, formatting, security, and compatibility questions.

Save the page with Ctrl+S (Cmd+S on Mac), drop the .html file onto the editor and copy the result into your chat. “Main content only” is on by default, so menus, cookie banners and footers are left out and the model reads just the article. For a single section, select it on the page, copy, and paste it here instead. Or skip the download: URL to Markdown fetches the page from its address.

Under The Hood

How the HTML to Markdown Engine Works

Every step below runs in your browser tab; your content is never sent to a server.

01

Lexical Tokenization

Raw HTML stream is parsed into syntax tokens with boundary and nesting validation.

02

AST Tree Construction

Tokens are mapped into a standardized in-memory Abstract Syntax Tree structure.

03

Semantic Translation

AST nodes are translated into compliant Markdown elements, headings, and tables.

04

Client-Side Serialization

Output is generated directly in your browser, so it is ready to copy or download immediately.

Pipeline Architecture Specification

For a whole page, the converter first finds the main content (the <main> or <article> element, or the block with the most paragraph text) and removes navigation, sidebars, forms, cookie and share bars, headers and footers. It cleans links and images, then converts the HTML to GitHub Flavored Markdown with Turndown and its GFM plugin, using custom rules for code languages, nested lists and table cells. Snippets are converted as they are. Everything runs in your browser.

Processing Engine
Main-content extraction + Turndown with GFM rules (in your browser)
Specification Standards
HTML5 → GitHub Flavored Markdown
Execution Latency
Instant for snippets; well under a second for long articles
Privacy SLA
100% client-side (nothing is uploaded)

Why Choose MDConverter for HTML to Markdown?

Keeps only the main content of whole web pages (or the whole page, if you choose)
Tables become GFM pipe tables, including cells with lists and spanning headers
Code blocks keep their language from common highlighter classes
Removes scripts, styles, forms, menus, cookie banners and tracking parameters
Paste rich text from any website, paste HTML source, or drop an .html file

100% Client-Side Privacy & Security Guarantee

Unlike online converters that upload your files to a remote server, MDConverter runs every conversion with JavaScript inside your browser tab. Your documents are never uploaded, so they never leave your machine.

Documents & Office Files

Move Markdown in and out of Word, PDF, PowerPoint, EPUB, OneNote, RTF, HTML, plain text and images.

Reverse directionMarkdown to HTML ConverterConvert Markdown to Clean, Semantic HTML5Also usefulWord to Markdown ConverterConvert Word Documents (.docx) to Clean MarkdownAlso usefulPDF to Markdown ConverterConvert PDF to Markdown: Clean, Structured Text for Docs and AIAlso usefulRTF to Markdown ConverterConvert Rich Text Format (RTF) Documents to Clean MarkdownAlso usefulPowerPoint to Markdown ConverterConvert PowerPoint to Markdown Online (.pptx & .ppt to .md)Also usefulEPUB to Markdown ConverterConvert EPUB E-books to Markdown

Guides & lessons for this converter

Browse all Markdown converters