Converter

HTML to
Markdown

Convert HTML markup to clean Markdown syntax. Turns web content into documentation-ready text.

Migrating HTML content into a GitHub-hosted docs site?

md0 CMS turns your repo's markdown into a visual editor, so once your content lands as .md files, your team can keep editing without touching raw syntax.

See the CMS

Supported elements

Text formatting

  • <strong> → **bold**
  • <em> → *italic*
  • <code> → `code`

Structure

  • <h1-h6> → # Headers
  • <ul> → - Lists
  • <blockquote> → > Quote

Why convert HTML to markdown?

Most markdown editors and static site generators expect .md files, not HTML. Content copied from a website, CMS export, or WYSIWYG editor arrives as HTML. Converting it to markdown produces clean, portable text you can version in Git, edit in any text editor, and publish with any static site generator.

Common reasons to convert

  • Migrating from WordPress or other CMS platforms to a static site
  • Cleaning up pasted content from Google Docs or Word
  • Converting API responses or scraped web pages into readable text
  • Working with LLMs that prefer plain markdown over HTML
  • Stripping tracking attributes, inline styles, and span soup from copied HTML

The conversion preserves semantic structure: h1-h6 become # headings, strong becomes **bold**, em becomes *italic*, a tags become [link](url), and code blocks get fenced with triple backticks.

When to use this tool

Migrating a WordPress blog to Gatsby or Hugo

You exported your WordPress posts as HTML and now need them as .md files. Paste each post body into this tool and copy the output into a file in your content directory. Headings, links, bold text, and lists all carry over cleanly, with no manual editing required.

Cleaning up content pasted from a WYSIWYG editor

Google Docs, Notion exports, and email clients all produce HTML when you copy and paste. That HTML often carries inline styles, empty spans, and div wrappers that serve no purpose in markdown. Converting it here strips that noise and leaves the actual content behind.

Feeding web content into an LLM or RAG pipeline

If you are scraping web pages to use as context for a language model, markdown is easier to token-count, chunk, and parse than raw HTML. Convert the page HTML first and your embeddings will be cleaner, with less noise from tags and attributes.

How the conversion works

The converter parses your HTML into a document tree, then walks each node and maps it to its markdown equivalent. Block-level elements like headings, paragraphs, and lists become their own lines. The converter wraps inline elements like bold, italic, links, and code in the matching markdown syntax.

What gets converted

  • Headings (h1 through h6) become # through ######
  • Unordered lists become hyphen-prefixed lines, ordered lists become numbered lines
  • Anchor tags become [text](url), keeping the href
  • Images become ![alt](src), carrying over the alt attribute
  • Pre and code blocks become fenced code blocks with triple backticks
  • Blockquotes become lines prefixed with >

The converter drops inline styles, class attributes, data attributes, and presentational tags like span. What remains is plain, portable markdown with no hidden formatting.

Frequently asked questions

Does it handle nested HTML like tables or definition lists?

The converter turns basic HTML tables into GFM-style markdown tables with pipe characters. It may render definition lists and more obscure HTML elements as plain text, or drop them entirely, since standard markdown has no equivalent syntax for them. Check the output and adjust manually if needed.

Will it preserve links and image URLs?

Yes. The converter turns anchor tags into [link text](href) and image tags into ![alt text](src). It keeps the href and src values exactly as they appear in the HTML, whether absolute URLs, relative paths, or data URIs.

What happens to inline styles and CSS classes?

The converter strips them out. Markdown has no equivalent for inline CSS, so class names, style attributes, and presentational HTML do not survive the conversion. If something was bold only because of a CSS class rather than a strong or b tag, that formatting will not carry over.

Can I convert a full webpage or only fragments?

Both work. Paste a full HTML document including the doctype, head, and body, or a smaller snippet like a single article tag or a div with content. The converter extracts meaningful content from whatever you give it and ignores structural boilerplate like head tags and script blocks.