Tools/File Tools/HTML to Markdown Converter

HTML to Markdown Converter – Convert HTML to .md Format

Convert HTML code to Markdown format online free - no login. Paste raw HTML and get clean, readable Markdown output instantly. Supports headings, links, lists, bold, and images.

If this tool isn’t working as expected, please take a screenshot of the error and report the problem here so we can investigate and improve it.

About this tool

Writers, developers, and content teams frequently need to migrate articles, blog posts, and documentation from rich-text CMS platforms (such as WordPress, Ghost, or Medium) into Markdown-based static site generators, GitHub repositories, or note-taking systems like Obsidian and Notion. While HTML is ideal for web rendering, it is verbose, cluttered with nested tags, difficult to diff cleanly in Git, and cumbersome to edit by hand.

Manually converting every paragraph, link, heading, and emphasis tag across an article takes hours and easily introduces formatting inconsistencies. This HTML to Markdown converter automates the transformation instantly in your browser.

It parses semantic HTML markup and produces clean Markdown formatted with standard hashes, asterisks, brackets, and dashes. Unnecessary presentation wrappers like divs, spans, and container sections are automatically stripped away, leaving only pure, readable text.

Because conversion runs locally via JavaScript with zero server requests, you can convert internal company documentation, technical notes, or unpublished drafts with complete privacy. Once converted, the output can be copied with a single click and pasted directly into your README, documentation repository, or Markdown editor.

Paste HTML source code or document markup and convert it into clean, readable Markdown in real time. The converter transforms semantic markup—including headings, bold and italic text, hyperlinks, images, blockquotes, code snippets, and list items—into standard Markdown notation directly inside your browser.

How to Use HTML to Markdown Converter

Paste HTML

Paste your raw HTML code into the input panel.

Convert

Click convert to generate the Markdown equivalent.

Preview

Preview the rendered Markdown output.

Copy Markdown

Copy the clean Markdown to use in your project.

Common Workflows

Migrating WordPress Posts to Markdown

Switch the WordPress editor to Code Editor view, copy the raw post HTML, paste it into the converter, and receive clean Markdown ready for Hugo, Jekyll, Astro, or Ghost static sites.

Converting Web Documentation to GitHub README

Take HTML snippets or API documentation from an internal portal, run them through the converter, and paste the resulting headings, code, and bullet lists directly into README.md.

Archiving Newsletters to Obsidian or Notion

Export email campaign HTML or web archives, convert the text and hyperlinks to Markdown, and import the clean notes into your personal knowledge management vault without HTML clutter.

Cleaning Web Scraping and Extracted Content

Feed HTML extracted from web scrapers or RSS feeds into the tool to strip container wrappers, styles, and scripts while preserving headings, links, and readable paragraphs.

Converting Rich-Text Drafts for Technical Blogs

Transform exported HTML drafts from Google Docs or Word into standard Markdown formatted for developer publishing platforms like Hashnode and Dev.to.

Preparing Clean Content for LLM Context Windows

Strip verbose HTML tags, classes, and presentation markup from web pages to produce compact Markdown that consumes significantly fewer tokens in AI prompts.

Best For

  • Converts semantic tags (h1–h4, strong, em, code, a, img, li, blockquote, hr) into standard Markdown syntax.
  • Runs entirely client-side in your browser; your document text, private markup, and code never leave your device.
  • Automatically decodes HTML entities (&, <, >, ", ',  ) and strips non-semantic wrapper tags.

Examples

Article Header and Lead Paragraph with Links

HTML Input

<h1>Getting Started with API Routing</h1>
<p>Welcome to the <strong>developer guide</strong>. Read the documentation carefully.</p>
<p>For more details, visit <a href="https://example.com/docs">API Documentation</a>.</p>

Markdown Output

# Getting Started with API Routing

Welcome to the **developer guide**. Read the documentation carefully.

For more details, visit [API Documentation](https://example.com/docs).

Converts h1 to a single hash (#), p tags into paragraph breaks, strong into double asterisks (**), and a href into standard [text](url) markdown link notation.

Subheadings, Emphasis, and Inline Code

HTML Input

<h2>Installation Instructions</h2>
<p>Run <code>npm install my-package</code> to install the CLI.</p>
<p><em>Note:</em> Requires Node.js 18 or higher.</p>
<hr />

Markdown Output

## Installation Instructions

Run `npm install my-package` to install the CLI.

*Note:* Requires Node.js 18 or higher.

---

Demonstrates h2 conversion to ##, code to backticks, em to single asterisks (*), and hr to a horizontal divider (---).

Bulleted Lists and Blockquotes

HTML Input

<h3>Key Features</h3>
<ul>
  <li>Fast client-side execution</li>
  <li>Zero external dependencies</li>
  <li>Privacy friendly</li>
</ul>
<blockquote>Always verify your converted output before deploying.</blockquote>

Markdown Output

### Key Features

- Fast client-side execution
- Zero external dependencies
- Privacy friendly

> Always verify your converted output before deploying.

Converts list items (li) into dash bullet points (- item) and blockquote tags into standard greater-than (> quote) Markdown callouts.

Images and HTML Entity Decoding

HTML Input

<p>Architecture overview &amp; diagram:</p>
<img src="https://example.com/diagram.png" alt="System Architecture" />
<p>Parameters &gt; 5 &amp; status = &quot;active&quot;.</p>

Markdown Output

Architecture overview & diagram:

![System Architecture](https://example.com/diagram.png)

Parameters > 5 & status = "active".

Transforms img tags into ![alt](src) syntax while decoding HTML entities like &amp;, &gt;, and &quot; into plain characters.

Use Cases

Static Site Generator Content Migration

Export existing HTML articles from WordPress, Drupal, or legacy databases and convert them into clean Markdown files (.md) for Hugo, Jekyll, Astro, or Gatsby.

Documentation Maintenance in Git Repositories

Convert HTML release notes, customer FAQs, or API endpoint guides into Markdown to maintain documentation alongside code in GitHub or GitLab.

Notion and Obsidian Personal Knowledge Base

Turn web article clippings and saved HTML summaries into clean Markdown notes with preserved links, headings, and lists without clutter.

Token Optimization for AI and LLM Pipelines

Remove bulky HTML wrapper tags, classes, and div containers from scraped web content to create compact Markdown that uses fewer tokens when fed to language models.

Common Mistakes

Problem

Expecting CSS classes, IDs, and inline styles to survive conversion

Solution

Markdown has no syntax for colors, fonts, margins, or CSS class names. Presentation attributes like style="color:red" and class="container" are discarded. Use semantic HTML tags (headings, strong, em) rather than style-based formatting before converting.

Problem

Expecting HTML tables to automatically format into Markdown pipe tables

Solution

This converter strips table tags (table, tr, td) and outputs cell text. If you have tabular data, convert the table into bulleted lists or use a dedicated table-to-Markdown tool rather than pasting raw HTML tables here.

Problem

Using single quotes instead of double quotes on links and images

Solution

The link and image conversion rules match double-quoted attributes (href="..." and src="..." alt="..."). Attributes formatted with single quotes or missing quotes will not match the link regex and will have their tags stripped.

Problem

Pasting h5 or h6 tags and expecting 5 or 6 hashes

Solution

The converter specifically maps h1 through h4 to Markdown hashes (# through ####). Deeper heading levels (h5 and h6) are stripped of their tags, leaving their text as body copy. Adjust deeper headings to h2–h4 before converting.

Problem

Pasting full HTML document wrappers with doctype, head, and scripts

Solution

Pasting an entire HTML document including <head>, <script>, and <style> tags can leave script or metadata text in the output. For best results, copy only the inner content from inside the <body>, <main>, or <article> element.

Tips & Best Practices

Extract body or article content instead of full webpage source

Always isolate the main content container (<article> or <main>) from your web page before pasting. Excluding headers, footers, sidebars, and script tags ensures your Markdown contains only the actual article text.

Verify double quotes on href and src attributes

Ensure your links use standard double quotes (e.g., <a href="https://...">) and your images include both src and alt attributes in double quotes so the regex conversion captures them cleanly.

Review list spacing and indentation after conversion

The converter outputs single-level bullet lists (- item). If your source HTML contained deeply nested sub-lists, review the output and add two or four leading spaces manually to format nested Markdown sub-bullets.

Use Markdown Preview to inspect the final rendered result

After converting, test your Markdown in the CoditTools Markdown Preview tool or your local editor to verify that headings, lists, links, and bold text render exactly as desired.

Clean up custom CMS shortcodes and widgets beforehand

Platforms like WordPress often embed shortcodes (such as [gallery] or [caption]) inside HTML. Remove or replace these shortcodes before converting, as they have no native Markdown representation.

Limitations

Headings mapped to h1 through h4 only

The converter maps h1, h2, h3, and h4 to # through ####. Headings at h5 and h6 levels are stripped of their tags and rendered as standard text paragraphs.

Tables are stripped to text, not formatted as pipe tables

Table structural tags (table, thead, tbody, tr, th, td) are stripped away. Cell content is preserved as plain text, but GFM pipe-delimited tables are not constructed.

Ordered lists convert to bullet dashes rather than numbers

Both unordered (ul) and ordered (ol) lists have their li tags converted to dash bullets (- item). If you require sequential numbered lists (1. item, 2. item), renumber the list items after conversion.

Presentation styling and CSS attributes are discarded

Markdown is a semantic format. Font sizes, text colors, background styles, alignment tags, and CSS classes have no Markdown representation and are stripped from the output.

Image conversion requires both src and alt with double quotes

Images must follow the standard <img src="..." alt="..."> format with double quotes. Images lacking alt text, using single quotes, or using reverse attribute order will have their tags stripped.

Comparisons

HTML vs Markdown

Both formats structure web content, but they serve different authoring environments and publication workflows.

MarkdownHTML
Readability as plain textClean, human-readable formatting using intuitive symbolsDense syntax filled with opening and closing angle brackets
Version control diffsClean line-by-line diffs showing exact editorial changesNoisy diffs due to attribute, wrapper, and tag shifts
Styling & layout controlRestricted to semantic structure; styling is controlled by themeFull control via inline styles, classes, and custom CSS
Primary platformsGitHub, Obsidian, Notion, Static Site Generators (Hugo, Jekyll)Web browsers, CMS engines, email templates, web applications
Authoring speedFast, distraction-free typing without complex closing tagsRequires typing opening and closing tags for each element

Which should you use?

Use Markdown for articles, documentation, notes, and version-controlled repositories. Use HTML when you need custom CSS layouts, responsive design grids, or complex web components.

Automated Conversion vs Manual Rewriting

Evaluating whether to use an automated browser-based converter or manually reformat document markup.

Automated ConverterManual Rewriting
Conversion speedInstantaneous; processes hundreds of lines in millisecondsSlow; takes hours for long articles or multi-page documentation
Link & image accuracyTransfers exact URLs and anchor text without copy-paste errorsProne to typos, broken link targets, and missing anchor labels
Structural cleanupAutomatically strips non-semantic divs, spans, and style wrappersRequires tedious manual deletion of wrapper and container tags
Post-conversion effortQuick spot-check of tables or nested listsFull proofreading and reformatting required throughout

Which should you use?

Automated conversion is drastically faster and more reliable for bulk content migration and document exports. Manual review is only needed to touch up non-semantic elements like tables or custom widgets.

FAQs

Common questions about how this browser-based HTML to Markdown converter processes tags, handles unsupported markup, and structures clean output.

What is Markdown and why use it instead of HTML?

Markdown is a lightweight markup language designed to be readable as plain text while converting cleanly into web-ready formatting. For example, a second-level heading tag becomes ## Title in Markdown. Markdown is easier to write than HTML, works natively across GitHub README files, Notion, Obsidian, Jekyll, and documentation engines, and produces clean, readable diffs in version control. Use Markdown when writing documentation, notes, and blog posts, and HTML when you need custom CSS layouts, complex tables, or web components.

What HTML elements convert cleanly to Markdown?

Clean conversions: Headings (h1 through h4) convert to Markdown hashes (# through ####). Bold tags (strong or b) become **bold**. Italic tags (em or i) become *italic*. Hyperlinks (a href) convert to [text](url). Unordered lists (ul/li) and ordered lists (ol/li) become bullet items (- item). Inline code tags become backticks (`inline code`). Blockquotes (blockquote) convert to greater-than quotes (> quote). Horizontal rules (hr) convert to dashes (---), line breaks (br) become newlines, and images (img with src and alt) convert to ![alt](src). In addition, standard HTML entities like &amp;, &lt;, &gt;, and &quot; are decoded automatically.

What happens to HTML that has no direct Markdown equivalent?

HTML tags without direct Markdown equivalents—such as div, span, section, article, header, nav, or h5/h6—have their outer tags stripped while preserving their internal text content. Presentation styling, inline style attributes, and CSS classes are removed because standard Markdown does not support custom CSS rules.

How does the converter handle tables, nested content, and malformed HTML?

Table tags (table, thead, tbody, tr, th, td) are stripped to plain text rather than converted to pipe tables. Nested inline formatting, such as bold links (strong enclosing an anchor), converts cleanly into combined Markdown syntax (**[text](url)**). Unclosed or malformed HTML tags that fail to match specific conversion rules are safely removed during the general tag-stripping pass.

How do I convert a WordPress blog post to Markdown?

Open your WordPress post in the Code Editor view (not the visual Block Editor), copy the inner article HTML, and paste it into the converter. The converter will process the headings, links, and text instantly. Review the output for any elements that need manual handling, such as custom WordPress shortcodes ([gallery], [caption]) or table structures.

Get more tools like this

Leave your email so we can prioritize similar tools and updates.