HTML to Markdown

Turn HTML back into Markdown. The other direction is Markdown to HTML · HTML entities

What is converted back

This page reads HTML and writes Markdown for the same subset the other page produces: headings, paragraphs, bold, italic, code, links, images, lists, quotes, rules and tables. The other direction is Markdown to HTML. Named character references are on HTML entities.

How to use it

  1. Paste HTML. The result updates as you type.
  2. Convert runs the same conversion once.
  3. Show Example loads a heading Notes, a paragraph with bold and inline code, a bullet list of alpha and beta, a numbered list of one and two, a quote, a link to https://example.com, and a horizontal rule.
  4. The Markdown is # Notes, a paragraph with **bold** and `code`, - alpha, 1. one, > quoted, [site](https://example.com) and ---.
  5. Clear All empties both boxes. Copy Result copies the Markdown.

Tags this page reads

Headings h1 to h6 become ATX headings. p becomes a paragraph. strong and b become **bold**. em and i become *italic*. code becomes inline code, and pre becomes a fenced block. Links and images keep their address. ul and ol become lists. blockquote is prefixed with >. hr becomes ---. A table becomes a header, a separator of dashes, and body rows.

script and style are dropped. Other tags are unwrapped and their text is kept. < is turned back into a less-than character, so escaped HTML becomes text in the Markdown.

Where people use it

  • Turning a fragment from the Markdown page back into the source.
  • Lifting a simple HTML table into a pipe table.
  • Reading a heading and a list out of a snippet.

Questions

Will every HTML page survive?

Only the tags listed above become Markdown. A full document keeps the text of the tags this page does not format.

Why did a script disappear?

Script and style contents are removed before the text is written.