Ttooleras
📝

HTML to Markdown

Converters

Convert HTML to clean, readable Markdown preserving structure and formatting. Free, private — all processing in your browser.

This tool is coming soon. Check back later!

Advertisement

The HTML to Markdown Converter transforms HTML documents, blog posts, emails, web pages, and rich text into clean, readable Markdown. Handles every common HTML element: headings, paragraphs, bold/italic, links, images, lists (ordered and unordered), tables, blockquotes, code blocks (inline and fenced), horizontal rules, strikethrough, and nested structures. Output is GitHub Flavored Markdown (GFM) by default — the flavor used by GitHub, GitLab, Bitbucket, Notion, Obsidian, and every modern Markdown-based platform. Works for bulk migration (old blog posts from WordPress) or one-off conversions (copy from a webpage to your notes app).

Markdown is the writing format developers, technical writers, and content creators prefer for its simplicity and portability. Many sources (CMSes, email clients, legacy tools) produce HTML. Converting to Markdown makes content editable in any text editor, searchable, version-controllable in Git, and portable between platforms. This tool runs entirely client-side — your content (which may include draft blog posts, confidential emails, internal documentation) never leaves your device.

HTML to Markdown — key features

Preserves structure

Headings, paragraphs, lists, tables, blockquotes, code — all convert to clean Markdown equivalents.

GFM-compliant output

GitHub Flavored Markdown tables, task lists, strikethrough, autolinks — works everywhere GFM is supported.

Handles malformed HTML

Permissive parser tolerates broken HTML, unclosed tags, mixed content. Converts what it can.

Configurable output style

Bullet character, heading style, bold delimiter, code fence, and more. Match your Markdown conventions.

Image URL handling

Preserves image src URLs. Optional: convert to relative paths, or download and embed as base64.

Code block preservation

Code in `<pre><code>` tags becomes fenced code blocks. Language is detected from class attribute.

Remove unsafe content

Scripts, event handlers, and unsafe attributes are stripped for security.

100% client-side

Your HTML content is processed in your browser. Safe for confidential documents.

How to use the HTML to Markdown

  1. 1

    Paste HTML

    Drop HTML text, upload an .html file, or paste rich text from email/Word (which includes HTML).

  2. 2

    Review settings

    GFM mode on by default. Bullet character, heading style, and other preferences.

  3. 3

    Convert

    Click Convert or see live preview. Markdown output appears instantly.

  4. 4

    Preview Markdown

    Optional: see how the Markdown renders back to HTML — check that nothing important was lost.

  5. 5

    Copy or download

    Copy to clipboard or download as .md file for your repository, notes app, or blog.

Common use cases for the HTML to Markdown

Content migration

  • WordPress to static site: Export WordPress posts as HTML, convert to Markdown, import into Hugo/Jekyll/Astro/11ty.
  • Medium/Substack export: Migrate your blog off Medium or Substack — export HTML, convert to Markdown, commit to Git.
  • Legacy CMS migration: Moving from an old CMS to a modern one (Contentful, Ghost, etc.) often requires Markdown input.

Documentation

  • Move docs to Git: Convert HTML docs to Markdown for GitHub/GitLab wiki, Docusaurus, MkDocs, GitBook.
  • API documentation import: Many doc tools accept Markdown — convert legacy HTML docs for import.
  • Team knowledge base: Export from Confluence/Notion HTML, convert to Markdown for internal wikis.

Email and messaging

  • Email newsletter archive: HTML emails archived as Markdown are searchable and version-controllable.
  • Customer communication logs: Save important email threads as Markdown for long-term reference.
  • Slack/Discord exports: HTML exports convert to Markdown for note-taking apps.

Developer workflow

  • Copy web content to notes: Grab a blog post from browser, convert to clean Markdown, paste into Obsidian/Notion/Bear.
  • Blog post drafting: Research from multiple web sources. Convert HTML to Markdown. Edit in your favorite editor. Publish.
  • GitHub issue import: Import bug reports or discussions from other tools (Jira, Trello) as Markdown issues.

HTML to Markdown — examples

Simple HTML to Markdown

Common elements.

Input
<h1>Title</h1>
<p>This is a <strong>bold</strong> and <em>italic</em> paragraph with a <a href="https://tooleras.com">link</a>.</p>
Output
# Title

This is a **bold** and *italic* paragraph with a [link](https://tooleras.com).

Lists

Ordered and unordered lists.

Input
<ul>
  <li>Apple</li>
  <li>Banana
    <ul><li>Nested</li></ul>
  </li>
</ul>
<ol>
  <li>First</li>
  <li>Second</li>
</ol>
Output
- Apple
- Banana
  - Nested

1. First
2. Second

Code block

Fenced code with language.

Input
<pre><code class="language-js">function hello() {
  console.log("Hi");
}
</code></pre>
Output
```js
function hello() {
  console.log("Hi");
}
```

Table (GFM)

GFM tables preserved.

Input
<table>
<thead>
<tr><th>Name</th><th>Age</th></tr>
</thead>
<tbody>
<tr><td>Alice</td><td>30</td></tr>
<tr><td>Bob</td><td>25</td></tr>
</tbody>
</table>
Output
| Name  | Age |
| ----- | --- |
| Alice | 30  |
| Bob   | 25  |

Blockquote

Nested quotes.

Input
<blockquote>
  <p>First quote.</p>
  <blockquote>
    <p>Nested second quote.</p>
  </blockquote>
</blockquote>
Output
> First quote.
>
> > Nested second quote.

Image

Image src and alt preserved.

Input
<img src="https://tooleras.com/logo.png" alt="Tooleras Logo">
Output
![Tooleras Logo](https://tooleras.com/logo.png)

Task list (GFM)

Checkboxes become task list.

Input
<ul>
  <li><input type="checkbox" checked>Done</li>
  <li><input type="checkbox">Todo</li>
</ul>
Output
- [x] Done
- [ ] Todo

Technical details

The conversion uses Turndown, a robust HTML-to-Markdown JavaScript library, with custom rules for GFM features (tables, strikethrough, task lists).

Supported HTML elements and their Markdown equivalents:

| HTML | Markdown |
|---|---|
| <h1> ... <h6> | # ... ###### |
| <p> | Paragraph (blank line separation) |
| <strong>, <b> | bold |
| <em>, <i> | *italic* |
| <a href="..."> | [text](url) |
| <img src="..."> | ![alt](url) |
| <ul><li> | - item |
| <ol><li> | 1. item |
| <blockquote> | > quote |
| <code> | ` inline code |
|
<pre><code> | ` fenced code block ` |
|
<hr> | --- |
|
<del>, <s> | ~~strikethrough~~ |
|
<table> | GFM table syntax |
|
<input type="checkbox"> | - [ ] or - [x]` task list |

What gets preserved:

- Heading hierarchy (h1 → #, h2 → ##, etc.)
- Bold/italic/strikethrough
- Links and image URLs
- List nesting (nested <ul> within <li>)
- Code language (from <code class="language-js">)
- Table alignment (if specified)

What gets lost:

- CSS styling (color, fonts, spacing) — Markdown has no CSS equivalent
- Custom HTML attributes (data-*, aria-*, id, class) — Markdown doesn't support attributes
- Inline styles — no Markdown equivalent
- <div>, <span>, and other structural HTML — unwrapped, content preserved
- JavaScript — completely stripped
- Complex tables (colspan, rowspan, nested tables) — flattened or simplified

Customization options:

- Heading style: ATX (#) — most common, or Setext (underlined) — rare
- List delimiter: -, *, or + for bullet lists
- Bold style: text (standard) or __text__
- Link style: Inline [text](url) or reference [text][ref]
- Code fence: ` or ~~~
- GFM vs CommonMark: GFM includes tables, task lists, strikethrough; CommonMark is strict

HTML pre-processing:

Before conversion, the tool:

1. Removes <script> and <style> tags (content irrelevant for text).
2. Normalizes whitespace outside <pre> blocks.
3. Resolves relative URLs against a configurable base (optional).
4. Sanitizes unsafe attributes (on*, javascript:).
5. Parses with a permissive HTML parser (handles malformed markup like a browser).

Common problems and solutions

Custom CSS styles are lost

Markdown has no concept of CSS — colors, fonts, margins, special classes all disappear. The text structure survives. For styling, keep HTML or use a platform with CSS support.

Complex tables are flattened

Markdown tables don't support colspan, rowspan, or nested tables. Complex tables become simpler tables, losing hierarchy. Keep HTML tables for complex tabular data.

Relative URLs may break

HTML with relative URLs (`<img src="/image.png">`) won't work when Markdown is viewed elsewhere. Either convert relative to absolute URLs before converting, or use a base URL option.

Embedded HTML remains in output

Most Markdown flavors allow inline HTML. Some elements (<iframe>, <script>) may be stripped by the receiving platform. Test in your target.

Whitespace in <pre> critical

Code blocks inside `<pre>` must preserve exact whitespace. The converter respects this, but if you reformat HTML before converting, indentation may change.

Markdown not a strict spec

Different Markdown parsers handle edge cases differently. What renders on GitHub may not render the same on Notion. Test in your target platform.

Large HTML documents

Very large HTML (millions of characters) can slow down the browser. Split large documents into chunks before converting.

Images with base64 data URIs

Embedded images (`src="data:image/png;base64,..."`) work in HTML but produce huge inline Markdown blocks. Consider extracting to external images before conversion.

HTML to Markdown — comparisons and alternatives

HTML to Markdown vs rich text to Markdown: Rich text editors (Word, Google Docs) include HTML in their clipboard. Pasting to this tool converts the HTML to Markdown. Works for copying content directly from web pages too.

Markdown vs HTML for writing: Markdown is faster to write, easier to read in source, portable. HTML is more expressive (any layout). Use Markdown for prose content, HTML when you need advanced styling or structure.

Markdown to HTML vs HTML to Markdown: Different directions, different challenges. MD to HTML is deterministic (simple mapping). HTML to MD is lossy (many HTML features have no MD equivalent). This tool handles the harder direction.

Turndown vs Pandoc: Turndown is the JavaScript library we use — fast, runs in the browser. Pandoc is a more powerful CLI tool that converts between dozens of formats. Use Turndown for in-browser; Pandoc for batch CLI conversion.

Markdown vs reStructuredText: reST is Python's preferred markup (used by Sphinx docs). More powerful than Markdown, supports directives and roles. Learning curve is steeper; Markdown is easier. Pick reST for Python docs, Markdown for most other contexts.

Markdown vs MDX: MDX combines Markdown with JSX — embed React components in Markdown. Used by Next.js, Docusaurus, Astro. Powerful but React-specific. Standard Markdown is simpler and universal.

Frequently asked questions about the HTML to Markdown

What is HTML to Markdown conversion?

Transforming HTML (web pages, emails, rich text) into clean Markdown syntax. Preserves content structure (headings, paragraphs, lists, tables) but drops visual styling. Result is plain-text Markdown that can be edited in any text editor, committed to Git, or imported into Markdown-based tools.

Is this converter safe for sensitive content?

Yes. Conversion happens entirely in your browser. Draft blog posts, confidential emails, internal documentation — all stay on your device. No server interaction, no logging. Open DevTools Network tab to verify zero outbound requests.

What Markdown flavor is produced?

GitHub Flavored Markdown (GFM) by default. Includes tables, task lists, strikethrough, autolinks, and fenced code blocks with language tags. Also supports CommonMark mode for strict compatibility.

Does it preserve images?

Yes. <img src="..."> becomes ![alt](src). Image URLs stay the same — make sure they remain accessible where you use the Markdown. For embedded base64 images, consider extracting to external files first.

Can I convert a full webpage?

Yes, but copy just the content HTML (not the whole page including navigation, footer, etc.). Use browser DevTools to inspect and copy specific elements. Or use a readability extension to extract just the article content.

What happens to CSS styling?

Markdown doesn't support CSS — styling is completely lost. Colors, fonts, spacing, custom classes all disappear. The text structure (headings, paragraphs, lists) remains intact. For styled output, keep HTML or use a platform with CSS support.

How do I handle tables with complex layouts?

Markdown tables are limited: single-line cells, no colspan/rowspan, no nested tables. Complex HTML tables are flattened or simplified. For critical complex tables, keep HTML (most Markdown flavors allow inline HTML).

Will the converted Markdown render identically?

Close but not identical. Markdown renderers vary — GitHub, Notion, Obsidian all have slight differences. The converter produces standard GFM. Render in your target platform to verify. Most content looks identical after round-trip.

Can I convert email HTML?

Yes. Copy HTML from "View source" in your email client or export .eml files. Convert to Markdown for clean archiving or processing. Note: email HTML often has lots of tables for layout — these may not convert cleanly.

Why are there extra blank lines?

Some HTML has extra <br> or empty paragraphs. The converter preserves this structure, producing extra blank lines in Markdown. Post-process with a simple regex (\n\n\n+\n\n) to collapse multiple blank lines to double.

Additional resources

Advertisement

Related tools

All Converters

Learn more

Explore more tools

200+ free tools that run in your browser.

Browse all tools →