# HTML to Markdown

> Paste HTML and get clean Markdown: headings, links, lists, code blocks, images, quotes and tables as GFM. Scripts and styles are stripped. Runs in your browser.

Use it free at https://swipetolaunch.com/tools/html-to-markdown

## How to use it

1. **Paste HTML.** A full page, a CMS export or a snippet copied from your browser's dev tools.
2. **Add a base URL.** Optional. Relative links and image paths become absolute so they still work elsewhere.
3. **Copy or download.** The Markdown updates as you paste. Copy it or save it as a .md file.

## When you need HTML as Markdown

Markdown is the format most writing tools now share: GitHub READMEs, docs sites, static site generators like Astro and Hugo, Notion and Obsidian imports, and the prompts you paste into AI assistants. Moving a blog from WordPress, rescuing a page from an old CMS, or feeding a web page to an LLM all start with turning HTML into Markdown.

## What gets converted

- **Headings** h1–h6 become # to ######.
- **Emphasis**: strong and b become `**bold**`, em and i become `*italic*`, del and s become `~~strikethrough~~`.
- **Links and images** keep their URL and title. Links where the text is the URL become autolinks.
- **Lists** keep nesting and the start number of ordered lists. Checkboxes become GFM task items.
- **Code**: inline code gets the right number of backticks; pre blocks become fenced code with the language from a `language-*` class.
- **Blockquotes**, including nested ones, **horizontal rules** and **line breaks**.
- **Tables** become GitHub-flavored Markdown tables, with column alignment and escaped pipes.

Scripts, styles, forms, iframes and other non-content elements are dropped. Text that would accidentally turn into Markdown, such as a line starting with "1." or "#", is escaped.

## How it stays private

The HTML is parsed by your browser's own DOMParser into an inert document, so scripts in it never run and images never load. Nothing is uploaded.

## Converting a live page

To convert a page by URL instead of pasting its source, use [webpage to Markdown](/tools/webpage-to-markdown). To turn a spreadsheet into a Markdown table, use [CSV to Markdown](/tools/csv-to-markdown).

## What you get

- Headings, links, images, lists, code, quotes, rules and tables
- GFM tables with alignment, task lists and strikethrough
- Resolves relative URLs against a base URL
- Strips scripts, styles and form elements
- Parsed locally with DOMParser; nothing is uploaded

## Questions

### Does it support tables?

Yes. HTML tables become GitHub-flavored Markdown tables. Header cells set the header row, align attributes and text-align styles set column alignment, and pipes inside cells are escaped.

### What happens to scripts and styles?

They are removed, along with forms, iframes, video and other non-content elements. The HTML is parsed into an inert document, so nothing in it runs while you convert.

### Why are some characters escaped with a backslash?

So they stay as text. An asterisk or a line starting with "1." would otherwise turn into emphasis or a list when the Markdown is rendered.

### Can I convert Markdown back to HTML?

Not with this tool. Most Markdown editors, static site generators and GitHub render Markdown to HTML for you.
