HTML to Markdown Converter

This HTML to Markdown converter turns HTML code, or part of a web page you copy, into clean GitHub Flavored Markdown. Headings, lists, tables, links, images and code blocks with their language are kept. Scripts and styles are removed, and it can keep only the main content of a page.

  • Code or copied page
  • Stays on your device
HTML

Options
Content

How to convert HTML to Markdown

Paste the code, or copy straight from a page.

  1. Add the HTML

    Choose HTML code and paste the source or open a .html file. Or choose Copied from a page, select part of any web page, copy it and paste it into the box.

  2. Pick what to keep

    For a whole page, Main content only drops the menu, header and footer and keeps what’s in the page’s main or article element.

  3. Copy or download

    Click Copy Markdown or Download .md. Preview shows the Markdown rendered.

Example

The article on this page converts to 3 headings, a bulleted list, a 3-column table, a picture with its alt text, the link to the full guide and a Python code block. With Main content only, the 3 menu links and the © line are left out.

Convert a sample page

How HTML becomes Markdown

GitHub Flavored Markdown has a match for almost every element in an article.

HTMLMarkdown
h1 to h6# to ######
strong, b, em, i, del, s**bold**, *italic*, ~~struck~~
ul, ol, li, nested lists- item and 1. item, indented to nest. A list’s start number is kept.
input type="checkbox" in a list- [x] and - [ ]
table with th cellsA pipe table. align is kept, | in a cell is escaped and line breaks in a cell become <br>.
a href[text](address). Relative links like /about and #part are kept as written.
img![alt text](address)
pre and codeA fenced code block. The language from class="language-python" goes after the backticks.
blockquote> quote
script, style, noscript, templateRemoved, with what’s inside.

When Markdown can’t say it

Markdown covers the parts of a page you read. Some HTML has no Markdown form:

  • Layout and styling, such as columns, colours, fonts and style attributes, is dropped. The text stays.
  • Forms, videos and embeds are left out. A video or iframe has no Markdown equivalent.
  • Merged table cells (colspan, rowspan) can’t be shown in a Markdown table, so the cells are listed one after another.
  • Relative links and pictures, like /about or images/tea.jpg, are kept as written. They work once the Markdown is published on the same site.

HTML to Markdown Converter FAQ

How do I convert HTML to Markdown?

Paste the HTML code into the box, or copy part of a web page and paste it in Copied from a page. The Markdown appears as you paste, ready to copy or download.

Which Markdown does it write?

GitHub Flavored Markdown: standard Markdown plus tables, task lists, strikethrough and fenced code blocks. GitHub, GitLab, Obsidian, VS Code and most static site generators read it.

Can I convert a whole web page by its address?

Not by address: copy the part you want from the page, or save it with Ctrl+S (⌘+S on a Mac) and open the .html file here.

What happens to scripts and styles?

They’re removed, with their contents, and so are hidden elements. Only the content you’d read is converted.

Does it keep images?

Yes, as image links with their alt text. The pictures stay where they are on the web; Markdown only points to them.

Is my text uploaded?

No. The conversion runs in your browser, on this page, so nothing you paste is sent to a server or saved. Closing the page clears it.