HTML to Markdown Converter

Turn any HTML page or snippet into clean, portable Markdown in one click.

HTML to Markdown Converter

This tool reads your HTML and rewrites it as Markdown code.
It works with a whole page or a single snippet.
Enter your HTML in the "Input" box and the Markdown appears in the "Output" box instantly in live mode.


Load an example

Tip: Headings become #, ## and so on, links become [text](url), and tables become pipe tables. For example, <h2>Routes</h2>## Routes.

Convert your HTML to Markdown: paste HTML, upload a file, or load it from a URL.


Overview

The HTML to Markdown Converter reads a complete HTML document or a single snippet and produces a faithful Markdown version. It recognises the most common formatting elements and maps each one to its Markdown equivalent, so the structure of your content is preserved instead of being flattened into plain text.

It is built on the browser's native HTML parser, which means it tolerates messy, real-world markup, like: self-closing tags, missing attributes and unquoted values – the same way a web browser would. The output is ready to drop into GitHub, Notion, Discord, a wiki, a static-site generator or any Markdown editor.


What Converts to What

Here is exactly how each HTML element is translated to Markdown:

<h1>: a level-1 heading becomes #. Example: <h1>Routes</h1># Routes.

<h2>: a level-2 heading becomes ##. Example: <h2>Routes</h2>## Routes.

<h3>: a level-3 heading becomes ###. Example: <h3>Routes</h3>### Routes.

<h4>: a level-4 heading becomes ####. Example: <h4>Routes</h4>#### Routes.

<h5>: a level-5 heading becomes #####. Example: <h5>Routes</h5>##### Routes.

<h6>: a level-6 heading becomes ######. Example: <h6>Routes</h6>###### Routes.

<p>: paragraphs become plain Markdown paragraphs separated by a blank line. Example: <p>Hello</p>Hello.

<strong> / <b> and <em> / <i>: bold text becomes **text** and italic text becomes *text*. Deleted or struck text (<del>, <s>, <strike>) becomes ~~text~~.

<a> and <img>: links become [link text](https://example.com) and images become ![alt text](image.png), each keeping its title attribute when present.

<ul> and <ol>: bullet lists become - item lines and numbered lists become 1. item lines, with nested lists indented by four spaces per level.

<blockquote>: quoted paragraphs are prefixed with > on every line.

<table>: tables are converted to pipe-delimited Markdown tables with a --- header separator row.

<code> and <pre>: inline <code> becomes backtick `code`, while a <pre> block becomes a fenced code block ``` and keeps its language tag (for example class="language-javascript"```javascript).

<hr> and <br>: horizontal rules become --- and line breaks become Markdown line breaks.

Other containers: structural wrappers such as <div>, <section>, <article>, <header> and <footer> are unwrapped and their contents converted normally. HTML comments are dropped, and any HTML entities are automatically decoded to the characters they represent.


How to Use

1. Enter your HTML: Type or paste it into the Input box, click "Load an example", upload a .html or .txt file, or load a whole page from a URL.

2. Read your result: In Live mode the Output updates as you type; otherwise press "Convert to Markdown" to convert manually.

3. Load from a URL: Type a page address in the "Load HTML from a URL" box and click "Load URL". It fetches the page's markup through our proxy so you can convert a live article without copying its source.

4. Check the result: Headings, lists, tables, code blocks, links and more are all mapped to Markdown, so what you see matches your HTML's structure.

5. Save it: Use the Copy or Download icons just below the Output area to keep the result as a .md file.


Where to Use Markdown Codes?

Markdown is plain text, which means the code this tool produces works almost anywhere. The only requirement is an application that understands Markdown formatting, and most modern ones do.

Code Repositories and Software Documentation:

GitHub, GitLab and Bitbucket render Markdown natively, so the output is ready for README files, project wikis, issue descriptions and pull request comments.

Blogs and Static Sites:

Static-site generators such as Jekyll, Hugo and Eleventy use Markdown files as their content source. A converted HTML page becomes a draft you can drop straight into your site's content folder.

Team Wikis and Note-Taking Apps:

Notion, Confluence, Obsidian and similar knowledge tools accept Markdown text. Converting a page first lets you import external content quickly instead of rebuilding the formatting by hand.

Forums, Chat and Support Systems:

Discussion forums, Discord, Slack and many ticketing tools understand Markdown in messages, so formatted answers paste in cleanly without losing structure.

Newsletters and Email:

Email marketing platforms that support Markdown let you reuse converted blocks of content directly, keeping your message formatting consistent across campaigns.


How This Could be Useful?

Beyond occasional copy-paste, the HTML to Markdown Converter earns its place in a few everyday workflows:

Moving a Website or Blog to a New System:

When you migrate from a WYSIWYG editor or an older CMS to a Markdown-based setup, this tool turns your existing pages into portable source files, so your content carries over instead of being retyped.

Making Content Version-Controlled:

Markdown stores cleanly in Git or any version-control system. Converted content can be diffed and reviewed like source code, which makes tracking changes across a team straightforward.

Reusing Content Across Platforms:

A single conversion gives you content in a common format, letting you share the same material in documentation, a wiki, a chat message or a newsletter without reformatting it each time.

Reading Scraped or Copied Pages:

When you pull the markup of a web page to study or adapt it, the converter strips away the tags and leaves clean, readable Markdown instead of a wall of markup.

Archiving Articles and Posts:

Converted pages save as lightweight .md files that stay readable in any text editor, so you can keep a copy of an article even if the original page is later taken down.


Examples

Each example below shows the HTML that goes into the Input box on the left and the Markdown that appears in the Output box on the right. Press "Try it" to load the example into the tool.

Input (HTML)
<h1>Mountain Trails</h1>
<p>Welcome to our <strong>weekend hiking guide</strong>. Start with <em>easy</em> routes.</p>
<p>More at <a href="https://example.com/trails">our trails page</a>.</p>
Output (Markdown)
# Mountain Trails

Welcome to our **weekend hiking guide**. Start with *easy* routes.

More at [our trails page](https://example.com/trails).
Input (HTML)
<h2>What to Bring</h2>
<ul>
  <li>Water bottle</li>
  <li>Trail map</li>
</ul>
<blockquote>Always tell someone your plan.</blockquote>
Output (Markdown)
## What to Bring

- Water bottle
- Trail map

> Always tell someone your plan.
Input (HTML)
<table>
  <thead><tr><th>Trail</th><th>Distance</th></tr></thead>
  <tbody>
    <tr><td>Lakeview Loop</td><td>3 km</td></tr>
    <tr><td>Summit Peak</td><td>9 km</td></tr>
  </tbody>
</table>
<pre><code class="language-javascript">const trail = { name: 'Pine Ridge' };
console.log(trail.name);</code></pre>
Output (Markdown)
| Trail | Distance |
| --- | --- |
| Lakeview Loop | 3 km |
| Summit Peak | 9 km |

```javascript
const trail = { name: 'Pine Ridge' };
console.log(trail.name);
```

FAQs

FAQ 1: Is HTML to Markdown conversion done on my device?
Answer: Yes. The HTML you paste or upload is parsed and converted entirely in your browser with JavaScript, and nothing you type is stored or sent to any server. The one exception is the optional Load URL feature, which sends the URL you enter to our proxy so it can fetch that page's markup (this avoids browser cross-origin restrictions).

FAQ 2: What styling elements are converted?
Answer: Headings, paragraphs, bold, italic and strikethrough text, links, images, ordered and unordered lists, blockquotes, inline code and fenced code blocks, tables, horizontal rules, line breaks and HTML entities. Structural wrappers like <div> and <section> are unwrapped so their content is kept.

FAQ 3: Will my links and image paths be kept?
Answer: Yes. Links keep both their text and their href, and images keep their alt text and src. If a title attribute is present it is preserved inside the Markdown link or image syntax.

FAQ 4: What happens to a <pre> snippet's language?
Answer: The converter looks for classes such as language-javascript, lang-python or hljs css and puts the detected language on the fenced code block, giving you ```javascript and so on. If no language is detected, a plain ``` fence is used.

FAQ 5: Can I load a whole web page instead of pasting code?
Answer: Yes. Type or paste a page URL into the "Load HTML from a URL" box and click Load URL. The page's markup is fetched, placed in the Input box and converted so you can turn any live page into Markdown.

FAQ 6: How do I save the result?
Answer: Use the Copy icon to put the Markdown on your clipboard, or the Download icon to save it as a converted.md file. Both links sit just below the Output area.

TextToolz

The Ultimate Text Tools

TextToolz works seamlessly to let you convert and design your text. It is fast, reliable and secure. Trusted by thousands of users.