HTML to Markdown Converter — Free Online HTML to MD for Web Pages & CMS Exports
What's included
Features
inline codeAbout this tool
HTML to Markdown Converter — Free, 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 → ), 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.
Step by step
How to Use
- 1Get the HTML you want to convertFor a web page: open DevTools (F12), right-click the main content element, and copy its outerHTML. For a CMS post: switch to Code Editor or Text view and copy the raw HTML. For an email: use "View Source" or "Show Original" to get the HTML. For a file: use the Paste button to paste clipboard content directly.
- 2Paste the HTML into the left panelPaste your HTML into the left input panel. The Markdown output appears immediately in the right panel as you type — no button press needed. Use Sample to load a demonstration with headings, lists, a code block, a blockquote, and a table to see the conversion in action.
- 3Review the Markdown outputThe converter strips layout wrappers (
div,section,article,figure) and inline styles, keeping only semantic content: headings, paragraphs, bold, italic, code, links, images, lists, blockquotes, and tables. HTML tables become GitHub Flavored Markdown pipe tables with automatic pipe-character escaping in cells. - 4Copy the Markdown to clipboardClick Copy in the output panel to copy the full Markdown to your clipboard. Paste it directly into a GitHub README, Obsidian note, Notion page, Ghost post editor, or any Markdown-aware editor. The output is GitHub Flavored Markdown (GFM) compatible.
- 5Download as a .md fileClick Download .md to save the Markdown as a named file. Use this when converting CMS posts to static site generator content files, when building a local documentation library, or when you need a portable
.mdfile to import into another system. - 6Check conversion size in both panelsBoth the input and output panels show the byte size of their content. This is useful for seeing how much the conversion reduces document size — typically 30–60% smaller than the source HTML since all markup, attributes, and inline styles are stripped.
Real-world uses
Common Use Cases
Got questions?
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.