Web Analytics

 HTML to Markdown Converter

Convert HTML to Markdown in seconds. Paste an HTML fragment or a complete HTML page and this HTML to Markdown converter turns headings, paragraphs, bold and italic text, links, images, nested lists, blockquotes, code blocks and tables into clean, readable Markdown. Scripts, styles, forms and other elements without a Markdown equivalent are removed automatically. Copy the result or download it as a .md file for GitHub, README files, documentation, blogs or any Markdown editor. Everything runs client-side in your browser โ€” your HTML is never uploaded to a server.

โš™๏ธ Conversion options
HTML characters: 0 Markdown characters: 0 HTML lines: 0 Markdown lines: 0

โญ HTML to Markdown Converter - Explanation & Examples

The HTML to Markdown converter turns HTML markup into clean, readable Markdown syntax while keeping the structure and useful formatting of the original content. Headings stay headings, lists stay lists, links and images keep their URLs, and tables and code blocks are converted to their Markdown equivalents. The result is Markdown you can paste straight into GitHub, a README file, documentation, a CMS or any Markdown editor.


๐Ÿ”Ž What is an HTML to Markdown converter?

HTML is the markup language of web pages. Markdown is a lightweight text format that is much easier to read and edit and is used by GitHub, GitLab, Bitbucket, static site generators, documentation platforms, note-taking apps and many CMS systems. An HTML to Markdown converter reads the HTML tags and rewrites them as Markdown syntax: <h2> becomes ##, <strong> becomes **bold**, <a href> becomes [text](url), and so on.

Typical situations where you need to convert HTML to Markdown:

  • Moving website or blog content into a GitHub README or wiki
  • Migrating articles from WordPress or another CMS to a Markdown-based CMS or static site generator (Hugo, Jekyll, Astro, Docusaurus)
  • Reusing HTML help pages or manuals in documentation tools such as MkDocs, GitBook or Confluence
  • Pasting formatted content from a web page into a Markdown editor or note app (Obsidian, Notion, Typora)
  • Cleaning up HTML e-mail or editor output into simple, portable text

โš™๏ธ How the HTML to Markdown conversion works

  1. Paste an HTML fragment or a complete HTML page into the HTML input field. The Markdown appears automatically while you type or paste.
  2. Adjust the Conversion options if needed: preserve links, preserve images, convert tables, preserve line breaks and use fenced code blocks.
  3. Check the Markdown output and the statistics (HTML characters, Markdown characters, HTML lines and Markdown lines).
  4. Click Copy to copy the Markdown or Download .md to save it as a Markdown file.

๐Ÿ’ก Example: convert HTML to Markdown

HTML input:

<h2>Hello <strong>world</strong></h2>
<p>This is a <a href="https://example.com">link</a>.</p>
<ul>
  <li>One</li>
  <li>Two</li>
</ul>

Markdown output:

## Hello **world**

This is a [link](https://example.com).

- One
- Two

Table example:

<table>
  <thead><tr><th>Name</th><th>Role</th></tr></thead>
  <tbody><tr><td>Alice</td><td>Developer</td></tr></tbody>
</table>
| Name  | Role      |
| ----- | --------- |
| Alice | Developer |

โœ… Supported HTML elements

  • <h1> โ€“ <h6> โ†’ # to ###### headings
  • <p> โ†’ paragraphs separated by a blank line
  • <strong>, <b> โ†’ **bold**; <em>, <i> โ†’ *italic*; <del>, <s> โ†’ ~~strikethrough~~
  • <a> โ†’ [link text](URL) and <img> โ†’ ![alt text](URL), including title attributes
  • <ul>, <ol>, <li> โ†’ bulleted and numbered lists, including nested lists
  • <blockquote> โ†’ lines starting with >
  • <code> โ†’ inline code and <pre><code> โ†’ fenced code blocks (language classes such as language-js are kept)
  • <hr> โ†’ --- and <br> โ†’ Markdown line breaks
  • <table> with <thead>, <tbody>, <tr>, <th> and <td> โ†’ Markdown tables
  • HTML entities such as &amp;, &lt;, &gt;, &quot; and &nbsp; are decoded to normal characters

๐Ÿงน Automatic HTML cleanup

Elements without a useful Markdown equivalent are removed during conversion: <script>, <style>, <noscript>, <iframe>, <svg>, <form>, <input>, <button> and the <head> of a full page. Attributes such as class, id, style and data-* are ignored, while relevant attributes like href, src, alt and title are kept. Wrapper elements such as <div>, <section> and <span> disappear but their content is preserved, so the converter produces clean Markdown instead of a tag-for-tag replacement.


โš ๏ธ Tips for best results

  • You can paste a complete HTML page; the converter automatically skips the <head>, scripts and styles and converts the visible body content.
  • Tables with merged cells (colspan/rowspan) are flattened, because Markdown tables do not support merged cells.
  • Disable Convert tables if you only need the table text as tab-separated lines.
  • Disable Use fenced code blocks to get classic four-space indented code blocks instead of ``` fences.
  • Characters with a special meaning in Markdown (such as *, _ and [) are escaped in normal text so your content renders exactly as intended.

๐Ÿ”’ Privacy

The HTML to Markdown conversion runs entirely in your browser using JavaScript. Your HTML is never uploaded to the WebTextTools server, which makes the tool safe for internal documentation, draft articles and confidential content.


๐Ÿš€ Try the HTML to Markdown converter

Paste your HTML above and get clean Markdown instantly. Copy the result or download it as a .md file for GitHub, README files, documentation or your favourite Markdown editor.


This tool is also known as

  • html to markdown converter
  • convert html to markdown online
  • html to md converter
  • html to markdown for github readme
  • turn html into markdown text

Frequently Asked Questions

Paste your HTML into the HTML input field. The Markdown output appears automatically while you type or paste. Then use Copy to copy the Markdown to your clipboard or Download .md to save it as a Markdown file.

Yes. HTML tables with thead, tbody, tr, th and td elements are converted to Markdown tables with a header row and separator line. Cells are aligned for readability, and text-align or align attributes are converted to Markdown column alignment. Merged cells (colspan/rowspan) are flattened because Markdown tables do not support them.

Yes. You can paste a complete HTML document including the html, head and body tags. The converter skips the head section, scripts, styles, iframes, forms and other non-content elements and converts the visible body content to Markdown.

Yes, by default. Links become [link text](URL) and images become ![alt text](URL). Title attributes are kept as well. If you only want the plain text, disable the Preserve links or Preserve images options.

No. The entire HTML to Markdown conversion runs in your browser with JavaScript. Your HTML is never sent to or stored on the WebTextTools server, so the tool is safe for confidential or unpublished content.

Yes. Click Download .md to save the generated Markdown as a .md file that you can open in any Markdown editor or add to a GitHub repository.

Headings (h1 to h6), paragraphs, bold, italic and strikethrough text, links, images, ordered and unordered lists including nested lists, blockquotes, inline code, pre/code blocks, horizontal rules, line breaks and tables. HTML entities such as &amp;, &lt;, &gt;, &quot; and &nbsp; are decoded automatically.

Elements without a Markdown equivalent, such as script, style, noscript, iframe, svg, form, input and button, are removed during conversion. Attributes like class, id, style and data-* are ignored, while href, src, alt and title are kept.

Yes. Nested ul and ol lists are converted to indented Markdown list items, so the hierarchy of your list is preserved. Numbered lists also respect the start attribute.

When enabled, pre/code blocks are converted to fenced code blocks using three backticks, and a language class such as language-javascript is added as the code fence language. When disabled, code blocks are indented with four spaces instead.

When enabled, br tags are converted to Markdown hard line breaks (two trailing spaces followed by a new line) and line breaks inside table cells become <br>. When disabled, br tags are replaced by a single space so the text flows together.

Characters such as *, _, [ and ] have a special meaning in Markdown. When they appear in normal text, the converter escapes them with a backslash so your content renders exactly as it did in the HTML instead of accidentally becoming bold, italic or a link.

The Markdown output follows common GitHub Flavored Markdown conventions and works in GitHub, GitLab, Bitbucket, README files, documentation tools such as MkDocs and Docusaurus, static site generators, note-taking apps and most Markdown-based CMS platforms.

Our web tools

General
Generate
HTML entities
Text to HTML
Clean code
URL
  • URL cleaner
    Clean, normalize, and sanitize URLs in bulk โ€” remove UTM, fbclid, gclid and other tracking parameters
  • URL parser
    Parse URL structure, query values, tracking parameters, and generate a clean URL
Web colors
Compress
Encoding & decoding
Extract