HTML to Markdown converter
Paste HTML or open an .html file. You get Markdown with the headings, links, lists, tables and code, ready to copy or download.
Free, no account needed. Updated .
Short answer
To convert HTML to Markdown, map each tag to its Markdown mark: h2 becomes ##, a link becomes its text in square brackets followed by the address in parentheses, li becomes a list item and a table becomes a pipe table. This converter does that in your browser with the converter Paperlink AI uses to import website pages, and it leaves out navigation, scripts, footers and cookie banners.
How to convert HTML to Markdown
- Paste the HTML into the box, or select Or open an .html file to load a saved page (up to 5 MB). A fragment such as one article body works, and so does a whole page with its
<head>. - Select Convert to Markdown. The summary counts the headings, links and tables found, so you can see at a glance if the structure came through.
- Copy or download. Download gives you a
.mdfile. For an opened file, it keeps the file name.
What each tag becomes
| HTML | Markdown |
|---|---|
| <h1> to <h6> | # to ###### |
| <strong>, <b> | **text** |
| <em>, <i> | *text* |
| <del>, <s> | ~~text~~ |
| <a href="/pricing"> | [text](/pricing) |
| <img src="https://…" alt="…"> |  |
| <ul>, <ol> and <li> | - item or 1. item, nested lists indented |
| <table> | A pipe table, first row as the header |
| <pre><code class="language-js"> | A fenced code block marked js |
| <blockquote> | > quoted text |
| <details> and <summary> | A sub-heading from the summary, then the hidden text |
The last row matters for help centers. FAQ pages often hide each answer in a collapsed <details> block. Some converters drop the hidden text. This one keeps it, under a heading made from the question.
Example
This HTML from a help page:
<nav><a href="/">Home</a></nav>
<main>
<h1>Shipping</h1>
<p>We ship in <strong>2 days</strong>. See <a href="/rates">rates</a>.</p>
<table>
<tr><th>Zone</th><th>Price</th></tr>
<tr><td>EU</td><td>$5</td></tr>
</table>
</main>
<footer>© Acme</footer>becomes this Markdown. The menu and the footer are gone:
# Shipping
We ship in **2 days**. See [rates](/rates).
| Zone | Price |
|---|---|
| EU | $5 |What the converter leaves out
When you paste a whole page, most of the HTML is not content. The converter removes the parts that repeat on every page or do nothing in a text file:
<script>,<style>,<noscript>,<template>and inline SVG.<nav>,<header>,<footer>,<aside>and elements with the navigation, search, banner or contentinfo role.- Forms, buttons, inputs and iframes.
- Blocks whose class or label says cookie, consent, promo, newsletter or breadcrumb.
If the page has a <main> element, only that part is converted, and if not, the first <article>. When the content has no H1, the page <title> becomes the top heading. These are the rules Paperlink AI uses when it imports pages from a website, so the result also shows you what a support chatbot would read from that page.
One case needs care: some sites put the real article inside a <header> or an <aside>. If text you expected is missing, paste only the part you want.
Links, images and code
Links keep their address exactly as written, also relative ones such as /rates. If you will use the Markdown on another site, replace them with full addresses. Links to javascript: are not real destinations, so only their text is kept. Images with an address become Markdown images. Images stored inside the page as data (a data: address) would put thousands of characters into the file, so only their alt text is kept.
Code in <pre> keeps its line breaks and spaces. When the inner <code> has a class such as language-python or lang-sh, the fence gets that language, which most Markdown viewers use for syntax colors.
Limits
- Pages built with JavaScript. The page source of a single-page app is often an empty shell. Open the page, then copy the HTML of the content from the Elements panel of your browser developer tools.
- Layout tables. Old sites use tables for layout. Those come out as pipe tables too. Delete them from the Markdown, or paste only the cell you need.
- Merged cells.
colspanandrowspanare not kept, because Markdown tables have no merged cells. - Inline styles and colors are not part of Markdown and are dropped.
Why Markdown for AI and docs tools
HTML pages are mostly markup. Once the menus, scripts and class names are counted, the HTML of a short help article is often many times longer than its text. An AI model or a search index that reads the raw HTML spends most of its space on that markup, and the menu text gets mixed into every answer. Markdown keeps the headings, lists and tables in a few characters and leaves the rest out.
Use the Markdown to move pages into a docs repository, to give an AI tool clean context, or to check what a crawler sees on your site. To list your most useful pages for AI assistants, use the llms.txt generator. To turn Markdown back into HTML, use Markdown to HTML. If you want to answer customers from your help center, read how to turn a help center into an AI chatbot.
Frequently asked questions
What does it remove from the HTML?
Scripts, styles, navigation menus, the page header and footer, forms, buttons, sidebars, iframes and blocks marked as cookie, consent, promo, newsletter or breadcrumb. When the page has a main or article element, only that part is converted.
Can I paste a whole web page?
Yes. View the page source or save the page as .html, then paste it or open the file here. If the page builds its text with JavaScript, the source holds little text: copy the HTML from the Elements panel of your browser developer tools instead.
How are HTML tables converted?
Each table becomes a GitHub-flavored Markdown pipe table, with the first row as the header. Merged cells (colspan and rowspan) are not kept, and a pipe character inside a cell is escaped.
Are links and images kept?
Links keep their text and address, also relative addresses such as /pricing. Images with a web address become . Images stored as data in the page, and javascript: links, are dropped; their alt text or link text stays.
What happens to bold, italic and code?
Bold becomes **text**, italic becomes *text*, strikethrough becomes ~~text~~ and inline code gets backticks. A pre block becomes a fenced code block, with its language when the code has a class such as language-js.
Should I give AI tools Markdown instead of HTML?
Usually yes. HTML carries many characters that are not content, such as tags, classes and scripts. Markdown keeps the structure in a few characters, so a model or a search index spends its space on your text, and you can read and edit it first.
Newsletter
Support notes, once a month.
One email with what we learn about help centers, honest AI answers and support teams. Unsubscribe at any time.
Related
- Free toolMarkdown to HTMLPaste Markdown or plain text. You get the HTML code and a preview, with scripts and other unsafe parts removed. Nothing is uploaded.
- Free toolWord to MarkdownDrop a .docx file. You get Markdown with the headings, lists, tables and links from Word, ready to copy or download. The file is not uploaded.
- Free toolllms.txt GeneratorGenerate a draft from your pages, check the llms.txt your site serves today, or paste a file to validate it.