BUILT FOR LLM WORKFLOWS

HTML to Markdown Converter

Convert webpages and HTML files to clean Markdown for LLM prompts, documentation, and knowledge bases.

Conversion settings

Conversion options

Markdown output

Pasted HTML and local files stay in your browser.

Clean Markdown, ready for your workflow.

Extract the main content

Pull out the article or main section and leave navigation, cookie banners, and other page furniture behind.

Keep the structure

Preserve headings, nested lists, tables, links, and fenced code blocks in GitHub Flavored Markdown.

Plan your context

See the output size and estimated token count before you add a page to an LLM prompt or knowledge base.

How to convert HTML to Markdown

HTML tells a browser how to display a page. Markdown expresses the same content as plain text with a few readable markers for headings, links, and lists. Use this HTML to Markdown converter when you want to move a webpage into a README, reuse an article in your notes, or give an AI assistant a document it can read. You can start with pasted source code, a saved HTML file, or a public URL.

Convert HTML to Markdown online in three steps

  1. Choose your input. Select Paste HTML and paste the markup you want to convert, or use Upload file for a saved .html, .htm, or .xhtml file. To convert a public webpage, choose Import URL, enter the address, and click Import.
  2. Check the output. The result updates as you type by default. Click Convert if you turned off automatic conversion. Use Preview to check the rendered structure, then switch to Raw to see the Markdown syntax.
  3. Copy or download. Copy the result into a Markdown editor, issue, or prompt. Choose Download .md if you want a standalone file you can commit to a repository or add to a folder of notes.

The converter has examples for an article, a table, and a code block. Pick one from the Example menu to see how the same information looks before and after conversion.

HTML to MD example

A second-level HTML heading becomes a line starting with ##. The converter uses double asterisks for bold text and hyphens for bullet points. You can read the result in a text editor and still tell where the heading, paragraph, and list begin.

HTML input
<h2>Release notes</h2>
<p>Support for <strong>tables</strong>.</p>
<ul>
  <li>Copy the result</li>
  <li>Save a Markdown file</li>
</ul>
Markdown output
## Release notes

Support for **tables**.

- Copy the result
- Save a Markdown file

When you convert to Markdown, review details tied to the original layout, such as merged table cells or links that were relative to a page address. The preview can help you catch places where the resulting text needs a small edit before you publish it.

Keep the parts of the page you need

Extract main content starts on by default. It identifies the primary article, guide, or directory and removes common distractions such as menus and cookie banners. Open Settings and turn extraction off if the conversion needs surrounding material, such as a sidebar with chapter links. The converter still omits scripts, styles, and recognizable hidden elements.

Headings, nested lists, fenced code blocks, and simple tables keep their structure in GitHub Flavored Markdown. Leave Keep links on when references matter or turn it off for a text-focused extract. Keep image URLs controls whether image references appear in the result. For imported pages, enable Add source URL to record where the content came from.

If a page contains relative links such as /docs/setup, importing the public URL gives the converter the address it needs to resolve those links. When you paste a snippet from a saved file, check that its links still point to the right place in the destination document.

Convert a webpage that loads content with JavaScript

Use this HTML to Markdown converter online with Import URL when you have a public webpage address. The first import reads the HTML the server sends. That usually works for articles and documentation. If the output misses content that appears only after the page loads, try importing again with Render JavaScript enabled.

Some sites require sign-in, block automated browsers, or load important data from a different host. If the import still misses the content, open the page in your own browser and copy the relevant element’s HTML from developer tools. Paste it into the converter and check the result in Preview.

Convert multiple URLs from a sitemap

In Batch / Sitemap, paste one URL per line, enter a sitemap URL, or open an XML or gzip-compressed sitemap file. The converter groups discovered sitemap URLs in sets of 20. Use Select all, Deselect all, or the individual checkboxes to choose the pages you want. Each run converts up to 20 selected pages from their original HTML.

Download the combined Markdown to read the batch in one document, or use the ZIP to get a separate file for each successful page. The llms.txt export gives you an index of titles and source URLs. Each page shows its own status, so one import failure still leaves the successful results available to download.

Prepare clean Markdown for documentation and AI

For project documentation, review the headings, tables, and code fences before moving the output to a README or wiki. For an AI prompt, extract the relevant sections and keep source links if you need to trace quotations or facts later. The single-page output shows an estimated token count to help you gauge how much text you’re about to paste. Use your model’s tokenizer when you need an exact count for the converted text.

Pasted HTML and local HTML files are converted in your browser. For a public URL import, a Cloudflare Worker fetches the requested page and sends its HTML to your browser for conversion. If your source is already on your device, you can start with the file or HTML snippet directly.

Open the converter

Frequently asked questions

What can you do with Convert HTML to Markdown?

Turn HTML snippets, saved HTML files, and public webpages into Markdown for documentation, notes, or AI prompts. Copy the result or download a .md file. For multiple pages, use Batch / Sitemap to export combined Markdown, a ZIP of individual files, or an llms.txt index.

How to convert to Markdown from HTML?

Paste your HTML into the editor, choose Upload file for a saved HTML file, or use Import URL for a public webpage. The output updates as you type by default. Use Preview to check the formatting, then copy the Markdown or select Download .md.

How does HTML to Markdown work?

The converter reads the HTML structure in your browser and translates headings, links, lists, simple tables, and code blocks into Markdown syntax. It removes scripts and styles. With Extract main content enabled, it also filters common page clutter such as navigation and cookie banners.

What does “Extract main content” remove?

It keeps the main article, directory, or guide and its introductory heading. It removes common navigation, banners, and sidebars. Turn it off in Settings to keep the surrounding page content. Both modes omit scripts, styles, and recognizable hidden elements.

Does my HTML leave my device?

Pasted HTML and local files are processed in your browser. If you choose Import URL, the URL is sent to a Cloudflare Worker to retrieve the public page. Conversion still happens in your browser.

Can I convert several pages from a sitemap?

Open Batch / Sitemap and paste one URL per line, enter a sitemap URL, or open an XML sitemap file. Choose up to 20 pages and convert them into one Markdown document, a ZIP of individual files, or an llms.txt index.

How do I import a page that needs JavaScript?

Select Render JavaScript under Import URL. This works for public pages whose scripts and data are available on the same hostname. If the page blocks automated browsers, requires sign-in, or rendering is busy, paste the rendered HTML from your browser or open a saved HTML file.

How accurate is the token estimate?

It is an approximation based on the text and punctuation in the Markdown. Actual counts vary by the model, tokenizer, and language. Check your model’s tokenizer if you are close to its context limit.