Skip to main content

Free HTML to Markdown Converter

Convert HTML to clean Markdown. Handles headings, lists, links, images, code blocks, tables, and blockquotes. Perfect for moving content out of CMSes.

Works offline once loaded

Paste HTML on the left; clean Markdown appears on the right. Markdown is simpler than HTML, so styling, scripts, and complex tables are simplified or dropped.

Tip: paste rich text copied from a web page, Word, or Google Docs - its HTML is captured automatically.

Markdown output
Markdown output will appear here…

Common uses

  • Migrate Blog Content to MarkdownConvert old WordPress, Medium, or other CMS posts to Markdown for static site generators.
  • Convert Email Content to MarkdownPull text from HTML emails or web articles and convert to plain Markdown for note-taking apps.
  • Convert HTML Docs to MarkdownMove legacy HTML documentation to a Markdown-based docs system (Docusaurus, GitBook, MkDocs).
  • CMS Export CleanupClean up the messy HTML exported from CMSes and turn it into version-control-friendly Markdown.
  • Prepare HTML Content for LLM PromptsConvert HTML content to clean Markdown for use in ChatGPT, Claude, or other LLM prompts.

How It Works

This converter is built around a hand-written, zero-dependency regex pipeline β€” no third-party library is imported. The entire conversion runs inside your browser via a React useMemo call, updating the output live as you type.

  1. 1
    Paste detection intercepts rich text
    A ClipboardEvent handler reads the text/html flavor from the clipboard before the browser can paste plain text. This means pasting directly from a web page, Google Docs, or Word automatically captures the raw HTML markup β€” you don't need to view source first.
  2. 2
    Multi-pass regex pipeline strips and converts tags
    The converter runs a strict ordering of regex passes: it first removes <head>, <script>, <style>, and HTML comments, then stashes fenced code blocks behind null-byte placeholders to prevent later passes from corrupting code content. Subsequent passes handle headings (h1–h6), blockquotes, images, links, bold/italic/strikethrough, ordered and unordered lists, and basic GFM pipe tables β€” each pass targets a specific tag family.
  3. 3
    Entity decoding and whitespace normalization
    After all tags are stripped, a dedicated decodeEntities function resolves named entities (&amp;, &lt;, etc.) plus numeric decimal and hex character references (&#39;, &#x27;) using String.fromCodePoint. Malformed or out-of-range code points are replaced with the Unicode replacement character rather than throwing. Trailing spaces, collapsed runs of blank lines, and excess whitespace are then normalized.
  4. 4
    Protected code spans are restored
    The placeholder system (null-byte-delimited indices) is unwound last, after stripping, decoding, and whitespace collapsing are complete. This prevents entity sequences inside code literals from being decoded twice β€” a common double-decode bug in naive HTML-to-Markdown converters.

Related Tools

Frequently Asked Questions