HTML to Markdown Converter — Clean, Copy-Ready
Paste HTML and get tidy Markdown back — headings, lists, links, code and tables, reduced to the tags Markdown actually has.
—
What this tool does
It rewrites HTML as Markdown. When you copy a section of a web page, or export from a CMS, you get HTML with its tags and styling; when you want to put that content into a README, a docs site, a wiki or a Markdown editor, you need the same text in Markdown. This tool does that reduction, keeping the headings, lists, links and emphasis and throwing away the parts Markdown cannot express.
What converts, and what is dropped
| HTML | Markdown |
|---|---|
<h1>…</h1> | # … |
<strong> / <em> | **bold** / _italic_ |
<a href> / <img> | [text](url) /  |
<ul><li> | - item |
<pre><code> | fenced ``` block |
| colours, classes, styles | dropped — Markdown has no equivalent |
Why reduce HTML at all
HTML carries presentation as well as meaning: spans with classes, divs for layout, inline styles. Markdown keeps only the meaning — this is a heading, this is a list, this is a link — which is why it is portable across systems and clean to diff in version control. Converting HTML to Markdown is really a funnel from the messy, styled web down to the structural essence, and that is exactly what makes it paste cleanly into a tool that uses a different stylesheet.
What it cannot recover
The conversion is a reduction, and some structure simply has no Markdown equivalent. Knowing which parts are lossy tells you what to check in the output rather than discovering it later:
- Nested lists are flattened. An inner
<ul>inside an<li>comes out as plain text appended to the parent item, because the conversion works by matching tag pairs rather than walking a tree. Two-level menus and outlines need their indentation restored by hand. - Ordered lists keep their numbers, with one caveat.
<ol>,startandreversedall convert to numbered Markdown. CommonMark renumbers from the first item's number, so a list that starts at 3 renders as 3, 4, 5 in most parsers but as 1, 2, 3 in a strict one — the numbers are written out correctly either way. - Tables lose their alignment and multi-line cells. The first row becomes the
header whether it held
<th>or<td>, every column is left aligned, androwspan/colspanare dropped — the cells that were merged simply do not exist in the output. - Definition lists, figures, captions and details are reduced to text. The words survive; the semantics that told a reader these words were a caption or a collapsible section do not.
- Inline HTML is not preserved verbatim. A
<span style>, a<sup>or a custom element is stripped to its text. If you need raw HTML passed through, this is the wrong converter.
Why the output looks different from the page
Two conversions happen at once. The first is structural — tags become Markdown syntax. The second
is textual: HTML entities are decoded (& becomes &,
becomes a space) so the Markdown contains the character, not its escape.
That is what you want in almost every case, but it does mean an entity that was deliberately written
to be escaped becomes a bare character.
Whitespace is normalised at the end: trailing spaces on a line are removed and runs of three or more
newlines collapse to one blank line. Markdown treats those as cosmetic, but a hard line break in
Markdown needs two trailing spaces, so any <br> that became a plain
newline will render as a space in most parsers rather than a break. Where the break mattered, add
the two spaces or a backslash at the end of the line.
Getting a better result
The single biggest improvement is to paste less. A whole page's HTML includes navigation, footers and cookie banners, all of which convert to text you then delete. Selecting just the article body in the browser's inspector, or copying the rendered article rather than the page source, gives the converter only the content you actually want.
The second is to paste clean HTML. Content exported from a CMS is often a nest of wrapper
<div>s around single paragraphs; the converter keeps the text and discards the
nesting, so the result is usually fine, but it cannot tell a layout wrapper from a meaningful
section. If the output has stray sentences in the wrong place, the cause is almost always a wrapper
that was not closed where you expected.
Privacy
Pasting HTML into a converter often means pasting an unpublished article, an internal email or a client's copy. This page never uploads it: the parsing and rewriting happen in your browser and nothing is sent to a server.
Frequently asked questions
What does this converter handle?
The elements that appear in content people actually paste: headings, paragraphs, bold and italic, inline code and code blocks, links, images, bulleted and numbered lists, blockquotes, horizontal rules and tables. Anything it does not recognise is reduced to its text rather than dropped, so you never lose the words.
Is the Markdown lossless?
No — Markdown expresses less than HTML, so styling that has no Markdown equivalent (colours, classes, inline styles, divs for layout) is not carried over. The conversion keeps the structure and the text, which is what you want when moving an article into a README, a docs site or a Markdown editor.
Why did my table come out wrong?
The converter reads standard table markup (`<table><tr><th scope="col">…`). A table built out of divs, or one with cells that span columns, has no simple Markdown form and is best cleaned up by hand. Ordinary tables convert cleanly, with the first row treated as the header.
Can I go the other way?
Yes — the Markdown to HTML tool renders in the opposite direction, and the Markdown Table Generator builds tables from scratch.
Is my HTML uploaded?
No. The conversion is pure text processing in your browser; nothing is sent anywhere. That matters when you are converting a page that contains unpublished copy or customer data.
Does it keep line breaks?
A literal newline in HTML is collapsed by the browser, so a `<br>` becomes a newline and paragraph tags become blank-line-separated blocks. Runs of more than two blank lines are tidied to two, which is the Markdown convention.
Go deeper
Longer explanations of the problems this tool solves:
Sources
- CommonMark Spec — the Markdown syntax this targets.
Everything runs in your browser — nothing you type is uploaded.