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.
Markdown output will appear here
Paste HTML in the input panel and it converts automatically
Load sample data to get started
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
Methodology and approach
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.
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.
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.
<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># 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 scriptThe 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 , 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.
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 &, < and " are decoded to the characters a browser would render, and less common named or numeric references are copied through unchanged.
<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>## 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 |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.
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.
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.
Common questions about this tool