Convert HTML Email Content to Readable Markdown

Convert HTML email content with table-based layouts, inline styles, and legacy markup to clean Markdown. Handle newsletter templates, Outlook-specific markup, and conditional comments.

Real-World HTML

Detailed Explanation

HTML Email to Markdown

HTML emails are among the most challenging content to convert to Markdown. They rely on table-based layouts, inline styles, and legacy markup for compatibility with email clients.

Table-Based Layouts

Email HTML uses tables for layout (not data):

<table width="600" cellpadding="0" cellspacing="0">
  <tr>
    <td style="padding: 20px;">
      <h1 style="color: #333;">Newsletter Title</h1>
      <p style="font-size: 16px; color: #666;">
        Welcome to our <strong>weekly update</strong>.
      </p>
    </td>
  </tr>
</table>

Should convert to:

# Newsletter Title

Welcome to our **weekly update**.

The converter must recognize that layout tables are structural containers, not data tables, and extract only the content.

Distinguishing Layout Tables from Data Tables

This is the hardest part of email HTML conversion:

  • Layout tables — have width, cellpadding, cellspacing, nested <td> with block content → strip the table, keep inner content
  • Data tables — have <thead>, <th>, or tabular data → convert to Markdown pipe tables

Email-Specific Elements

<a href="https://example.com" style="background: #007bff; color: #fff; padding: 10px 20px; text-decoration: none; border-radius: 4px;">
  Click Here
</a>

This "button" is just a styled link:

[Click Here](https://example.com)

Conditional Comments

Microsoft Outlook uses conditional comments:

<!--[if mso]>
<table><tr><td>
<![endif]-->
<p>Content here</p>
<!--[if mso]>
</td></tr></table>
<![endif]-->

All conditional comments and their content should be stripped during conversion.

Preheader Text

<span style="display:none;font-size:1px;color:#fff;max-height:0;">
  Preview text for email clients
</span>

Hidden preheader text should be stripped since it is invisible content.

Email Signatures

Email signatures typically contain contact info, social links, and logos in a complex table layout. Converters should extract the text content and convert links while discarding the layout structure.

Use Case

Email-to-Markdown conversion is needed when archiving newsletters, converting email content for blog posts, extracting information from HTML emails for documentation, or building Markdown-based email archives. It is particularly useful for teams that want to store email content in version-controlled Markdown files.

Try It — HTML to Markdown

Open full tool