HTML to Markdown
HTML Input1.1 KB
Markdown Output
0 B
🔖
Bookmark this page
Press Ctrl+D to save this tool in your browser for instant access anytime — no sign-up needed.

HTML to Markdown Converter — Free Online HTML to MD for Web Pages & CMS Exports

Share

About this tool

Free HTML to Markdown Converter — Convert Web Pages, CMS Exports & Email HTML to Clean Markdown

Paste any HTML and get clean Markdown in under a second. Whether you are pulling content from a web page, migrating posts out of a CMS, extracting text from an email template, or converting documentation from an old HTML site — this converter handles it all in your browser with no server involved.

The conversion uses the browser's native DOMParser API to parse HTML into a DOM tree, then walks the tree recursively to produce properly structured Markdown. This means it handles real-world HTML correctly — nested elements, inline formatting inside list items, links inside headings, code inside blockquotes — not just simple regex replacements that break on complex markup.

What gets converted: All six heading levels (h1–h6 → # through ######), paragraphs, bold (strong/b**text**), italic (em/i*text*), strikethrough (del/s~~text~~), inline code (code → ` code ), fenced code blocks (pre > code `` with language class), hyperlinks (a[text](href)), images (img![alt](src)), unordered and ordered lists, blockquotes, horizontal rules, line breaks, and full HTML tables converted to GFM pipe tables with automatic pipe-character escaping.

Block wrapper elements like div, section, article, main, and figure are transparently unwrapped — their content is converted and their containers discarded, so you get clean prose instead of empty structural markup.

The output is GitHub Flavored Markdown (GFM) compatible — it works in GitHub READMEs, GitLab wikis, Notion, Obsidian, Docusaurus, MkDocs, and any standard Markdown renderer. Use Copy to paste it directly into your editor, or Download .md to save a named file.

All conversion runs in your browser. Your HTML is never sent to any server.

Features

  • Live HTML to Markdown conversion — output updates in real time as you type or paste, using the browser's DOMParser API for accurate tree-based parsing
  • Full heading support — h1 through h6 converted to # through ###### with surrounding blank lines for proper spacing
  • Inline formatting — strong/b → bold, em/i → *italic*, del/s → ~~strikethrough~~, code → inline code
  • Fenced code blocks — pre > code elements converted to triple-backtick blocks with the language class preserved (e.g., language-javascript → ```javascript)
  • GFM pipe tables — HTML tables with thead/tbody converted to properly aligned pipe tables with separator row; pipe characters in cells are escaped automatically
  • Lists — ul/li → dash bullets with nested indent, ol/li → numbered lists; nesting is preserved with two-space indent per level
  • Links and images — a tags become text, img tags become !alt; title attributes included when present
  • Block unwrapping — div, section, article, main, figure, and other semantic wrappers are stripped while their inner content is preserved and converted
  • Copy and Download — copy the full Markdown output to clipboard or download as document.md in one click
  • 100% browser-based — no server, no data sent, works offline; uses the native DOMParser API available in all modern browsers

How to Use

Paste your HTML into the left panel — either raw HTML source from a web page, HTML copied from a CMS editor in code view, or the outerHTML of a specific element from browser DevTools. The Markdown output appears immediately in the right panel. To copy the Markdown, click "Copy". To save it as a .md file, click "Download .md". To paste clipboard content directly without clicking the left panel, use the "Paste" button in the header. Click "Sample" to load a demonstration with headings, lists, a code block, a table, and a blockquote. Click "Clear" to reset the input. Both panels show the byte size of their content — useful when checking how conversion changes document size for large pages.

Common Use Cases

🌐
Convert web page content to Markdown for documentation
Open a web page in DevTools (F12), right-click the main content element, and copy its outerHTML. Paste it here to get clean Markdown. This is the fastest way to pull structured content from documentation sites, knowledge bases, or reference pages into your own Markdown-based docs. The converter strips navigation, ads, and layout divs — only the semantic content (headings, paragraphs, lists, code) survives. Combine with Markdown to HTML if you need to re-export the content as HTML for a different system.
📝
Migrate WordPress or CMS blog posts to Markdown
Switch your WordPress post to Code Editor view to expose the raw HTML, select all, and paste it here. The converter produces Markdown you can drop directly into Ghost, Gatsby, Hugo, Jekyll, Astro, or any Markdown-based blog platform. This is the core workflow for CMS migrations — convert each post's HTML to Markdown, save the .md files, and import into the new system. Use "Download .md" to save each converted post. Run the result through Diff Checker to compare with a manually edited version.
💬
Extract content from email templates to Markdown
View the source of a marketing email or newsletter and paste the HTML body here. The converter discards layout tables, inline styles, and tracking pixels — keeping headings, paragraphs, links, and images as clean Markdown. This is useful when repurposing newsletter content as a blog post, archiving email campaigns in a Markdown-based notes system, or extracting copy from an HTML email template into a content brief. Use Word Counter on the output to check the extracted word count.
📚
Convert HTML documentation to Markdown for GitHub README
Many older projects have HTML documentation files (index.html, docs/*.html) that need to be converted to Markdown for a GitHub repository README or wiki. Paste each HTML file's content here, copy the output, and paste into a .md file. The converter preserves the full document hierarchy — all heading levels, code examples, tables, and links — so the README reflects the original documentation structure accurately. Use the HTML Formatter to clean up messy HTML before converting if the output looks noisy.
🗒
Pull web content into Obsidian, Notion, or note-taking apps
When researching a topic, copy the HTML of an article or documentation page and convert it to Markdown to paste into Obsidian, Logseq, or Notion. Markdown notes are searchable, portable, and renderable across all these tools. The conversion preserves the structure — headings become section headers you can link to, code blocks are syntax-highlighted, and tables remain readable. For Notion, paste into a page and it will interpret the Markdown formatting automatically. For Obsidian, save the .md file directly into your vault using "Download .md".
Convert HTML to Markdown for static site generators
Static site generators like Hugo, Jekyll, Gatsby, Eleventy, and Astro all use Markdown for content files. When migrating a legacy HTML site to one of these frameworks, use this converter to transform each page's content HTML into a .md file. The front matter (title, date, tags) still needs to be added manually, but the body content conversion — preserving headings, code blocks, lists, and links — is fully automated. Combine with Lorem Ipsum Generator when you need placeholder content for template development.

Frequently Asked Questions

Paste your HTML into the left panel of this converter. The Markdown output appears instantly in the right panel as you type — no button press required. To copy the Markdown to your clipboard, click "Copy". To save it as a .md file, click "Download .md". Use the "Paste" button to paste clipboard content directly, "Sample" to load a demo, and "Clear" to reset the input. Both panels show file size in bytes so you can see how the conversion changes document size.

This converter handles the full set of common HTML elements: headings (h1–h6 → # through ######), paragraphs (p), bold (strong/b → text), italic (em/i → *text*), strikethrough (del/s → ~~text~~), inline code (code → text), fenced code blocks (pre > code → ``` blocks with language class), links (a → text), images (img → !alt), unordered lists (ul/li → - item), ordered lists (ol/li → 1. item), blockquotes (blockquote → > text), tables (table/thead/tbody/tr/th/td → pipe tables), horizontal rules (hr → ---), and line breaks (br → two trailing spaces). Block wrapper elements like div, section, and article are unwrapped and their children converted.

In your browser, open the web page you want to convert. Right-click on the main content area and select "View Page Source" (Ctrl+U / Cmd+U), or right-click an element and choose "Inspect", then copy the outer HTML of the article or content div. Paste the HTML into this converter. For a cleaner result, paste only the content section HTML rather than the full page (including nav, header, footer, and sidebar), since those elements add noise to the Markdown output. Alternatively, use your browser's DevTools to select and copy the innerHTML of the article element.

In the WordPress editor, switch to the Code Editor view (the three-dot menu → Code editor, or Ctrl+Shift+Alt+M). Select all the HTML and copy it. Paste it into this converter. The result will be clean Markdown with headings, paragraphs, lists, and links preserved. For the Classic Editor, click the "Text" tab to view the raw HTML, then copy and paste. If you are using the Gutenberg block editor and want to export all blocks at once, go to the post editor, open the Options menu (⋮), and choose "Code Editor" to see the full post HTML.

Yes — HTML tables are converted to GitHub Flavored Markdown pipe tables. A table with a header row produces a Markdown table with a separator row of dashes (| --- |) between the header and body. Cells with pipe characters (|) inside them are automatically escaped with a backslash so the table remains valid. Nested tables are not currently supported — the inner table content is extracted as plain text. For best results, use simple tables without merged cells (colspan/rowspan), as Markdown pipe tables do not support cell spanning.

HTML to Markdown conversion is lossy in a specific way: it strips presentational HTML (font tags, inline styles, class attributes, div wrappers) and keeps only semantic structure. The resulting Markdown is portable, readable as plain text, and works in GitHub, GitLab, Notion, Obsidian, and any Markdown-aware editor. Markdown to HTML is the reverse — it takes a lightweight text format and generates HTML for rendering in browsers. Use HTML to Markdown when migrating content into a Markdown-based system (documentation, static site generators, note-taking apps). Use Markdown to HTML when you have Markdown content and need HTML output for a web page or CMS.

Email HTML is typically messy — it uses tables for layout, inline styles, and nested divs. To extract meaningful content: open the email in your email client, view the source (look for a "View Original" or "Show Original" option), or forward it to yourself and copy the HTML source. Paste the full HTML here — the converter strips layout tables and inline styles, keeping only the semantic text content: headings, paragraphs, lists, links, and images. For newsletters, the result is usually clean body copy with links preserved. Email signature HTML (tables with logos and contact info) produces somewhat noisy Markdown but all text content is preserved.

Yes — once the page has loaded, all conversion runs entirely in your browser using JavaScript and the built-in DOMParser API. No HTML is sent to any server, and the tool continues to work without an internet connection. This makes it safe for confidential content, internal documentation, proprietary code, and any HTML you would not want to transmit over the internet.