Skip to main content

Free Tool

HTML to Markdown Converter

Paste HTML source, or copy formatted text from Google Docs, Word, or any web page and paste it straight in. You get clean GitHub Flavored Markdown with the headings, links, lists, tables, and code blocks intact. It all runs in your browser.

Copied text keeps its formatting as HTML on the clipboard. Paste it here to see that HTML.

How to convert HTML to Markdown

  1. Click Clear, then paste HTML source or formatted text into the left box.
  2. Read the Markdown on the right, or switch to Preview to see it rendered.
  3. Click Copy to paste it somewhere, or .md to download a file.

Paste formatted text, not just HTML

Copying from a browser, Google Docs, Word, Outlook, or Notion puts two versions on your clipboard: plain text and HTML. Most text boxes take the plain one. This box takes the HTML and shows it to you, so you can see exactly what the converter is working from.

If the plain text you copied is itself HTML, say from a code editor or the browser's View Source, it is used as is. That way pasting a snippet from VS Code converts the snippet, not the colored version of it.

What each HTML element becomes

Every element with a Markdown equivalent is converted. The output follows the GitHub Flavored Markdown rules for tables, strikethrough, and task lists:

How HTML elements are converted to Markdown
HTMLMarkdown
<h1> to <h6># to ######
<strong>, <b>, font-weight: 700**bold**
<em>, <i>, font-style: italic*italic*
<del>, <s>, line-through~~strike~~
<a href="...">[text](url), or <url> for a bare link
<ul>, <ol start>, nested lists- item, 3. item, indented
<input type="checkbox">- [x] task
<table> with align| pipe | table | with :--- alignment
<pre><code class="language-js">```js fenced block
<code>, <kbd>, monospace fonts`inline code`
<blockquote>> quote
<img alt title>![alt](src "title")
<br>, <hr>a backslash line break, ---
<sup>, <sub><sup>, <sub> (kept as HTML)

Google Docs and Word paste cleanly

Neither app writes tidy HTML. Google Docs sets bold with font-weight:700 on a span and wraps the whole selection in a <b> tag styled as normal weight. A converter that only looks at tags makes everything bold or nothing bold. This one reads the inline styles, so the Markdown matches what you saw in the document.

Word copies a bulleted list as a run of paragraphs, each starting with a fake bullet character and some spaces. The converter recognises those paragraphs, rebuilds them as a real list at the right depth, and keeps numbered lists numbered. For whole documents, the Word to Markdown converter reads the .docx file itself and also handles footnotes.

What does not convert

Markdown describes structure, not appearance. Colors, fonts, sizes, alignment, and layout divs are dropped and their text is kept. Underline has no Markdown syntax, so underlined text comes out plain (the underline guide covers the HTML workaround). Scripts, styles, forms, iframes, videos, and HTML comments are removed.

Tables become pipe tables with the first row as the header. Pipe tables cannot hold lists or several paragraphs in a cell, so cell content is joined with <br>, and a cell spanning two columns is followed by an empty one. The tables guide explains the limits.

HTML to Markdown for ChatGPT and Claude

A web page is mostly markup. Converting it to Markdown keeps the headings, lists, and tables a model needs to follow the content and throws away the tags, classes, and scripts that only cost tokens. The Markdown for AI guide covers why that structure helps, and the llms.txt guide shows how sites publish Markdown versions of their pages for AI tools.

Other ways to convert HTML to Markdown

This tool is quickest for a page or a paste. For files, builds, or scrapers, use one of these.

Pandoc

Files, folders, scripts
pandoc -f html -t gfm page.html -o page.md

Pandoc reads HTML and writes GitHub Flavored Markdown with -t gfm. Add --wrap=none to keep each paragraph on one line. It is the best choice for converting a saved site or a folder of exported pages.

Turndown

JavaScript and browser code
npm install turndown

const TurndownService = require("turndown")
const md = new TurndownService({ headingStyle: "atx", codeBlockStyle: "fenced" }).turndown(html)

Turndown is the most widely used JavaScript library for this. Its defaults are underlined (setext) headings and indented code blocks, so pass the two options above for the style most people expect. Tables need the separate turndown-plugin-gfm.

markdownify

Python scripts and scrapers
pip install markdownify

from markdownify import markdownify
md = markdownify(html, heading_style="ATX")

A small Python package built on BeautifulSoup. Handy when you are already scraping pages in Python, for example to feed them to an LLM. Pass heading_style="ATX" for # headings.

Going the other way? The Markdown to HTML converter turns Markdown back into HTML, and the Markdown to rich text converter turns it back into formatted text you can paste into Docs, Word, or Gmail.

Frequently asked questions

How do I convert HTML to Markdown?
Paste the HTML into the box on the left. The Markdown appears on the right as you type, and the Preview tab shows how it renders. Click Copy or download a .md file. Nothing is sent to a server.
Can I paste formatted text instead of HTML?
Yes. When you copy from Google Docs, Word, a web page, or an email, the clipboard carries an HTML version of the selection next to the plain text. The converter reads that HTML, so bold, links, headings, lists, and tables survive. If you copy HTML source code from an editor instead, it is converted as source.
Does it work with Google Docs?
Yes. Google Docs marks bold and italic with inline styles rather than <b> and <i>, and wraps the whole selection in a bold tag that is not actually bold. The converter reads the styles, so only text that looks bold comes out bold, and Docs' nested lists keep their nesting. Docs can also export Markdown itself: File, Download, Markdown (.md).
Does it work with text copied from Word?
Yes. Word copies lists as ordinary paragraphs with a fake bullet or number in front. The converter spots those paragraphs and rebuilds them as real Markdown lists, keeping the nesting level and whether the list was numbered. For a whole document, the Word to Markdown converter reads the .docx directly.
What happens to CSS, colors, and layout?
They are dropped. Markdown has no syntax for colors, fonts, alignment, or column layouts, so divs and spans contribute only their text. Scripts, styles, forms, iframes, and comments are removed entirely.
What happens to images?
Each <img> becomes a Markdown image with its alt text, URL, and title. Images embedded as base64 data, which pasted screenshots often are, are replaced with a #embedded-image placeholder so the Markdown stays readable. Width and height attributes are dropped.
Which Markdown flavor does it produce?
GitHub Flavored Markdown: ATX headings (#), - bullets, fenced code blocks with the language kept from a language- class, pipe tables with column alignment, ~~strikethrough~~, and [ ] task list items. That is what GitHub, Obsidian, VS Code, and most editors render.
Is my HTML uploaded anywhere?
No. The conversion is JavaScript running in your browser, and the preview renders in a sandboxed frame where nothing in the pasted HTML can run. It works with your network disconnected.