HTML to Markdown

Turn HTML into readable Markdown — the fastest way to rescue content out of a CMS or a web page.

Processed on your device — no upload

termiva html2md page.html
0 chars

Scripts, styles and attributes with no Markdown equivalent are dropped — that is the point. Paste an article out of a CMS and what comes back is the content without the wrapper.

0 chars
converter loading…in 0 Bout 0 Bnothing uploaded

How to use it

  1. Paste the HTML, or choose a file.
  2. Pick a heading style and list marker.
  3. Copy the Markdown.

How it works

The HTML is parsed into a document tree and walked, with each element mapped to its Markdown equivalent. Working from the parsed tree rather than from the text is what makes the result reliable: a regular expression that strips tags cannot tell a < inside a code block from the start of an element.

Everything without a Markdown equivalent is dropped, and that is the point. Classes, inline styles, wrapper divs, tracking attributes and scripts all disappear, because Markdown has no way to express them. What survives is the content: headings, paragraphs, emphasis, lists, links, images, quotes and code.

This is why the tool is most useful as a cleaner. Content copied out of a word processor or an old CMS arrives wrapped in layers of markup that fight whatever you paste it into. A round trip through Markdown strips all of it.

Heading style is offered because the two forms behave differently in practice. # Heading works at every level and survives being reflowed; the underlined form only exists for the top two levels.

A worked example

You are migrating fifty articles out of an old CMS. Each one comes wrapped in nested divs, inline styles and classes that mean nothing in the new system.

Press Load a sample to see the shape of it. The <article> wrapper vanishes, the heading becomes # Release notes, the <strong> becomes **compress**, the list becomes hyphens, and the blockquote becomes a > line. What is left is the content.

The migration trick worth knowing: convert to Markdown and then back to HTML. The result is clean semantic markup carrying exactly the same content, with every trace of the old system's styling gone. It is the fastest reliable way to strip a page back to its meaning.

What does not survive: layout. Multi-column arrangements, floated images, tables used for positioning and anything depending on CSS come out as a linear document. That is not a limitation to work around — Markdown describes structure, not appearance, and if the layout carried meaning it needs rebuilding rather than converting.

Questions

How do I strip tags from HTML content?

Converting to Markdown keeps the structure — headings, lists, links — and drops the markup around it. This is the usual first step when you migrate posts out of WordPress into a static site.

Is my HTML uploaded?

No. The conversion runs in your browser, so content under embargo or behind a login stays on your device.

What happens to CSS and classes?

They are dropped. Markdown cannot express them, and removing them is usually the reason to convert in the first place.

Are tables converted?

Yes, into GitHub-style pipe tables — provided the table holds data. Tables used for page layout produce nonsense, because they were never really tables.

How do I strip a page back to clean HTML?

Convert to Markdown here, then convert back with the Markdown to HTML tool. The round trip removes everything Markdown cannot express.

Are images kept?

The tags are converted with their source and alt text, but the image files themselves are not downloaded. Relative paths will need fixing.

What about scripts and iframes?

Removed. Markdown has no equivalent, which also makes this a reasonable first pass at cleaning untrusted markup — though not a substitute for a real sanitiser.

Which heading style should I choose?

The # form. It works at all six levels and survives reflowing; the underlined form only covers the top two.

Can I convert a whole saved web page?

Yes, though you will get the navigation and footer too. Paste just the article element for a cleaner result.

Is this the same as HTML to MD?

Yes. HTML to MD and HTML to Markdown name one thing — .md is simply the file extension Markdown is saved under.