HTML to Markdown Converter

Convert HTML into clean GitHub-flavoured Markdown, with headings, lists, links, images, code blocks and tables handled.

HTML
Markdown
Runs locally in your browser

About the HTML to Markdown Converter

Moving content from a CMS, a documentation site or an email into a Markdown-based system starts with a conversion. This tool parses the HTML and walks the tree, emitting Markdown for each element it understands: ATX headings, paragraphs, ordered and unordered lists with nesting, bold and italic, inline code, fenced code blocks with the language taken from a language-* class, links, images with alt text, blockquotes, horizontal rules and GFM pipe tables.

Elements without a Markdown equivalent, such as <div> and <span>, are unwrapped so their text is kept. Scripts, styles and the document head are dropped. Whitespace is normalised so the result does not carry the original indentation, and blank lines between blocks are collapsed to one.

The output targets GitHub-flavoured Markdown, which is what GitHub, GitLab, Obsidian, Hugo and most static site generators read. Check the result in Markdown to HTML to compare rendering; very complex tables or deeply nested lists may need a small manual tidy.

How to use

  1. Paste HTML on the left, or the outerHTML of an element copied from the browser inspector.
  2. Copy the Markdown from the right.
  3. Paste it into your Markdown file and review tables and nested lists.

Common questions

Are tables converted?
Yes, into GFM pipe tables. Cells with block content are flattened to one line, since Markdown tables are single-line per row.
What happens to inline styles and classes?
They are dropped. Markdown has no styling; only structure and links survive.
Does it keep the language of code blocks?
If the code element has a class such as language-js, the fence gets that language.
Can I convert a whole web page?
Paste the page source. Navigation and footers will come along as lists and links; delete what you do not need.