Skip to content

HTML to Markdown Converter

Convert HTML code to clean Markdown syntax. Preserves headings, links, lists, images, bold, italic, and code formatting.

HTML to Markdown Converter tool

Loading...

Example

Input: <h2>Title</h2><p>Visit <a href="https://example.com">our site</a> for <strong>more</strong>.</p>

Result: ## Title / (blank line) / Visit [our site](https://example.com) for **more**.

An h2 becomes a ## heading, links become [text](url) and strong text is wrapped in double asterisks.

HTML Elements and Their Markdown

HTMLMarkdown
<h2>Title</h2>## Title
<strong>bold</strong>**bold**
<em>italic</em>_italic_
<del>old</del>~~old~~
<a href="https://example.com">site</a>[site](https://example.com)
<img src="cat.png" alt="cat">![cat](cat.png)
<code>x = 1</code>`x = 1`
<ul><li>one</li><li>two</li></ul>- one / - two
<ol><li>one</li><li>two</li></ol>1. one / 2. two
<blockquote>quote</blockquote>> quote
<hr>* * *
<span style="color:red">red</span>red
<p>5 &lt; 6 &amp; 7</p>5 < 6 & 7
<script>alert(1)</script>(removed)

A slash marks a line break in the Markdown output.

  1. Paste the HTML you want to convert into the left panel.
  2. Read the Markdown that appears at once in the right panel.
  3. Edit the Markdown directly if needed - your changes are turned back into HTML on the left.
  4. Check that headings, links, lists and formatting came through as expected.
  5. Click the copy button to copy the Markdown for your docs or editor.

Turning HTML Back Into Clean Markdown

This converter turns HTML into Markdown. Paste part of a web page, a CMS export or an email template, and you get clean Markdown back. An h2 becomes ##, strong text becomes **text**, links become [text](url) and simple tables become pipe tables.

It is handy when you move content from a website or blog into a Markdown system, such as a static site generator like Hugo or Jekyll, a docs tool, Obsidian or a GitHub README. Markdown files are small, easy to read in any text editor and simple to track with version control.

Anything Markdown cannot show is dropped, but its text is kept. Classes, inline styles and div or span wrappers disappear, so a red span becomes plain text. Scripts, styles, iframes and embeds are removed along with their contents. Entities such as &amp; and &lt; are turned back into & and <. Characters that would trigger Markdown by accident, like a * at the start of a line, are escaped with a backslash.

The output uses # headings, - for bullets, _ for italics and fenced ``` code blocks. Merged cells and nested tables do not survive the trip to a pipe table. Edit the Markdown panel and the HTML side updates, using the same engine as our Markdown to HTML Converter. To tidy leftover entities in raw HTML, use HTML Entity Encode and Decode.

Sources

Frequently Asked Questions

Yes, but paste only the part you need. A full page source includes menus, footers, cookie banners and tracking code. Scripts and styles are removed, but menu links and footer text would still end up in your Markdown. Copy the main article element from the page source for the cleanest result.
It keeps a reference to each image as ![alt text](address), using the src and alt of the img tag. The image files themselves are not downloaded or moved. If the HTML uses relative paths such as /images/cat.png, check that those paths still work where your Markdown will live.
Markdown pipe tables are simple: one line per row and no merged cells. Cells that span several columns or rows, nested tables and line breaks inside a cell cannot be shown that way. Line breaks in a cell become spaces, and any | character in a cell is escaped so the row does not split.
Both _text_ and *text* mean italics in Markdown, and every common Markdown reader accepts either one. This converter uses underscores for italics and double asterisks for bold, so the two are easy to tell apart. If your style guide prefers asterisks, swap them with a find and replace.

Related Tools

Markdown to HTML Converter

Convert Markdown text to clean, semantic HTML. Supports headings, lists, links, images, code blocks, tables, and more.

Text and Writing

Markdown to PDF

Convert Markdown documents to styled, downloadable PDF files. Supports headings, lists, code blocks, and tables.

File Converters

Word to Text Extractor

Extract plain text content from .docx Word documents directly in your browser using mammoth.js. No server upload needed.

File Converters

Find and Replace

Find and replace text with regular expressions, capture groups, case-sensitive matching, and a live match count.

Text and Writing

HTML WYSIWYG Editor

Rich text editor with formatting toolbar that outputs clean HTML. Edit visually and copy the generated code.

Web and SEO Tools

HTML Entity Encode and Decode

Convert special characters to HTML entities and decode HTML entities back to readable text.

Developer Tools