HTML ↔ Markdown
Paste HTML or Markdown and convert to the other format with a live preview — handled in your browser, nothing uploaded.
Conversion runs entirely in your browser — your content is never uploaded.
How to use HTML ↔ Markdown
The HTML ↔ Markdown Converter transforms HTML to clean GitHub-Flavored Markdown and Markdown back to HTML, with a live preview panel showing the rendered output. It uses Turndown for HTML-to-Markdown conversion and marked for Markdown-to-HTML rendering, both loaded dynamically in the browser. Your content is never uploaded — conversion is entirely client-side.
- Choose the conversion direction: HTML → Markdown or Markdown → HTML.
- Paste your HTML or Markdown content into the input field.
- Click Convert to transform the content to the target format.
- Review the live preview panel to see the rendered result.
- Copy the output using the Copy button.
Your data never leaves your device — 100% private processing.
HTML to Markdown: what converts and what does not
Turndown converts the most common HTML elements to Markdown equivalents: headings (h1–h6 to # through ######), paragraphs, bold (strong to **), italic (em to _), links (a to [text](url)), images (img to ), unordered lists (ul/li to -), ordered lists (ol/li to 1.), code (code to backtick, pre/code to fenced code block), horizontal rules (hr to ---), and blockquotes (blockquote to >). HTML-specific constructs without Markdown equivalents — tables (though GFM adds table syntax), forms, scripts, embedded media, iframes, and custom attributes — are either omitted or kept as raw HTML depending on the converter configuration. For rich documents with tables, use GitHub-Flavored Markdown output mode which adds | table | syntax.
| HTML element | Markdown equivalent | Notes |
|---|---|---|
| <h1> to <h6> | # to ###### | ATX-style headings |
| <strong>, <b> | **bold** | Asterisk or underscore |
| <em>, <i> | _italic_ | Underscore style |
| <a href="url"> | [text](url) | Inline link syntax |
| <img src="url"> |  | Alt text from alt attribute |
| <ul><li> | - item | Unordered list |
| <ol><li> | 1. item | Ordered list |
| <pre><code> | ```language\n...\n``` | Fenced code block |
| <blockquote> | > text | Block quote |
Markdown flavours and compatibility
John Gruber's original Markdown specification (2004) was intentionally ambiguous, leading to many incompatible implementations. CommonMark (2014) provides a rigorous, unambiguous specification that most modern parsers follow. GitHub-Flavored Markdown (GFM) extends CommonMark with tables, task lists (- [x] checked), strikethrough (~~text~~), and autolinks. The marked library used in this tool supports GFM by default. When converting content between systems (Notion, Confluence, GitHub, GitLab), verify the target platform's Markdown flavour — for example, Confluence uses its own wiki markup while Notion supports a subset of CommonMark. For documentation sites, MDX (Markdown with JSX) extends Markdown to embed React components.
Glossary
- Markdown
- A lightweight markup language using plain-text formatting conventions that convert to HTML, created by John Gruber in 2004.
- CommonMark
- A strongly defined, unambiguous specification for Markdown aimed at ending parser incompatibilities.
- GFM
- GitHub-Flavored Markdown — a CommonMark extension adding tables, task lists, strikethrough, and autolinks.
- Turndown
- A JavaScript library that converts HTML to Markdown by traversing the DOM and mapping elements to their Markdown equivalents.
- marked
- A fast, standards-compliant Markdown parser and compiler for JavaScript that converts Markdown to HTML.
Related reading
Frequently Asked Questions
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Why use HTML ↔ Markdown?
- No installation — use directly from any browser
- Handles large inputs without crashing or timeouts
- Syntax highlighting and formatted output for readability
- Copy to clipboard shortcut for fast workflow integration
Common use cases
- Validate and format JSON responses from APIs
- Encode/decode Base64 strings during debugging
- Generate UUIDs for database seeds or test data
- Minify CSS or JavaScript before deployment
- Diff two code snippets to spot regressions
Related Developer Tools
Markdown Preview
Write and preview Markdown in real-time. See rendered output alongside your Markdown source with a live side-by-side editor.
HTML Encoder / Decoder
Encode and decode HTML entities online. Escape <, >, &, and quote characters for safe HTML display. Free, instant, and private — runs in your browser.
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Includes syntax highlighting, error detection, and a collapsible tree view — free, private, in-browser.
Regex Tester
Test and debug regular expressions online. See live matches, capture groups, and replace output. Free, private, instant.
Base64 Encoder & Decoder
Encode text or files to Base64, or decode Base64 strings back to text. Fast, free, and runs entirely in your browser.
URL Encoder / Decoder
Encode and decode URLs and URL components online. Convert special characters to percent-encoding and back instantly — free, private, and fast.
Explore all Developer Tools.