HTML to Markdown

Paste HTML and get clean Markdown: headings, lists including nested ones, links, images, inline code, fenced code blocks, blockquotes and tables. What sets a good converter apart is escaping, and it is the part most skip. Without it your output quietly changes meaning — a product name like C* becomes emphasis, a Windows path loses its backslashes, and a paragraph that happens to start with a hyphen turns into a bullet. Here the characters Markdown treats as syntax are escaped, and the ones that only matter at the start of a line are escaped only when they actually appear there, so ordinary prose stays readable rather than filling up with backslashes. Code blocks are left untouched, because code has to survive exactly. Script and style contents are discarded rather than inlined as text. Everything runs in your browser.

How elements convert

HTMLMarkdown
<h1> to <h6># through ######
<strong> / <b>**bold**
<em> / <i>*italic*
<a href>[text](url)
<img src alt>![alt](src)
<code>`code`
<pre>``` fenced block ```
<ul> / <ol>- and 1. lists, nested
<table>A padded Markdown table
<script> / <style>Discarded

When to use it

  1. Move web content into a Markdown-based CMS or static site.
  2. Convert an HTML email or newsletter into readable notes.
  3. Turn documentation from a CMS export into Markdown files.
  4. Get a clean Markdown version of a page you copied.
  5. Convert HTML tables into Markdown tables.

How to Use

  1. Paste your HTML or drop a file.
  2. Choose a bullet style if you prefer asterisks.
  3. Copy the Markdown.

Features

  1. Headings, emphasis, links, images and code
  2. Nested ordered and unordered lists
  3. Blockquotes, horizontal rules and strikethrough
  4. HTML tables to Markdown tables
  5. Position-aware escaping that preserves meaning
  6. Code blocks left verbatim
  7. Script and style contents discarded
  8. Entities decoded, including numeric references
  9. 100% client-side

FAQs

Is my HTML uploaded?

No. It is parsed and converted in your browser.

Why are there backslashes in my output?

Because those characters would otherwise be read as Markdown syntax and change the meaning of your text. An asterisk in prose would become emphasis; a leading hyphen would become a list item. The escaping is position-aware, so it only appears where it is actually needed.

What happens to elements Markdown cannot represent?

Their text content is kept and the formatting is dropped. Losing a custom element's styling is much better than losing the words inside it. Script and style tags are the exception — their contents are discarded, since inlining code as prose produces nonsense.

Does it handle nested lists?

Yes, with two-space indentation per level, and ordered lists number correctly at each level.

Are tables supported?

Yes. HTML tables become Markdown tables with the columns padded. Note that Markdown tables cannot contain block content, so a table cell holding a list or a paragraph break is flattened to a single line.

What about entities like &amp;nbsp;?

They are decoded to real characters, including numeric and hexadecimal references. Your Markdown ends up with an actual em dash rather than the entity for one.

Technical Details

The HTML is read with the same tokenizer the XML tools use, so a greater-than sign inside a quoted attribute, markup inside a comment and CDATA are all already handled rather than being re-solved with a regular expression. Conversion then walks the token stream, keeping a stack for list nesting and buffering table rows until the closing tag, because the column count is not known until the first row has finished. The step most converters skip is escaping, and it is why their output quietly changes meaning: a product name like C* becomes emphasis, a Windows path has its backslashes eaten as escapes, and a paragraph starting with a hyphen turns into a list item. Here the characters that are significant in Markdown are escaped, and the ones significant only at the start of a line — a bullet, a number followed by a dot, a hash, a blockquote marker — are escaped only when they actually appear there, so ordinary prose is not littered with backslashes. Text inside a pre block is never escaped, because code has to survive verbatim. Script and style contents are discarded entirely rather than converted: they are code, not prose, and inlining them produces nonsense in the middle of a document. Elements with no Markdown equivalent degrade to their text content instead of being dropped, on the basis that losing the formatting is better than losing the words. Entities are decoded, including numeric and astral references, so the output carries real characters rather than escapes. Everything runs in your browser.

Developer Tools

Developer Tools

  • Markdown Table Generator
  • JavaScript Beautifier
  • GraphQL Formatter
  • Prettier Playground
  • XML Formatter
  • cURL Command Builder
  • cURL to Code
  • HTTP Status Codes