OnlyFormat

HTML to Markdown Converter

Convert HTML to clean Markdown format instantly. Paste text or upload a .html file.

No data sent to server
HTML Input
Markdown Output

Related Tools

What is HTML to Markdown?

Markdown (created by John Gruber, 2004) is a lightweight markup language used for documentation, README files, blog posts, and static site generators (Jekyll, Hugo, Astro, Docusaurus). Converting HTML → Markdown produces clean, readable plain-text content that's easy to edit and version-control with Git.

Common scenarios: migrating from WordPress / Ghost / Medium to a Markdown-based site, extracting article content from web pages for note-taking apps (Obsidian, Notion), cleaning up HTML email content for plain-text alternatives, converting Confluence / SharePoint exports to Markdown for developer docs.

How to Use

  1. Paste HTML code into the input area, or upload a .html file.
  2. Click Convert.
  3. Review the Markdown output — verify lists, code blocks, and headings render correctly.
  4. Copy or download as a .md file.

Privacy: Conversion runs entirely in your browser. No uploads.

Conversion mapping

<h1>Title</h1>           → # Title
<h2>Subhead</h2>         → ## Subhead
<strong>bold</strong>    → **bold**
<em>italic</em>          → *italic*
<a href="url">text</a>   → [text](url)
<img src="..." alt="x"/> → ![x](...)
<ul><li>item</li></ul>   → - item
<ol><li>item</li></ol>   → 1. item
<blockquote>quote</blockquote> → > quote
<code>inline</code>      → `inline`
<pre><code>block</code></pre> → ```\nblock\n```
<hr/>                    → ---
<br/>                    → (line break)

What gets stripped

  • CSS classes / inline styles — Markdown is content-focused; styling lives in CSS
  • JavaScript attributes (onclick, onload) — security and Markdown doesn't support them
  • Embedded scripts and iframes — converted to nothing or skipped; manually re-add HTML in Markdown if needed
  • SVG and complex media — kept as raw HTML inside Markdown (Markdown allows raw HTML)
  • Form elements (input, button, select) — Markdown has no form syntax

Alternative tools for advanced needs

  • Pandoc — gold standard CLI; supports many input/output formats with custom templates
  • Turndown (npm) — JavaScript library, customizable rules, used by many tools
  • html2text (Python) — simple Python script for batch processing
  • Markdownify (Python) — feature-rich Python library
  • Browser extensions — "Copy as Markdown" extensions for Chrome/Firefox

FAQ

Which HTML elements are supported?

Headings (h1-h6), paragraphs, bold/italic/strikethrough, links, images, lists (ordered/unordered, nested), blockquotes, code blocks, inline code, horizontal rules, and tables (GFM syntax). Less common elements may pass through as inline HTML or be stripped.

What about inline styles and classes?

Stripped — Markdown is content-focused; styling lives in CSS. If you need to preserve styling, use HTML directly in your Markdown file (most parsers allow raw HTML inline).

Will tables be preserved?

Yes — converted to GFM (GitHub Flavored Markdown) table syntax with pipes and alignment. Complex tables with merged cells (colspan/rowspan) may not convert cleanly — those are not natively expressible in Markdown.

Does it handle whole web pages or just content?

It converts whatever HTML you paste. For full pages, you'll get menu links, footer content, etc. mixed with article body. For cleaner extraction, paste only the article element or use a "Reader Mode" extension first.

Can I convert WordPress / Ghost exports?

Yes — but they're typically XML-wrapped HTML. Extract the HTML content first (or use Pandoc with WordPress XML support). For batch migration, scripts using Turndown (Node) or html2text (Python) are more practical.

⚠️ Reference Only

Output is generated based on your input and is provided for reference. Results may vary depending on your specific use case, edge cases, or environment-specific behavior. We do not guarantee accuracy of conversions, validations, or computed values.

Always verify critical outputs against official documentation or production environments. We are not responsible for any decisions or losses based on these tool results.