HTML to Markdown

Paste HTML on the left and get Markdown on the right. The converter walks the parsed document tree, keeps the elements Markdown can express, strips script and style, and unwraps layout div and span. Everything runs in your browser.

Why convert HTML to Markdown

What each element becomes

HTMLMarkdown
<h1> … <h6># … ######
<p>A paragraph separated by a blank line
<strong>, <b>**text**
<em>, <i>*text*
<del>, <s>, <strike>~~text~~
<a href>[text](url)
<img src alt>![alt](src)
<code> (inline)`code`
<pre> / <pre><code>A fenced code block
<ul> / <ol> / <li>- or 1. items, indented when nested
<blockquote>> prefix
<hr>---
<br>A hard line break
<table>A pipe table (simple tables only)
<div>, <span>Unwrapped — text kept, tag dropped
<script>, <style>, commentsRemoved

What does not round-trip cleanly

Markdown is a small language. When the source HTML uses something it cannot express, information is lost or the converter falls back to raw HTML:

If a clean round trip matters, convert, then render the Markdown back and compare it to the original.

Common questions

Why convert HTML to Markdown?

Migrating a CMS to a static-site generator, cleaning rich text pasted from a word processor, feeding a docs pipeline, and getting readable diffs in version control.

What does not round-trip cleanly?

Merged table cells, multi-paragraph cells, colored or sized text, custom classes, figures with captions, and deeply nested inline formatting.

What happens to scripts and styles?

script, style, noscript and comments are removed. div and span are unwrapped so their text survives without the tag.

Full page or fragment?

Both. A whole document is read from its body; a fragment is treated as body content. Head elements are ignored.

Is my HTML uploaded?

No. It is parsed with the browser's DOMParser and walked locally.