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.
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 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.
- 1Paste detection intercepts rich textA 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.
- 2Multi-pass regex pipeline strips and converts tagsThe 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.
- 3Entity decoding and whitespace normalizationAfter all tags are stripped, a dedicated decodeEntities function resolves named entities (&, <, etc.) plus numeric decimal and hex character references (', ') 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.
- 4Protected code spans are restoredThe 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
Markdown to HTML Converter
Convert Markdown to clean HTML with live preview. Use the source view to copy ready-to-paste HTML for blogs, CMSes, or email templates.
Markdown Editor
Write and preview Markdown in real time. Supports headings, bold, italic, code blocks, tables, and lists.
HTML Encoder & Decoder
Encode special characters to HTML entities or decode entities back to plain text. Instantly, in your browser.