Skip to main content

Email MJML Preview

Write and preview MJML email templates in real time. Switch between mobile (375px) and desktop viewports, insert common MJML snippets, and export the compiled HTML ready to send. Includes newsletter, transactional, and promotional starter templates.

✓ Live preview ✓ Mobile + Desktop viewports ✓ 3 starter templates ✓ Export to HTML ✓ Runs 100% in your browser

Frequently Asked Questions

What is MJML?▼

MJML (Mailjet Markup Language) is an open-source HTML email framework designed to make responsive email coding easy. Instead of writing complex HTML tables and inline styles from scratch, you write semantic MJML components like <mj-section>, <mj-column>, and <mj-text> — and MJML compiles them to battle-tested, cross-client HTML. It's the most popular email templating framework with 50,000+ GitHub stars.

Why do emails need special HTML like MJML?▼

Email clients (Outlook, Gmail, Apple Mail, Yahoo) have notoriously inconsistent CSS and HTML support. Outlook uses the Word rendering engine, which doesn't support flexbox, grid, or many modern CSS properties. Gmail strips <head> styles. Mobile clients need different layouts than desktop. MJML abstracts all of this — it generates responsive, table-based HTML that renders correctly across 90+ email clients automatically.

What is the difference between minAvailable and mobile/desktop preview?▼

The desktop preview shows the email at full container width (typically 600px, which is the standard for email width). The mobile preview shows it at 375px, simulating an iPhone SE/14 viewport. MJML's generated HTML includes media queries and fluid layouts that automatically restack columns to single-column on mobile.

What are the core MJML components?▼

<mj-section> is the row wrapper, always inside <mj-body>. <mj-column> is the column inside a section — multiple columns create a multi-column layout. <mj-text> renders text with font and color attributes. <mj-button> creates a CTA button. <mj-image> for images. <mj-divider> for horizontal rules. <mj-table> for HTML tables. All live inside <mjml><mj-head> (metadata) and <mj-body> (content).

How do I use MJML in production?▼

In Node.js projects: npm install mjml, then const { html } = mjml2html(mjmlString). For build pipelines, use the mjml CLI: mjml input.mjml -o output.html. For transactional emails, services like Mailjet, SendGrid, and Postmark have native MJML support. The generated HTML should be inlined (use a CSS inliner) before sending — tools like juice or premailer handle this automatically.

What is the recommended email width?▼

600px is the universal standard for email content width. This ensures readability in a two-pane email client (like Outlook with a sidebar) and on most desktop monitors. The actual email container is often wider, but the content table is constrained to 600px with margin: auto. On mobile, MJML automatically adjusts to 100% viewport width.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →