DevBolt
Processed in your browser. Your data never leaves your device.

How do I convert HTML to Markdown or Markdown to HTML?

Paste HTML to convert it to clean Markdown, or paste Markdown to generate HTML. The tool handles headings, links, images, lists, tables, code blocks, bold, italic, and more. Conversion is instant and bidirectional. Everything runs in your browser — your content never leaves your device.

HTML to Markdown
Input
<h1>Title</h1>
<p>This is <strong>bold</strong> and <em>italic</em>.</p>
<ul>
  <li>Item one</li>
  <li>Item two</li>
</ul>
Output
# Title

This is **bold** and *italic*.

- Item one
- Item two
← Back to tools

HTML ↔ Markdown Converter

Convert between HTML and Markdown in either direction. Handles headings, lists, code blocks, tables, links, and more.

About HTML ↔ Markdown Converter

  • HTML → Markdown — converts semantic HTML elements into clean, readable Markdown syntax.
  • Markdown → HTML — parses Markdown into standards-compliant HTML output.
  • Heading styles — choose ATX (# Heading) or Setext (underlined) for h1/h2.
  • Swap — click Swap to reverse direction and chain conversions, moving the output into the input.
  • Tables, code blocks, links — all common formatting elements are preserved during conversion.
  • Everything runs in your browser — no data is sent over the network.

Tips & Best Practices

Pro Tip

Clean up HTML before converting for best Markdown output

Rich text editors (Google Docs, Word, Notion) export HTML full of inline styles, empty spans, and nested divs. Strip these before converting — Markdown has no concept of font colors or spacing divs. The cleaner the HTML input, the more readable the Markdown output.

Common Pitfall

HTML tables convert poorly to Markdown

Markdown tables don't support colspan, rowspan, cell alignment, or nested elements. Complex HTML tables with merged cells or nested lists convert to pipe tables that lose structure. For complex tables, consider keeping them as raw HTML blocks within your Markdown.

Real-World Example

Migrate blog content from WordPress to Markdown-based platforms

Export WordPress posts as HTML, then convert to Markdown for Gatsby, Hugo, Astro, or Next.js MDX blogs. Batch-convert all posts, then manually review headings, images (update paths), and code blocks that may need syntax highlighting hints added.

Security Note

Markdown-to-HTML renders can introduce XSS if not sanitized

Raw HTML is valid Markdown — a Markdown file containing <script>alert('xss')</script> will execute when rendered. Always use a sanitizing Markdown renderer (like DOMPurify + marked) that strips script tags, event handlers, and javascript: URLs from the HTML output.

Frequently Asked Questions

How do I convert HTML to clean Markdown?
Paste your HTML into the input panel and DevBolt converts it to Markdown instantly. The converter maps HTML tags to Markdown equivalents: h1-h6 become # through ######, strong becomes **, em becomes *, links become [text](url), images become ![alt](src), and lists convert to bullet or numbered syntax. Tables become pipe-delimited Markdown tables. Code blocks become fenced blocks with triple backticks. Elements without Markdown equivalents are stripped, preserving only text content. All processing runs client-side.
Can I convert Markdown back to HTML?
Yes, DevBolt's converter works bidirectionally. It processes all standard Markdown syntax including GitHub Flavored Markdown extensions like task lists, strikethrough, fenced code blocks with language identifiers, and pipe-delimited tables. The generated HTML uses semantic tags. This is useful for content management systems that store Markdown but serve HTML, email templates from Markdown drafts, and static site generators where you preview rendered output.
What HTML elements have no Markdown equivalent?
Several HTML elements cannot be represented in standard Markdown: layout elements (div, section, article), form elements (input, select, textarea), media elements beyond images (video, audio, canvas, iframe), interactive elements (details, summary, dialog), and styling elements (span with classes). When converting, these elements are typically stripped with text content preserved, or passed through as raw HTML since most Markdown renderers allow inline HTML.

Related Convert Tools