HTML to Markdown

Turns pasted HTML into Markdown, including headings, bold and italic, links, images, lists, tables and code blocks. It uses the browser's own parser, so messy markup is handled sensibly.

Use the tool

Why this tool exists

Moving content out of a CMS, a wiki or an old website into a Markdown-based tool such as a static site generator, a documentation repository or a notes app means converting HTML by hand or writing a script. Copying a rendered page and cleaning it up line by line is slow and error-prone.

Paste the HTML here and the converter walks the parsed document and writes Markdown for each element it knows about. Scripts, styles and head content are dropped, nested lists keep their indentation, and tables become pipe tables with alignment from the source. Because the page is parsed in your browser, nothing you paste is uploaded, which is handy for internal documentation.

How to use it

  1. Paste the HTML source into the input box.
  2. Check the Markdown that appears in the output.
  3. Review lists, tables and code blocks for anything unusual.
  4. Copy the Markdown into your document.

Frequently asked questions

Which HTML elements are converted?

Headings, paragraphs, bold, italic, strikethrough, inline and block code, links, images, block quotes, ordered and unordered lists, task checkboxes, horizontal rules and tables. Other elements are unwrapped, keeping their text.

What is dropped?

Script, style, head, title and noscript content are removed. Attributes other than href, src, alt, title, language classes on code and table alignment are ignored, so classes and inline styles do not survive.

How are tables handled?

They become pipe tables. The first row is treated as the header, and column alignment is read from align attributes or text-align styles. Cells with line breaks are flattened, and merged cells are not represented.

Why does my result have extra backslashes?

Characters that Markdown treats as formatting, such as asterisks, underscores, brackets and backticks, are escaped in plain text so they display literally. Inside code they are left alone.