HTML to Markdown
Convert HTML markup to clean, portable Markdown in the browser, ready for docs sites, Git workflows, and AI contexts.
What it does
- Headings, paragraphs, links, images, lists and quotes converted
- Nested lists indented, code blocks fenced
- Scripts, styles and attributes dropped
- One-click copy of the Markdown output
- Runs locally, markup never leaves the tab
Paste HTML into the left panel, click HTML → Markdown, and copy clean Markdown from the right panel. The converter keeps the structure of the content (headings, paragraphs, links, lists, code, quotes, images) and drops everything that is only presentation: classes, inline styles, scripts and wrapper divs. The parsing uses scraper, a Rust HTML parser built on html5ever (the HTML parser of the Servo project), compiled to WebAssembly, so the markup you paste is converted in your tab and never uploaded. The HTML to Markdown conversion guide covers when Markdown is the right destination.
What gets converted, element by element
- Headings
<h1>to<h6>become#to######. - Paragraphs become blocks separated by a blank line.
- Bold and italic:
<strong>and<b>become**text**;<em>and<i>become*text*. - Links become
[text](url), keeping the URL exactly as written, relative or absolute. A link with no text becomes<url>. - Images become
. - Lists:
<ul>items get-,<ol>items are numbered from 1, and nested lists are indented by two spaces per level. - Code: inline
<code>becomes backticks;<pre>blocks become fenced code blocks. - Blockquotes get
>on every line; horizontal rules become---. - Removed:
<script>and<style>with their content, and all attributes other thanhref,srcandalt. - Entities such as
&and are decoded to the real characters.
How to convert HTML to Markdown
- Copy the HTML you want to convert. In a browser, right-click the article, choose Inspect, then copy the outer HTML of the element that contains the content. In a CMS, open the HTML or code view of the editor.
- Paste it into the HTML panel.
- Click HTML → Markdown.
- Copy the result with the copy button and paste it into your
.mdfile, wiki, issue tracker or prompt.
For the cleanest result, paste the content fragment (the article or main section) rather than a whole page. If you paste a complete document, the text of the <title> and of navigation menus ends up in the output as plain text.
Limits to know before converting
- Tables are not converted to Markdown tables. Their cell text is kept but run together without separators. Rebuild tables by hand, or keep them as raw HTML in your Markdown file, which most renderers accept.
- Code block language is lost. A
class="language-js"on the code element is not carried into the fence, so add the language after the opening backticks yourself. - Strikethrough, underline and other inline tags such as
<s>,<u>or<mark>keep their text but lose their formatting. - Line breaks inside a paragraph (
<br>) are collapsed into a space. - Forms, iframes, videos and embeds have no Markdown equivalent; only their inner text, if any, remains.
Typical uses
- Migrating pages from WordPress or another CMS to a static site generator such as Hugo, Astro, Jekyll or Docusaurus.
- Moving documentation into a Git repository, where Markdown diffs cleanly in pull requests.
- Cleaning an email template or a rich-text export before pasting it into GitHub, GitLab, Notion or Obsidian.
- Feeding web content to an AI assistant: Markdown keeps the structure with far fewer characters than HTML, so more content fits in the context window.
Compared with Pandoc and libraries
Pandoc (pandoc -f html -t gfm) is the reference tool for document conversion and handles tables and many more constructs. Libraries such as Turndown (JavaScript) or markdownify (Python) are the usual choice inside an application. This page fits the quick, one-off job where installing a tool is overkill, with the same guarantee as a local tool: the HTML is not sent anywhere.
Privacy: unpublished content stays private
The HTML people convert is often content that is not public yet: draft articles, internal wiki pages, intranet documentation, customer emails. Converting it on a site that processes input server-side shares that content with a third party. Here the conversion runs in WebAssembly in your browser, and no request carries your markup.
Frequently asked questions
- Is my HTML sent to a server?
- No. The conversion runs entirely in your browser. You can disconnect from the internet after the page has loaded and it keeps working.
- Does it convert HTML tables?
- No. Table text is kept but not laid out as a Markdown table. For pages with important tables, use Pandoc or keep those tables as HTML inside the Markdown.
- Are relative links preserved?
- Yes. The
hrefis copied as written, so/docs/setupstays/docs/setup. Make sure the paths still work in the destination site. - Which Markdown style does it produce?
- ATX headings (
#),-for bullets,**for bold,*for italics, and fenced code blocks. This style is read by CommonMark and GitHub Flavored Markdown renderers. - Can I paste a whole web page?
- Yes, but the title, menus and footer text come through too. Pasting only the article element gives cleaner Markdown.
- Can I convert Markdown back to HTML?
- Yes, with the Markdown preview and HTML export tool, or the Markdown to HTML converter.