Mailbase
FeaturesPricingDocsBlogComparisonsChangelog
Sign inStart free
Home/Blog/What Is MJML? The Framework for Responsive Email
Email designUpdated May 21, 20266 min read

What Is MJML? The Framework for Responsive Email

MJML lets you write simple, semantic markup and compiles it to the messy, cross-client HTML email needs. Here's what it is and when to use it.

By Mailbase Team · Target keyword: what is MJML
Designer working on layouts on a laptop — What Is MJML? The Framework for Responsive Email
Photo from Unsplash
On this page
OverviewHow MJML works — a quick before/afterWhen MJML is the right choiceCommon MistakesSources & Further ReadingRelated guidesFAQRelated reading

Overview

MJML (Mailjet Markup Language) is an open-source framework for building responsive HTML email. Instead of hand-writing the nested tables, inline styles, and Outlook hacks that email clients demand, you write clean semantic components like <mj-section> and <mj-column>, and MJML compiles them into the bulletproof, cross-client HTML underneath. It exists because coding email by hand is tedious and fragile — MJML makes it readable and reliable.

How MJML works — a quick before/after

Writing on a laptop at a quiet desk — How MJML works — a quick before/after
Photo from Unsplash

You write a short, semantic markup describing the layout, and the MJML engine compiles it to the verbose, table-based HTML that renders consistently across Gmail, Outlook, and Apple Mail. A two-column responsive section that would be ~100 lines of nested tables and Outlook conditionals by hand looks like this in MJML:

<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-text>Hello {{name}}</mj-text>
<mj-button href="https://example.com">Get started</mj-button>
</mj-column>
</mj-section>
</mj-body>
</mjml>

Columns stack on mobile automatically — no media queries to write — and the output is bulletproof across clients. The payoff is speed and maintainability: a template that would be hundreds of lines of fragile tables becomes a few dozen readable lines, and because it's just markup, you can version-control it and generate emails programmatically in a build pipeline. See HTML email best practices for why hand-coding is so painful in the first place.

  • Clean components compile to bulletproof, table-based email HTML
  • Responsive (mobile-stacking) by default — no media queries
  • 10x less code than hand-written tables
  • Version-controllable; fits build pipelines and programmatic generation

When MJML is the right choice

Open laptop on a wooden desk — email workflow — When MJML is the right choice
Photo from Unsplash

MJML fits teams that want code-level control and reuse: version-controlled templates, dynamic content, and a shared design system for email. It's the standard for developers building transactional and product emails programmatically. If you'd rather never touch markup, a drag-and-drop builder may suit you better — MJML is for people comfortable with a bit of code who want maintainable, consistent output instead of a black-box editor.

You can run MJML yourself (CLI, a Node/other library, or the online editor), or use a platform that compiles it for you. Mailbase uses MJML for its campaigns and templates, so you get responsive, cross-client emails without hand-coding tables — and the same MJML output flows through the transactional API, campaigns, and A/B tests. That's the rendering benefit of MJML without managing the compiler yourself.

  • Best for teams wanting code-level control, reuse, and dynamic content
  • Drag-and-drop builders suit pure no-code users better
  • Run it yourself (CLI/library/editor) or via a platform
  • Mailbase compiles MJML across campaigns and transactional sends

Common Mistakes

  • Using modern CSS layout that Outlook silently breaks (use tables).
  • Shipping HTML-only emails with no plain-text part — a spam signal.
  • Forgetting alt text and a fallback for when images are blocked.
  • Not testing on a real phone and in Outlook before sending.

Sources & Further Reading

Official docs for current setup details, pricing, and API behavior — verify specifics there, since they change.

MJML documentation

Related guides

More on what is mjml and the surrounding email design workflow:

how to start an email newsletter
how to grow your email list
email marketing for beginners
best time to send email
HTML email best practices
email list segmentation
double vs single opt-in
Try Mailbase free
Send 200 emails a month on us. Paid plans start at €9 — or bring your own useSend for €5.
See plans

FAQ

What is MJML used for?

Building responsive HTML email without hand-coding tables. You write clean components like <mj-section> and <mj-column>, and MJML compiles them into the cross-client, Outlook-safe HTML email requires, with mobile-responsive behavior built in.

Is MJML better than coding HTML email by hand?

For most templates, yes — it's roughly 10x less code, far more maintainable, and handles cross-client quirks and responsiveness automatically. Hand-coding is only worth it for tiny one-off tweaks where pulling in a framework is overkill.

Is MJML free?

Yes — MJML is open-source and free to use via its CLI, libraries, or online editor. Some email platforms also compile MJML for you so you don't run the toolchain yourself.

Do I need to run MJML myself?

Not necessarily. You can use the MJML toolchain directly, or use a platform that compiles it for you. Mailbase uses MJML for its campaigns and templates, so you get the rendering benefits without managing the compiler.

Related reading

Newsletters8 min read
How to Start an Email Newsletter (Step by Step)
Everything you need to launch a newsletter that people actually read — niche, platform, domain setup, first subscribers, and a sustainable sending rhythm.
Email marketing7 min read
How to Grow Your Email List (Without Buying One)
Sustainable list growth comes from giving people a reason to subscribe — here are the tactics that work and the shortcuts that wreck your deliverability.
Email marketing9 min read
Email Marketing for Beginners: A Complete Starter Guide
New to email marketing? Here's the whole picture in plain English — list building, campaigns, deliverability, and the few metrics worth watching.
Email marketing6 min read
The Best Time to Send Email (What the Data Says)
There's no magic hour — but there are sensible defaults and a way to find your list's real best time. Here's how to stop guessing.
Email design8 min read
HTML Email Best Practices That Actually Render
Email clients are not browsers. Here are the HTML email rules that keep your design intact from Gmail to Outlook — and the traps that break it.
Email marketing7 min read
Email List Segmentation: A Practical Guide
Sending everything to everyone is why people unsubscribe. Here's how to segment a list so each email is relevant — without drowning in complexity.
Mailbase
Product
FeaturesPricinguseSend integrationChangelog
Learn
BlogDocsAPI referenceResources
Compare
ComparisonsAlternatives
Guides
Transactional email servicesSelf-hosted useSend stackSelf-hosted email marketingSPF, DKIM & DMARCEmail deliverability
Legal
TermsPrivacy
© 2026 Mailbase · french-webEmail workflow for builders.