Free • Instant • Private

HTML to Markdown Converter

Strip away HTML clutter and get clean, readable markdown. Perfect for migrating web content, cleaning scraped HTML, or preparing content for markdown-based platforms.

or from Google Docs, Word or a web page

PDF · DOCX · XLSX · HTML · JSON · XML · CSV · TXT · RTF · MD

Benefits

Why Convert HTML to Markdown?

Strip away HTML clutter

remove tags, classes, and inline styles

Get clean, readable content

focus on the text, not the markup

Migrate web content easily

move from WordPress, Drupal, or any CMS to markdown

Prepare scraped content for AI

Markdown keeps the headings and lists a model needs and drops the markup it doesn't

Archive web pages

preserve content in a portable, future-proof format

No file upload required

all processing happens locally in your browser

Simple Process

How to Convert HTML to Markdown

1

Drop an HTML file or paste

Drag one or more .html or .htm files onto the converter, or click paste text and paste HTML source or content copied from a web page.

2

Let it convert in your browser

Scripts and styles are removed, and headings, lists, links, tables and code become Markdown. Nothing is uploaded.

3

Download the .md file

Download each file as Markdown, or all of them at once as a ZIP. Pasted HTML can be copied or saved as a .md file.

What gets converted

The converter cleans the HTML with DOMPurify, then turns it into Markdown with the Turndown library and its GitHub-flavored table plugin. This is what happens to each part of a page, checked against the converter itself.

HTML Converted? Markdown you get
<h1> to <h6> Yes # to ###### headings
<p> and <br> Yes Paragraphs; a <br> becomes a line break
<strong>, <b>, <em>, <i> Yes **bold** and *italic*
<del>, <s>, <strike> Yes ~~strikethrough~~
Bold or italic set with inline CSS Yes Bold and italic, the way Google Docs pastes them
<a href> Yes [text](url), with the URL kept exactly as written
<img> Yes ![alt](src). Images are not downloaded, only referenced.
<ul>, <ol>, nested lists Yes - and 1. lists, nested two spaces; a list's start number is kept
<blockquote> Yes > quotes
<pre><code class="language-js"> Yes A fenced code block tagged js
<code> Yes Inline code
<hr> Yes A * * * rule
<table> Partial A pipe table; the first row becomes the header. Merged cells (colspan, rowspan) are not expanded.
<pre> without <code> Partial The text and its line breaks are kept, but not inside a code fence
<u>, <mark>, <sub>, <sup> Partial The text is kept, the formatting is not (Markdown has no syntax for it)
Navigation, sidebars, footers Partial Kept as ordinary text and links, because the converter cannot tell them from the article
<script>, <style>, <iframe>, comments No Removed
Classes, IDs, inline styles No Removed

Use Cases

Common HTML Conversion Use Cases

Migrate WordPress to static sites

Moving your blog from WordPress to Hugo, Jekyll, or Astro? Convert your HTML posts to clean markdown in seconds.

Clean up scraped web content

Remove HTML tags, classes, and inline styles from web-scraped content before you feed it to an AI model or a documentation site.

Convert email newsletters

Transform HTML email templates into clean markdown for archiving or republishing on markdown-based platforms.

Archive web pages

Preserve important web content in a portable, future-proof format that will be readable long after the original site is gone.

Common problems and fixes

The output starts with menus and links

A saved web page contains the whole page: the header, navigation, cookie banner and footer, not just the article. The converter keeps all of it because there is no reliable rule for what counts as boilerplate. For a cleaner result, open your browser's developer tools, right-click the <article> or <main> element, choose Copy > Copy outerHTML, and paste that instead. Or select just the article text on the page, copy it, and paste it here as rich text.

Images point to the wrong place

Image and link URLs are kept exactly as they appear in the HTML. A relative path such as /images/chart.png only works on the original site. Replace the start of each path with the site's address, or download the images and update the paths to match your new folder.

The output has a very long line of random characters

That is an image embedded in the HTML as a data: URI. It is kept, so the picture still shows when the Markdown is rendered, but it can be thousands of characters long. Delete it, or save the image as a file and link to it.

A table didn't come out as a table

Markdown tables are simple grids. A table with merged cells, or a table nested inside another table, can't be written as a pipe table, and the result needs fixing by hand. Tables used for page layout in older sites and HTML emails are the usual culprit.

Pasted HTML source came back as tags

Code editors such as VS Code copy source code as formatted text, so the clipboard holds a colored copy of your tags rather than the HTML itself, and the converter dutifully keeps the tags as text. Save the code as an .html file and drop the file instead.

Pages that load their content with JavaScript

If you save a page with Save Page As and the article is missing, the site probably loads its text with JavaScript after the page opens. Copy the text from the open page in your browser and paste it here, or see the URL to Markdown guide for other ways to capture it.

Other ways to convert HTML to Markdown

  • Pandoc. The command-line converter handles HTML well and runs offline: pandoc -f html -t gfm page.html -o page.md. It is the better choice for scripting hundreds of files. See Craft Markdown vs Pandoc for a side-by-side.
  • Turndown. The open-source JavaScript library this page uses. If you are writing code, npm install turndown gives you the same conversion in your own project.
  • MarkItDown. Microsoft's Python library converts HTML along with many other formats, from the command line or Python. The MarkItDown Online page compares it with this tool.
  • Web clipper extensions. Browser extensions such as MarkDownload and Obsidian Web Clipper save the page you are reading as Markdown and try to pick out the main article for you.

This page suits one-off files and pasted snippets when you want the result in seconds without installing anything, and when the HTML shouldn't leave your computer.

FAQ

HTML to Markdown FAQ

Ready to convert your HTML?

Drop an HTML file and get clean, AI-ready markdown in seconds. No signup required.

Open the Converter