HTML to Markdown Converter
Paste raw HTML or enter a URL and get clean, portable Markdown instantly, with headings, links, images, tables, and code blocks preserved. Built for docs, READMEs, and feeding web content to LLMs.
Need the icons, social tags, or a preview of a page too? Check any URL's social cards with the Open Graph Preview & Checker. Converting pages in bulk or behind a login? ScreenshotRender returns clean Markdown for any URL through its API.
Free, no sign-up. Paste HTML or a URL; nothing you convert is stored.
01 · How it works
Paste HTML or a URL
Drop in raw HTML, or switch to URL mode and enter any public page. No login and nothing to install.
We convert to clean Markdown
We parse the markup and map every element (headings, lists, links, images, tables, and code) to portable Markdown.
Copy or download
Copy the Markdown to your clipboard or download it as a .md file, ready for your docs, README, or LLM.
What is Markdown, and why convert HTML to it?
Markdown is a lightweight markup language that formats plain text with a few simple symbols: # for headings, * for emphasis, - for lists, and [text](url) for links. It was created by John Gruber in 2004 to be easy to read and write, then render to HTML.
Converting HTML to Markdown strips a page down to its content and structure, throwing away the <div> soup, inline styles, scripts, and tracking markup. The result is clean, portable text that is smaller, easier to version-control, and far cheaper to feed to a large language model.
How to convert HTML to Markdown
Paste your HTML into the box above and the converter returns Markdown instantly. It walks the markup and maps each element to its Markdown equivalent: <h1> becomes #, <strong> becomes **bold**, <a> becomes a [link](url), and <ul> and <ol> become bullet and numbered lists.
You can paste a full page or a single fragment. Anything that is not real content (scripts, styles, comments, and empty wrappers) is dropped, so you get just the readable text.
How to convert a URL or web page to Markdown
Switch to URL mode, paste any public page, and the tool fetches the live HTML and converts it to Markdown in one step. This is the fastest way to turn a blog post, documentation page, or article into clean Markdown without copying and pasting.
A plain fetch works for most server-rendered pages. For pages that render with JavaScript, sit behind a login or a Cloudflare challenge, or that you need to convert in bulk, the ScreenshotRender API returns the same clean Markdown for any URL through a single call. If you would rather capture the page visually, the Webpage to Image tool renders it to PNG instead.
Convert HTML to Markdown for LLMs, RAG, and AI
Large language models work best with Markdown, not raw HTML. Markup tags, classes, and inline styles waste tokens and add noise that can confuse a model, while Markdown keeps the headings, lists, and emphasis that actually carry meaning. Converting first means more of your context window holds real content.
This is why Markdown is the default format for retrieval-augmented generation (RAG) pipelines, prompt context, and fine-tuning datasets. Convert each page to Markdown, chunk it on its headings, and you have clean, structured input for embeddings or a prompt without the HTML overhead.
What this HTML to Markdown converter supports
The converter handles the common HTML elements and maps them to standard and GitHub Flavored Markdown:
- Headings:
<h1>through<h6>become#to######. - Text:
<strong>and<b>to**bold**,<em>and<i>to*italic*. - Links and images:
<a>to[text](url)and<img>to, with relative URLs resolved to absolute in URL mode. - Lists: ordered and unordered lists, including nested lists, become
-and1.items. - Code:
<code>becomes inline code and<pre>becomes a fenced code block. - Tables, quotes, and rules:
<table>becomes a GitHub-style table,<blockquote>becomes a quote, and<hr>becomes a horizontal rule.
Convert HTML to Markdown in Python
If you need to convert HTML to Markdown in code, Python has two common libraries. markdownify gives you a one-line md(html) call with options for heading style and link handling, and html2text turns full pages into Markdown with fine control over wrapping and images.
Both are great for batch jobs and notebooks. To convert a live URL rather than a string of HTML, fetch the page first (for example with requests) and pass the HTML to the converter, or call a hosted API that does the fetch and the conversion in one step.
Convert HTML to Markdown in JavaScript and Node
In JavaScript, the standard library is Turndown. It runs in both the browser and Node, converts an HTML string with new TurndownService().turndown(html), and supports plugins for GitHub Flavored Markdown features like tables and strikethrough.
For a server-side workflow in Node, fetch the page, pass the response body to Turndown, and write the Markdown to disk or a database. That is essentially what this tool does, so you can prototype here and move to code when you are ready.
Convert rich text, Google Docs, and Word to Markdown
When you copy from Google Docs, Microsoft Word, or a web page, your clipboard usually carries HTML behind the rich text. Paste that HTML here and the tool converts it straight to Markdown, so headings, bold, links, and lists survive the move.
It is a quick way to bring a formatted document into a Markdown-based system like a README, a static-site post, a wiki, or a notes app, without reformatting everything by hand.
HTML to Markdown vs Markdown to HTML
The two conversions are opposites. HTML to Markdown simplifies rendered markup into plain, portable text, which is what you want for writing, storage, and feeding content to an LLM. Markdown to HTML does the reverse, turning Markdown source into the HTML a browser displays, which is what a static-site generator does at publish time.
Markdown also allows raw HTML inside it, so an element this converter cannot map cleanly can be left as HTML and most Markdown renderers will still display it. If you need the other direction, a Markdown-to-HTML converter or any static-site framework will render your Markdown to a web page.
More free tools
Favicon Checker & Grabber
Find, preview, and download any website's favicons.
Full Page Screenshot
Capture the entire scrolling webpage of any URL.
Meta Description Generator
Write and preview your meta description with a live SERP snippet.
OG Image Generator
Design and download a 1200×630 Open Graph image for any page.
Open Graph Preview & Checker
Test how any URL looks when shared on social media.
Twitter/X Card Generator & Preview
Generate twitter: meta tags and preview your X card live.
Webpage to Image
Turn any public URL into a downloadable image.
FAQ
Common questions
Everything about the HTML to Markdown Converter.
Common questions
An HTML to Markdown converter takes HTML markup and rewrites it as Markdown, the lightweight plain-text format. It maps each HTML element to its Markdown equivalent, so headings, bold and italic text, links, images, lists, tables, and code blocks are preserved while the tags, classes, and inline styles are stripped away.
Paste your HTML into the box above and the Markdown appears instantly on the right, ready to copy or download as a .md file. If you want to convert a live page instead, switch to URL mode and enter the page address, and the tool fetches the HTML and converts it for you.
Yes. The HTML to Markdown converter is completely free and needs no account. You can paste HTML or a URL and convert as many times as you like, and nothing you convert is stored.
Yes. Switch to URL mode, paste any public page, and the tool fetches the live HTML and returns clean Markdown in one step. A plain fetch works for most server-rendered pages; for JavaScript-rendered pages, pages behind Cloudflare, or bulk jobs, the ScreenshotRender API returns the same clean Markdown for any URL.
Yes. Markdown was designed to allow raw HTML inline, so you can drop an HTML tag into a Markdown document and most renderers will display it. That means anything a converter cannot map to pure Markdown can usually be left as HTML without breaking the output.
HTML is the markup language browsers render, using angle-bracket tags like h1, p, and a, plus attributes and styles. Markdown is a much simpler plain-text format that uses symbols like # and * and renders to HTML. HTML is for display in a browser; Markdown is for writing, storage, and tools that prefer clean text, such as LLMs.
Large language models read Markdown more efficiently than raw HTML. HTML tags, classes, and inline styles consume tokens and add noise, while Markdown keeps the structure that carries meaning. Converting pages to Markdown first lets more of your context window hold real content, which is why RAG pipelines and fine-tuning datasets standardize on Markdown.
Use the markdownify library for a one-line md(html) call, or html2text for more control over wrapping and images. For a live page, fetch it first with a library like requests, then pass the HTML string to the converter. Both libraries are well suited to batch conversion in scripts and notebooks.
Use Turndown, the standard JavaScript library. Call new TurndownService().turndown(html) to convert an HTML string to Markdown in the browser or in Node, and add the GitHub Flavored Markdown plugin if you need tables and strikethrough. On the server, fetch the page, pass the body to Turndown, and save the Markdown.
Yes. Tables become GitHub-style Markdown tables, images become Markdown image syntax with their alt text, and code is preserved as inline code or fenced code blocks. Lists, including nested lists, blockquotes, and horizontal rules are converted as well.
This tool converts HTML to Markdown. To go the other way, use a Markdown-to-HTML converter or any static-site framework, which renders Markdown source into the HTML a browser displays. The two directions are opposites: HTML to Markdown for clean storage, Markdown to HTML for publishing.
Your input is converted on the fly and is not stored. The HTML or URL you submit is used only to produce the Markdown that is returned to you, and nothing is saved or logged for later use.
GitHub Flavored Markdown (GFM) is a widely used superset of Markdown that adds tables, task lists, strikethrough, and automatic links on top of the original syntax. This converter outputs GFM-compatible Markdown, such as pipe tables, so the result renders correctly on GitHub and most modern Markdown tools.
Yes. After converting, use the Download button to save the result as a .md file, or use Copy to put the Markdown on your clipboard. The output is plain text, so it drops straight into a README, a docs page, a static-site post, or a notes app.
Get Started
Need to generate og:images at scale?
ScreenshotRender renders pixel-perfect 1200×630 social images from any URL or HTML template. Start free with 100 screenshots, no credit card.
Want to integrate via API? Get your key here