Skip to main content
ToolsHub

HTML ↔ Markdown

Paste HTML or Markdown and convert to the other format with a live preview — handled in your browser, nothing uploaded.

Files never leave your browser

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.

  1. Choose the conversion direction: HTML → Markdown or Markdown → HTML.
  2. Paste your HTML or Markdown content into the input field.
  3. Click Convert to transform the content to the target format.
  4. Review the live preview panel to see the rendered result.
  5. 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 ![alt](src)), 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 to Markdown element mapping
HTML elementMarkdown equivalentNotes
<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](url)Alt text from alt attribute
<ul><li>- itemUnordered list
<ol><li>1. itemOrdered list
<pre><code>```language\n...\n```Fenced code block
<blockquote>> textBlock 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

Free · No spam

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

Explore all Developer Tools.