HTML to Markdown Converter
Paste HTML, get clean Markdown — headings, links, images, tables, code blocks, lists — copy or download as .md
Conversion Options
1,058 characters
718 characters
You copy a section from a documentation site and need it in Markdown for your project’s README. The clipboard gives you raw HTML with <p>, <a href="...">, <code>, and <ul><li> tags. You could manually strip the tags and reformat, or you could paste the HTML and get clean Markdown in one click — headings, links, code blocks, and lists all correctly converted.
Why This Tool (Not the HTML to Markdown Converter)
PureDevTools has two HTML-to-Markdown tools. This one is the quick conversion tool — paste HTML, get Markdown, download as .md. The HTML to Markdown Converter gives you full control over output style (ATX vs setext headings, inline vs reference links, fence style). Use this tool for fast one-off conversions; use the other when you need style consistency across documents.
What Is HTML to Markdown Conversion?
HTML (HyperText Markup Language) and Markdown are both ways to express formatted text, but they serve different audiences. HTML is verbose and designed for browsers; Markdown is concise and designed for humans who want to write and read structured text without visual clutter.
Converting HTML to Markdown is useful when you need to:
- Migrate documentation from a CMS or static site generator to a Markdown-based system
- Extract readable text from web pages for editing in a Markdown editor
- Clean up copy-pasted HTML from emails, websites, or word processors
- Prepare content for GitHub READMEs, GitLab wikis, or Notion pages
- Archive web content in a portable, human-readable format
How the Converter Works
This tool parses your HTML input using the browser’s built-in DOM parser — the same engine that renders web pages — then walks the element tree and applies conversion rules for each HTML tag. All processing runs entirely in your browser; no HTML content is ever sent to a server.
Supported HTML Elements
| HTML Element | Markdown Output |
|---|---|
<h1> to <h6> | # to ###### prefix |
<p> | Paragraph separated by blank lines |
<strong>, <b> | **bold** |
<em>, <i> | _italic_ |
<del>, <s> | ~~strikethrough~~ |
<a href="…"> | [text](url) |
<img src="…" alt="…"> |  |
<code> (inline) | `code` |
<pre><code> | Fenced code block with language |
<ul> / <li> | - item (configurable bullet) |
<ol> / <li> | 1. item, 2. item, … |
<blockquote> | > quoted text |
<table> | Markdown pipe table |
<hr> | --- |
<br> | Line break ( \n) |
Language Detection in Code Blocks
When a <pre><code> element has a class like language-typescript or language-python (the convention used by Prism.js and Highlight.js), the converter detects the language identifier and uses it in the fenced code block:
<pre><code class="language-typescript">const x = 1;</code></pre>
becomes:
```typescript
const x = 1;
```
Table Conversion
The converter fully supports HTML tables with <thead>, <tbody>, <th>, and <td> elements. If a table has no <thead>, the first <tr> row is treated as the header automatically.
Example input:
<table>
<thead>
<tr><th>Name</th><th>Role</th></tr>
</thead>
<tbody>
<tr><td>Alice</td><td>Engineer</td></tr>
<tr><td>Bob</td><td>Designer</td></tr>
</tbody>
</table>
Converted output:
| Name | Role |
| --- | --- |
| Alice | Engineer |
| Bob | Designer |
Pipe characters inside cells are automatically escaped as \| to prevent breaking the table structure.
Conversion Options Explained
Headings
When enabled (default), <h1> becomes # Heading, <h2> becomes ## Heading, and so on. When disabled, headings are converted to bold text instead, which is useful when the Markdown destination does not support heading levels.
Links
When enabled (default), <a href="https://example.com">text</a> becomes [text](https://example.com). Link titles (the title attribute) are preserved. When disabled, only the link text is emitted.
Images
When enabled (default), <img src="logo.png" alt="Logo"> becomes . When disabled, only the alt text is included.
Code Blocks
When enabled (default), inline <code> becomes backtick-wrapped code, and <pre><code> blocks become fenced code blocks. When disabled, code content is included as plain text.
Tables
When enabled (default), <table> elements are converted to Markdown pipe tables. When disabled, table cells are flattened into plain text.
Blockquotes
When enabled (default), <blockquote> elements are prefixed with > on each line. When disabled, blockquote content is included as regular paragraphs.
Bullet Character
The bullet character for unordered list items. Options are - (dash, default), * (asterisk), and + (plus). All three are valid Markdown; choose based on your team’s style guide or target renderer.
Nested Lists
The converter handles nested <ul> and <ol> elements by tracking indentation depth. A nested list item is indented by two spaces per level, following the CommonMark specification:
<ul>
<li>Level 1
<ul>
<li>Level 2</li>
</ul>
</li>
</ul>
becomes:
- Level 1
- Level 2
HTML Entities
HTML entities like &, <, >, ", , —, …, and numeric entities like © are decoded to their Unicode equivalents in the Markdown output. This ensures that converted content displays correctly in all Markdown renderers without requiring HTML-aware rendering.
What Is Not Converted
Some HTML elements do not have direct Markdown equivalents and are handled as follows:
<script>and<style>— content is silently removed (scripts and stylesheets have no Markdown representation)<noscript>— content is removed- CSS classes and inline
styleattributes — ignored (Markdown has no styling mechanism) <form>elements — rendered as plain text blocks (form controls have no Markdown equivalent)idandclassattributes — ignored
If you need to preserve these elements, consider using the HTML source directly.
Frequently Asked Questions
Does this tool send my HTML to a server?
No. All conversion happens in your browser using the built-in DOM parser. Your HTML content never leaves your device.
Can I convert large HTML documents?
Yes. The converter processes the entire input in a single pass. Performance depends on your device; typical HTML pages (under 1 MB) convert in under 100 ms.
What flavor of Markdown does the output use?
The output follows CommonMark-compatible Markdown, which is supported by GitHub, GitLab, Notion, Obsidian, VS Code, and most modern Markdown renderers. GFM (GitHub Flavored Markdown) tables are used for table conversion.
Why does the output have extra blank lines?
Block-level elements like headings, paragraphs, lists, and tables are separated by blank lines, which is required by the CommonMark specification for correct rendering. The normalizer removes more than two consecutive blank lines.
How do I convert just part of an HTML page?
Paste only the HTML fragment you want to convert — a specific <article>, <div>, or list of tags. The tool handles fragments without a full <html>/<head>/<body> wrapper.
Can I download the result as a file?
Yes. Click the Download .md button to save the Markdown output as a .md file. The filename defaults to output.md.