HTML to Markdown

Convert HTML to clean GitHub Flavored Markdown.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

HTML to Markdown Converter

The HTML to Markdown converter turns web page markup into clean GitHub Flavored Markdown. It is perfect for migrating blog posts from a CMS to a static site generator, saving documentation into a Git repository, writing README files from existing pages, or preparing content for note apps like Obsidian and Notion.

Supported elements

HTML Markdown
h1 – h6 # headings or Setext underlines
strong, b / em, i **bold** / *italic*
a, img [text](url "title"), ![alt](src)
ul, ol (nested) - bullets and 1. numbers
pre + code fenced code block with language
blockquote > quote lines
table GFM pipe table
del, s ~~strikethrough~~

Line breaks become two trailing spaces, horizontal rules become ---, and special Markdown characters in text (such as * and _) are escaped so they are not misread as formatting.

Options

Choose ATX (## Title) or Setext (underlined) headings, your preferred bullet character, and whether code blocks use backticks or tildes — tildes are handy when the code itself contains triple backticks.

Tips for better results

Run very messy HTML through the HTML Cleaner first. Layout-only wrappers are discarded automatically, but cleaning removes empty spans and Word artefacts that can leave stray spaces. Complex layouts with merged table cells or embedded widgets have no Markdown equivalent; review those parts by hand.

Convert back with Markdown to HTML, write and preview Markdown in the Markdown Editor, or build tables from spreadsheet data with the Markdown Table Generator.

Frequently Asked Questions

GitHub Flavored Markdown (GFM): ATX or Setext headings, fenced code blocks with language hints, pipe tables, and ~~strikethrough~~. It also renders fine in most other Markdown engines.

Yes. HTML tables become pipe tables with a header separator row. Cells are padded so the columns line up in the source. Merged cells (colspan/rowspan) cannot be represented in Markdown and are flattened.

Elements without a Markdown equivalent, such as span, div, or custom elements, are removed but their text is kept. Scripts, styles, and the head are dropped.

If a code element has a class like language-js or lang-python, the language is written after the opening fence so syntax highlighting keeps working.