Skip to content
CALZYRA— TOOLS THAT EMPOWER —
FinanceInvestmentsHealthMathBlog
CALZYRA— TOOLS THAT EMPOWER —

Practical calculators and online tools, made to be simple and useful.

Popular Categories

  • Finance
  • Health & Fitness
  • Mathematics
  • Physics
  • Construction
  • Conversion

Finance Tools

  • Loan Calculators
  • Investment Calculators
  • Compound Interest
  • SIP Calculator
  • ROI Calculator
  • CAGR Calculator

Top Calculators

  • Mortgage Calculator
  • BMI Calculator
  • Percentage Calculator
  • Calorie Calculator
  • Tip Calculator

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 Calzyra. All rights reserved.

Free tools for everyday calculations, learning, and practical work.
HomeDeveloper ToolsXML & HTMLHTML to Markdown Converter
Developer ToolXML & HTML

HTML to Markdown Converter Online

Convert HTML to Markdown online with Calzyra. Paste HTML code and get clean Markdown with headings, lists, links, images, quotations and code blocks preserved, ready to copy into docs, READMEs and CMS editors.

Updated 2026-10-174 min readCalzyra Developer Tools Team
HTML to Markdown Converter
html
1
2
3
4
5
6
<h1>Welcome</h1>
<p>This is a <strong>sample</strong> HTML document.</p>
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>
6 lines119 chars13 wordshtml

Markdown output will appear here

Paste HTML in the input panel and it converts automatically

Ctrl+Enter RunCtrl+L ClearEsc Exit fullscreen

Quick Examples

Load sample data to get started

Supported Features

What this tool can do

📑

Headings & Paragraphs

h1 through h6 become # to ###### Markdown headings

📋

Lists Preserved

Ordered, unordered and nested lists keep their structure

🔗

Links & Images

URLs and alt text are carried into Markdown syntax

✨

Emphasis & Code

Bold, italic, inline code and fenced code blocks

💬

Quotes & Rules

Blockquotes become > lines; hr becomes a horizontal rule

▦

Tables Converted

HTML tables become pipe tables with a header row

📄

Copy & Download

Copy the Markdown or download it as a .md file

⚠️

Real HTML Parsing

Unreadable markup reports the error instead of bad output

How It Works

Methodology and approach

Parse the markup and map each element to Markdown

The converter parses the HTML with an HTML-aware parser, then walks the tree: headings, emphasis, links, images, nested lists, blockquotes, code fences and tables are written in Markdown syntax, entity references are decoded, and layout containers are unwrapped so their text is kept.

What is an HTML to Markdown converter?

HTML is the markup a browser renders: elements carry classes, styles and layout roles, and the meaning of the page is spread across that structure. Markdown is the plain-text syntax used for README files, documentation, notes, commit messages and the editors of most static-site generators and knowledge bases: a hash for a heading, asterisks for emphasis, brackets for a link.

An HTML to Markdown converter reads an HTML document and rewrites that structure in Markdown syntax, so content that lives in a web page - an article, a help center export, a CMS entry - can move into a Markdown-based workflow without being retyped by hand. This tool parses the markup with an HTML-aware parser rather than stripping tags with patterns, then maps each element it finds onto the Markdown equivalent while keeping the text, the link targets and the image sources intact.

How to convert HTML to Markdown online

Paste the HTML into the input panel on the left. The document is parsed and converted automatically as you type, and Ctrl+Enter forces a re-run at any time. The generated Markdown appears in the output panel on the right, with a status line reporting how many elements were converted and how many lines of Markdown were produced.

If the markup cannot be read - a start tag with no closing bracket, an attribute quote that is never closed - the output panel clears and reports the parser error with its line and column instead of showing stale Markdown. Your input is left exactly as it was, so you can fix the problem in place and the conversion updates on its own. Empty input simply clears the output; nothing is uploaded, and the conversion runs entirely in your browser.

When the result looks right, Copy puts the Markdown on the clipboard and Download saves it as output.md. Everything runs in your browser; nothing is uploaded.

HTML input
<h1>Getting Started</h1>
<p>Welcome to the <strong>quick start</strong> guide. Read the <a href="https://example.com/docs">full documentation</a> after this page.</p>
<ul>
  <li>Install the package</li>
  <li>Run the setup script</li>
</ul>
Markdown output
# Getting Started

Welcome to the **quick start** guide. Read the [full documentation](https://example.com/docs) after this page.

- Install the package
- Run the setup script

Which HTML elements become Markdown?

The structures Markdown can express are mapped one to one. Headings h1 through h6 become # through ###### prefixes. Paragraphs become separate text blocks. Strong and b become **bold**, em and i become *italic*, and del becomes ~~struck through~~. Links become [text](url) with their href preserved - and a title attribute, when present, rides along in the destination. Images become ![alt](src), keeping both the alternative text and the source URL.

Lists keep their shape: ul becomes dashes, ol becomes numbers (including a custom start value), and a list nested inside a list item stays nested, indented under its parent the way Markdown readers expect. Blockquotes become lines prefixed with >, horizontal rules become ---, and inline code becomes a backtick span - with a longer delimiter automatically chosen when the code itself contains backticks.

How are code blocks, tables and entities handled?

A pre element - usually pre wrapping code - becomes a fenced code block. The fence is always at least three backticks and lengthens when the code contains backticks of its own, and a class such as language-js on the code element becomes the language tag on the opening fence, so syntax highlighters on the other side still recognize it.

Tables become pipe tables: the first row fills the header row Markdown requires, a separator of dashes follows it, and every remaining row is written beneath. Pipes inside a cell are escaped so they cannot break the table apart. HTML entity references such as &amp;, &lt; and &quot; are decoded to the characters a browser would render, and less common named or numeric references are copied through unchanged.

HTML input
<h2>Usage</h2>
<p>Call the converter with your HTML string:</p>
<pre><code class="language-js">const markdown = convert(html);</code></pre>
<blockquote><p>Keep your source HTML well-formed for the best results.</p></blockquote>
<table>
  <thead><tr><th>Option</th><th>Default</th></tr></thead>
  <tbody><tr><td>gfm</td><td>true</td></tr></tbody>
</table>
Markdown output
## Usage

Call the converter with your HTML string:

```js
const markdown = convert(html);
```

> Keep your source HTML well-formed for the best results.

| Option | Default |
| --- | --- |
| gfm | true |

Why convert HTML to Markdown?

Documentation is the common case: README files, docs sites, runbooks and engineering notes are written in Markdown, and the content being migrated often starts life as HTML - a CMS export, a published blog post, a wiki page. Converting removes the presentational markup and leaves the structure a Markdown editor can work with.

It is also the shortest path into any Markdown-based publishing workflow: static-site generators, knowledge bases, note applications and most modern editor toolbars accept Markdown directly. Pasting rendered HTML into those editors usually arrives as unstyled text with the links and emphasis stripped; converting the source HTML first keeps all of it.

What cannot be converted to Markdown?

Markdown describes documents, not layouts. CSS classes, inline styles, grid and flex containers, custom data attributes and interactive elements such as buttons and forms have no Markdown syntax, so their wrappers are unwrapped and only the text inside them is carried through. Embedded scripts and styles are not content and are left out of the output, along with comments, the doctype and the document head.

Tables with merged cells lose their merges - Markdown pipe tables are a plain grid - and a table without any header row still gets one, because the syntax requires it. Complex nested layouts may need a pass of manual cleanup after conversion; that is the nature of moving between a rendering format and a writing format rather than a flaw in this tool. Markup that cannot be parsed at all is reported with its position instead of being partially converted, so the output is never quietly wrong.

When should you use an HTML to Markdown converter?

Migrating published articles or help-center pages into a Markdown CMS or a docs site. Turning a page of rendered HTML into a README or an engineering note. Cleaning up HTML copied from a browser or exported from a CMS before pasting it into an editor that speaks Markdown. Preparing content for commit messages, issues and pull-request descriptions, where Markdown is the only formatting available.

It is the wrong tool when the goal is plain text with no syntax at all - that is stripping, and the HTML to Text converter is the page for it - or when the document needs its layout preserved, which Markdown cannot do. For moving structured HTML content into Markdown files, this is the shortest path.

Related tools

  • Need to clean up or re-indent the HTML before converting it?HTML Formatter
  • Need to check the markup against HTML rules before migrating it?HTML Validator
  • Only need the plain text with no Markdown syntax at all?HTML to Text Converter
  • Working with an XML document instead of HTML? The XML to JSON converter preserves its hierarchy.XML to JSON Converter

Frequently Asked Questions

Common questions about this tool

XML & HTML Tools

XML FormatterXML ValidatorXML MinifierXML to JSON ConverterXML to CSV ConverterHTML FormatterHTML MinifierHTML ValidatorHTML to Markdown ConverterHTML Entity EncoderHTML Entity DecoderHTML to Text ConverterXML Tree ViewerXML XPath TesterHTML Meta Tag Generator

Related Tools

XML Formatter

Format and prettify XML documents

XML Validator

Validate XML syntax and structure

XML Minifier

Minify XML by removing whitespace

XML to JSON Converter

Convert XML to JSON format

Quick Links

All Developer ToolsXML & HTML Category