Temp Mail Logo

Temp Mail safeguards your privacy while keeping your inbox free from spam.

📝 HTML -> Markdown · Tables · Code · Links · Lists

HTML to Markdown

Free online HTML to Markdown converter -- convert any HTML into clean, readable Markdown instantly in your browser. Supports headings, links, images, tables, code blocks, lists, and blockquotes. Perfect for GitHub README files, documentation, and static site generators. Nothing sent to any server.

✓ Tables → GFM✓ Code blocks✓ All list types✓ Links & images✓ 100% client-side
HTML Input
Markdown Output
Markdown output appears here...
What this tool does

Free HTML to Markdown converter -- convert HTML code to clean Markdown online

This free HTML to Markdown converter takes any HTML markup and transforms it into clean, readable Markdown syntax entirely in your browser. Paste any HTML -- from a CMS export, a copied web page, an email template, or hand-written code -- into the input field and click Convert. The tool processes all the supported HTML elements simultaneously and outputs well-formatted Markdown ready to paste into GitHub, Notion, Confluence, a static site generator, or any other Markdown-based platform. The sample button loads a realistic multi-element HTML document so you can see the converter in action immediately.

The converter works by applying a sequence of regex-based transformation passes to the HTML string. It processes elements in a specific order to handle nesting correctly: pre blocks are processed first to protect code content, then inline elements like code, bold, italic, and links, then block elements like headings, lists, blockquotes, and tables, and finally paragraphs and divs. After all transformations, any remaining HTML tags are stripped and HTML entities are decoded. Excess blank lines are collapsed to produce clean, consistent output with standard Markdown spacing between elements.

HTML to Markdown conversion is useful across a wide range of professional workflows. Content teams use it to migrate blog posts from CMS platforms that export HTML into Markdown-based static site generators like Hugo, Jekyll, Gatsby, or Astro. Developers use it to convert HTML documentation into Markdown files for GitHub README pages and wikis. Technical writers use it to move content between documentation systems. Email marketers use it to extract the text structure from HTML email templates. Academics and researchers use it to convert web-scraped HTML articles into Markdown for storage in plain-text note-taking systems like Obsidian or Logseq.

Supported HTML elements
h1 - h6
# Headings
p
Paragraphs
strong / b
**Bold**
em / i
_Italic_
del / s
~~Strikethrough~~
a
[Link](url)
img
![alt](src)
ul / li
- Unordered list
ol / li
1. Ordered list
blockquote
> Blockquote
pre / code
``` Code block
code
`Inline code`
table
| GFM table |
hr
--- Divider
br
Line break
Features and capabilities
15 element types
Converts all common HTML elements that have Markdown equivalents, covering the full range of content you encounter in real-world HTML documents.
GFM table support
Tables are converted to GitHub-Flavoured Markdown pipe table syntax, compatible with GitHub, GitLab, Notion, Obsidian, and most modern Markdown renderers.
Fenced code blocks
Both pre and code tag combinations are converted to triple-backtick fenced code blocks, preserving the code content exactly as written.
Nested inline tags
Bold, italic, strikethrough, and code within links, list items, and headings are all handled correctly by processing inline elements before block elements.
Entity decoding
HTML entities including &, <, >, ", ', and   are decoded to their plain-text equivalents in the Markdown output.
Graceful tag stripping
Tags with no Markdown equivalent are silently removed while preserving their text content, ensuring no content is lost during conversion.
100% client-side
All conversion runs in your browser with zero server involvement -- paste HTML and get Markdown instantly with no data leaving your device.
One-click copy
The Copy Markdown button writes the complete converted output to your clipboard instantly with a visual confirmation state.
Examples

HTML to Markdown conversion examples -- before and after for common use cases

These examples show the HTML input and Markdown output side by side for realistic content from blogs, documentation, and developer workflows.

ExcellentBlog post structure -- headings, paragraphs, bold and italic
HTML input
<h1>Why Use Next.js</h1> <p>Next.js is a <strong>React framework</strong> for building <em>production-ready</em> apps.</p> <h2>Key Benefits</h2>
Markdown output
# Why Use Next.js Next.js is a **React framework** for building _production-ready_ apps. ## Key Benefits
Headings convert to # prefix notation, bold becomes **double asterisks**, and italic becomes _underscores_. The output is clean, immediately readable as plain text, and renders correctly in GitHub, Notion, Hugo, and every major Markdown platform. This is the most common use case: migrating blog posts from a CMS into a static site generator.
GoodDocumentation with code block and ordered list
HTML input
<h2>Installation</h2> <pre><code>npm install mylib </code></pre> <ol> <li>Import the library</li> <li>Configure settings</li> <li>Call init()</li> </ol>
Markdown output
## Installation ``` npm install mylib ``` 1. Import the library 2. Configure settings 3. Call init()
Pre/code blocks become fenced triple-backtick code blocks, preserving the code content exactly. Ordered lists become numbered Markdown lists. This pattern is extremely common in technical documentation -- the resulting Markdown is perfect for GitHub README files, developer wikis, and documentation platforms like GitBook and Docusaurus.
ExcellentData table converted to GitHub-Flavoured Markdown
HTML input
<table> <tr> <th>Plan</th><th>Price</th> </tr> <tr> <td>Free</td><td>$0</td> </tr> <tr> <td>Pro</td><td>$12/mo</td> </tr> </table>
Markdown output
| Plan | Price | | --- | --- | | Free | $0 | | Pro | $12/mo |
HTML tables are converted to GFM pipe table syntax with an automatic separator row of --- dashes after the header. The output renders as a properly formatted table on GitHub, GitLab, and any GFM-compatible renderer. This is ideal for pricing tables, comparison grids, and data tables in technical documentation.
FairLinks and images -- converted correctly, inline styles lost
HTML input
<a href="https://example.com" style="color:blue"> Visit site </a> <img src="hero.jpg" alt="Hero image" width="800">
Markdown output
[Visit site](https://example.com) ![Hero image](hero.jpg)
Links and images convert cleanly to Markdown syntax. The href and src attributes are preserved, and the alt text becomes the Markdown image alt text. However, HTML-specific attributes like style, width, height, and CSS classes are dropped because Markdown has no equivalent. If you need to control image sizing, you will need to use an HTML img tag directly in your Markdown file, which most renderers support.
Needs cleanupLayout divs and span styling -- text preserved, structure lost
HTML input
<div class="hero-section"> <span style="font-size:2em"> Welcome </span> <div class="subtitle"> Get started today </div> </div>
Markdown output
Welcome Get started today
Structural div and span elements have no Markdown equivalent, so they are stripped and only the text content is preserved. CSS classes, font sizes, and layout attributes are all lost. The output requires manual editing -- in this case, adding a # heading and removing the extra blank line. For content-heavy HTML with proper semantic markup, the conversion is much cleaner than for layout-heavy HTML that relies on divs and spans for visual structure.
FAQ

Frequently asked questions about HTML to Markdown conversion

What is an HTML to Markdown converter and what does it do?
An HTML to Markdown converter takes HTML markup -- the language of web pages -- and transforms it into Markdown, a lightweight plain-text formatting syntax. The converter maps each HTML element to its closest Markdown equivalent: h1 becomes # Heading, strong becomes **bold**, a href becomes [link](url), and so on. This makes HTML content portable, readable as plain text, and compatible with tools that use Markdown as their native format, such as GitHub, Notion, Hugo, Jekyll, and most modern documentation platforms.
What HTML elements does this converter support?
This converter handles all the HTML elements that have direct Markdown equivalents. Headings h1 through h6 are converted to the corresponding number of # characters. Paragraphs become plain text blocks. Bold (strong, b) becomes **text**, italic (em, i) becomes _text_, and strikethrough (del, s) becomes ~~text~~. Links become [text](url), images become ![alt](src), unordered lists become - items, ordered lists become numbered items, blockquotes become > prefixed lines, code blocks become fenced ``` blocks, inline code becomes `backtick` notation, tables become GFM pipe tables, and horizontal rules become ---.
Why convert HTML to Markdown format?
Markdown is significantly more readable as plain text than HTML. A Markdown file can be read comfortably without rendering, while HTML is cluttered with angle brackets and attributes. Markdown is also much easier to write and maintain by hand. It is the de-facto standard for GitHub README files, documentation in tools like Confluence and Notion, blog posts in static site generators like Hugo and Jekyll, and developer wikis. Converting HTML content to Markdown makes it portable across all these platforms and easier to store and diff in version control systems like Git.
What happens to HTML tags that have no Markdown equivalent?
HTML elements that have no direct Markdown equivalent -- such as div, span, table styles, CSS classes, inline styles, script, and style tags -- are stripped from the output. Importantly, their text content is preserved wherever applicable. For example, a span element with a CSS class is removed but the text inside the span remains in the output. Script and style blocks are removed entirely since their content is code or styling instructions rather than readable text content. This approach ensures the output is clean Markdown without broken syntax.
How does this tool convert HTML tables to Markdown?
HTML tables are converted to GitHub-Flavoured Markdown (GFM) pipe table syntax. The first row of the table (whether it uses th or td cells) becomes the header row. A separator row of --- dashes is automatically inserted after the header to define column alignment. Subsequent rows become pipe-delimited data rows. For example, a table with three columns and two data rows becomes a four-line Markdown table with a header, separator, and two data rows. Note that complex table features like colspan, rowspan, or nested tables are simplified to basic pipe table syntax.
Is my HTML content sent to any server when using this tool?
No -- all HTML to Markdown conversion runs entirely in your browser using a JavaScript implementation. When you click Convert, the processing happens locally on your device using the browser's JavaScript engine. Nothing is sent to any server, no requests are made, and no data is logged or stored anywhere. This makes the tool completely safe for converting confidential HTML content such as internal documentation, proprietary CMS exports, or email templates containing sensitive information. The tool works fully offline once the page has loaded.
How do I convert a WordPress blog post from HTML to Markdown?
To convert a WordPress post, open the post in your WordPress editor and switch to the HTML or Code editor mode (not the visual block editor). Select all the HTML content and copy it. Paste it into the HTML Input field in this tool and click Convert to Markdown. The converter will transform all headings, paragraphs, bold and italic text, links, images, and lists into clean Markdown. If your post has custom shortcodes or WordPress-specific HTML attributes, those will be stripped but the text content preserved. The resulting Markdown can be used in any Markdown-based CMS or static site generator.
Can I use this tool to convert HTML emails to Markdown?
Yes, with some caveats. HTML emails often use complex table-based layouts for visual structure rather than for data, and these layout tables will be converted to Markdown pipe tables which is probably not what you want. The best approach is to paste the email HTML and then clean up the output -- removing layout table artifacts and keeping the text content. Email-specific HTML like inline styles, conditional comments, and MSO tags are all stripped, so the text content is preserved cleanly. For newsletters or text-heavy emails with minimal layout tables, the conversion works very well out of the box.
What is the difference between this tool and the Pandoc HTML to Markdown converter?
Pandoc is a powerful command-line document conversion tool that supports dozens of formats including HTML to Markdown. It provides more conversion options, handles more edge cases, and supports extended Markdown variants like MultiMarkdown and CommonMark. This tool is a browser-based converter designed for quick, one-off conversions without installing software. It handles all the common HTML elements that cover the vast majority of real-world use cases. For batch conversion, server-side automation, or complex documents with advanced formatting, Pandoc is a better choice. For quick conversions of blog posts, documentation, and CMS content, this tool works immediately without setup.
How do I convert HTML to Markdown for a GitHub README file?
GitHub README files use GitHub-Flavoured Markdown (GFM), which is a superset of standard Markdown. This tool outputs GFM-compatible Markdown, including pipe tables (a GFM-specific syntax), fenced code blocks with triple backticks, and strikethrough with double tildes -- all of which are GFM extensions not in the original Markdown spec. To create a README, paste your HTML documentation or project description into this converter, click Convert, then copy the output and save it as README.md in your repository root. GitHub will automatically render it as formatted documentation on your repository page.

Need a disposable email address?Generate a free, instant throwaway -- zero signup, zero trace.

Get Free Temp Mail ->