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
How to convert HTML to Markdown
Paste the code, or copy straight from a page.
-
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.
-
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
mainorarticleelement. -
Copy or download
Click Copy Markdown or Download .md. Preview shows the Markdown rendered.
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.
How HTML becomes Markdown
GitHub Flavored Markdown has a match for almost every element in an article.
| HTML | Markdown |
|---|---|
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 cells | A 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 |  |
pre and code | A fenced code block. The language from class="language-python" goes after the backticks. |
blockquote | > quote |
script, style, noscript, template | Removed, 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
styleattributes, is dropped. The text stays. - Forms, videos and embeds are left out. A
videooriframehas 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
/aboutorimages/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.
More markdown converters tools
- Convert Markdown to HTML Converter Turn Markdown into clean HTML, or a complete styled page. Open tool
- Convert Rich Text to Markdown Converter Paste formatted text from Word, email or the web and get Markdown. Open tool
- Convert Google Docs to Markdown Converter Paste text from a Google Doc and get Markdown with headings, lists and tables. Open tool
- Convert Text to Markdown Converter Turn plain text into Markdown with headings, lists and tables found for you. Open tool