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

Stripping a Page Back to Its Structure

HTML carries presentation as well as content: nested divs for layout, class names for styling, inline styles, tracking attributes, and often a great deal of markup that exists only to satisfy a CSS framework. Markdown carries almost none of that. Converting is essentially an act of discarding everything except structure and text.

That is exactly why it is useful. Pasting web content into a CMS, a documentation repository, a static site generator, or an AI prompt works far better when it arrives as clean Markdown than as a wall of nested divs with inherited styles that fight your own.

What Maps Cleanly and What Cannot

Headings, paragraphs, bold and italic, links, images, ordered and unordered lists, blockquotes, code blocks, and horizontal rules all have direct Markdown equivalents and convert reliably.

Tables convert to the pipe syntax, though only simple ones survive intact — a cell spanning two columns has no Markdown representation at all, so complex tables come out flattened or misaligned.

Everything presentational disappears: colours, fonts, alignment, sizing, background images, and layout. Forms, buttons, scripts, iframes, and video embeds have no equivalent and are dropped. Nested lists usually survive; deeply nested mixtures sometimes lose a level.

One useful property: because Markdown has no way to express scripts or event handlers, converting to Markdown is a genuinely effective way to strip active content out of copied HTML.

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.

Do tables convert?

Simple tables convert to Markdown pipe tables. Cells spanning multiple rows or columns cannot be represented in Markdown and will come out flattened.

What happens to styling?

It is discarded entirely. Colours, fonts, sizes, and layout have no Markdown equivalent — only structure and text survive, which is usually the point.

Are scripts removed?

Yes. Markdown cannot express scripts or event handlers, so they cannot survive the conversion. That makes this a practical way to clean up pasted HTML.

Which Markdown flavour is produced?

Standard Markdown with the common table extension, which is what GitHub, most static site generators, and most documentation tools accept.

⚠️ 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.