HTML to Markdown

Turn a page of HTML back into readable Markdown.

Code Formatters Free, no sign-up Runs in your browser

HTML to Markdown tool

About the HTML to Markdown

HTML to Markdown converts markup back into the shorthand, which is the direction you need when moving content out of a CMS and into a static site, a documentation repository or anywhere that stores text as Markdown.

Conversion uses the browser's own HTML parser and walks the resulting tree, so the structure it sees is the structure a browser sees, including markup that is technically invalid but renders anyway. Headings, paragraphs, emphasis, links, images, ordered and unordered lists with nesting, blockquotes, inline code, pre blocks and tables all map to their Markdown equivalents.

Elements with no Markdown equivalent are handled by choice rather than by accident. You can keep them as inline HTML, which Markdown permits, or strip them to their text content. Scripts, styles and comments are removed either way, because nobody wants them in a Markdown document.

How to use the HTML to Markdown

  1. Paste your HTMLA full page or a fragment.
  2. Choose how to handle unsupported elementsKeep them as inline HTML, or reduce them to text.
  3. Press ConvertThe Markdown appears below.
  4. Copy or downloadTake the .md file.

Features

  • Headings, paragraphs, emphasis and links
  • Nested ordered and unordered lists
  • Images with alt text and titles
  • Inline code and fenced code blocks with language detection
  • Tables converted to Markdown table syntax
  • Unsupported elements kept as HTML or stripped to text
  • Scripts, styles and comments removed
  • Copy or download as .md

Who uses this tool

The html to markdown is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:

  • Migrating posts from a CMS to a static site
  • Turning a web page into notes
  • Converting documentation into a repository format
  • Extracting readable text from a saved page
  • Preparing content for a Markdown-based editor

Frequently asked questions

What happens to elements Markdown cannot express?

You choose. Markdown allows inline HTML, so keeping them is valid and lossless. Stripping them to their text content gives a cleaner document at the cost of some structure.

Are tables converted?

Yes, into Markdown table syntax, provided the table is reasonably regular. Tables with merged cells have no Markdown equivalent and are kept as HTML.

Is the conversion lossless?

No, and it cannot be. HTML can express far more than Markdown. Classes, inline styles, data attributes and complex nesting have nowhere to go. What survives is the document structure, which is usually what you wanted.

How are code blocks handled?

A pre block containing a code element becomes a fenced block. If the code element carries a language class, the language is written onto the fence so highlighting still works.

Does it fetch a page for me?

No. Browsers block requests to other domains, so copy the HTML yourself using view-source or developer tools.

Is my content uploaded?

No. Parsing and conversion happen in your browser.

If the html to markdown is not quite what you need, these other free tools solve closely related problems.

Markdown to HTML

Turn Markdown into HTML with a live preview and escaped output.

Code Formatters Use tool

HTML Formatter

Pretty-print HTML with consistent indentation, or collapse it back down.

Code Formatters Use tool

Text Cleaner

Tidy messy pasted text: extra spaces, empty lines, breaks and special characters.

Text Tools Use tool

URL Extractor

Extract all URLs from text or HTML, with anchor text and filtering options.

SEO Tools Use tool

Live HTML Editor

A three-pane editor with a live preview that updates as you type.

Developer Tools Use tool