How to Convert HTML to Markdown (with a Cheat Sheet)
HTML is what web pages are made of. It’s full of tags, menus and styles, which makes it hard to read and edit by hand. Markdown says the same thing with plain characters: # Heading, **bold**, - list item. Notes apps like Obsidian, wikis, GitHub, static website builders and AI chat tools all work well with it.
So converting HTML to Markdown is useful when you want to keep an article as notes, move blog posts to a new website, turn a document into a README or give an AI tool just the text without the clutter. This guide shows what each tag becomes and how to convert with the free HTML to Markdown converter.
What HTML turns into
Most HTML tags have a matching piece of Markdown. <b> and <i> work the same as <strong> and <em>.
| HTML | Markdown |
|---|---|
<h1>Heading</h1> | # Heading |
<h2>Smaller heading</h2> | ## Smaller heading |
<strong>bold</strong> | **bold** |
<em>italic</em> | *italic* |
<a href="https://example.com">text</a> | [text](https://example.com) |
<img src="photo.jpg" alt="photo"> |  |
<ul><li>item</li></ul> | - item |
<ol><li>item</li></ol> | 1. item |
<code>code</code> | `code` |
<blockquote>quote</blockquote> | > quote |
<del>gone</del> | ~~gone~~ |
<li><input type="checkbox" checked> Done</li> | - [x] Done |
A short example: part of a shop’s web page, with a menu, a table and a tracking script.
<nav><a href="/">Home</a> <a href="/books">Books</a></nav>
<main>
<h1>Opening hours</h1>
<p>We are open <strong>Monday to Saturday</strong>. Visit <a href="https://example.com">our shop</a>.</p>
<ul>
<li>Books</li>
<li><del>Magazines</del> Comics</li>
</ul>
<table>
<tr><th>Day</th><th>Hours</th></tr>
<tr><td>Monday to Friday</td><td>9:00 to 18:00</td></tr>
<tr><td>Saturday</td><td>10:00 to 14:00</td></tr>
</table>
<script>trackVisitor()</script>
</main>
<footer>Corner Books, 12 High Street</footer>becomes this Markdown:
# Opening hours
We are open **Monday to Saturday**. Visit [our shop](https://example.com).
- Books
- ~~Magazines~~ Comics
| Day | Hours |
| --- | --- |
| Monday to Friday | 9:00 to 18:00 |
| Saturday | 10:00 to 14:00 |Only the page’s main content is kept, so the menu and the footer are gone. The tracking script is left out too: scripts never end up in Markdown.
How to get the HTML
- A web page: right-click the page and choose View page source, then select everything and copy it. Or save the page with Ctrl+S (Cmd+S on a Mac) and open the .html file in the converter.
- Part of a page: right-click the part you want, choose Inspect, then right-click the highlighted line and choose Copy > Copy element (Chrome and Edge) or Copy > Outer HTML (Firefox).
- A Word document: choose File > Save As and save it as a Web Page.
- A Google Doc: choose File > Download > Web page. You get a .zip file; the .html file inside is the one you need.
How to convert HTML to Markdown
- Open the HTML to Markdown converter and paste your HTML into HTML input. You can also click Open file or drop an .html file onto the box. Sample loads an example.
- Choose the options (explained below). The defaults suit most people.
- Click Convert to Markdown. Check the result under Preview, switch to Markdown to see the text, then Copy it or Download it as an .md file.
Under the result, a short line counts the words, headings, links, pictures and tables found, so you can see at a glance that nothing is missing.
The options
- Only the main content. On by default. When the page marks its main content (with
<main>, or a single<article>), the menu, header and footer around it are left out, and a note says so. Turn it off to convert everything. In the example above, that adds the menu and the footer:
[Home](/) [Books](/books)
# Opening hours
…
Corner Books, 12 High Street- GitHub tables and task lists. On by default. Tables become Markdown tables,
<del>becomes~~strikethrough~~and checkboxes in lists become task lists. Standard Markdown has none of these, so turn it off only if the Markdown is going somewhere strict. - Headings.
# Headingis the common style. Underlined writes the two biggest headings with a line of===or---under them, as some older tools expect. - List bullets.
-,*or+. They all mean the same; pick the one your project uses. - Code blocks. Fenced puts code between
```lines and keeps its language (```js), which GitHub uses for colours. Indented moves it four spaces to the right instead. - Links. In the text writes each address next to its link. Listed at the end keeps the text easy to read and collects the addresses at the bottom:
We are open **Monday to Saturday**. Visit [our shop][1].
…
[1]: https://example.comWhat Markdown can’t keep
Markdown is meant for plain, readable text, so some things don’t survive the trip:
- Colours, fonts and layout. Styles, classes and columns are dropped; only the text and its structure stay.
- Pictures stay where they are. A picture becomes a link to its address, such as
. If you move the text to another site, download the pictures too. - Complex tables. A Markdown table cell holds one line, so line breaks inside a cell become spaces, and merged cells are spread out with empty cells next to them.
- Forms, videos and embeds. Buttons, form fields, iframes, scripts and styles are always left out. If a page is nothing but those, the converter tells you that no text was found.
Is my HTML uploaded?
No. The conversion runs in your browser, so your HTML never leaves your device. The HTML is also read in a sealed-off copy, so nothing in it runs and no pictures are loaded while it’s converted.
More Markdown tools
- Markdown to HTML: the other direction, for putting your Markdown on a website.
- Markdown Table Generator: build tables in a grid or paste them from Excel.
- README Generator: fill in a form and get a complete README.md.
Frequently asked questions
Can I convert a web page from its address?
Not directly: the converter doesn’t visit other websites, which is part of why it’s private. Open the page, copy its source or save it as shown above, and paste or open it here.
Does it work for Obsidian, Notion or GitHub?
Yes. The result is standard Markdown with GitHub tables and task lists, which all three understand. Paste it into a note, or download the .md file and import it.
Why does my line break end in two spaces?
That’s how Markdown writes a line break inside a paragraph (<br> in HTML). The spaces are invisible but needed, so keep them.