Softwr

Web Development · head to head

MJML vs Preact

M

MJML

Web Development

Open-source markup language that compiles to responsive HTML email

From
Free
Free plan
Yes
Preact logo

Preact

Web Development

3kB alternative to React with the same modern API

From
Free
Free plan
Yes

The short version

  • Both are free.
  • Only MJML lists semantic components; only Preact lists 3kB runtime.
  • Where MJML falls short: it is a code framework, so marketers without HTML knowledge cannot use it without a developer or a separate editor.
  • Where Preact falls short: compatibility through preact/compat is good but not total, and some React libraries break in ways that are hard to diagnose.

How do MJML and Preact differ?

MJML and Preact differ on platforms. Only the attributes on which MJML and Preact actually diverge.

Attributes where MJML and Preact differ
AttributeMJMLPreact
PlatformsWeb, macOS, Windows, Linux, APIWeb

Identical on both: starting price (Free), pricing model (Open source, no licence fee), free tier (Yes).

Not yet recorded: category for MJML.

Which features does each one have?

They share no listed features; 6 appear only for MJML and 4 only for Preact. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in MJML

  • Semantic components
  • Responsive by default
  • Custom components
  • Compiler to HTML
  • Open source
  • Online playground

Only in Preact

  • 3kB runtime
  • preact/compat
  • Same modern API
  • Fast rendering

What is each one used for?

MJML is most often brought in for A development team keeping email templates in git and compiling them in CI; Preact for embedded widgets that load inside someone else’s page and must stay small. The jobs each tool is most often brought in to do.

MJML

  • A development team keeping email templates in git and compiling them in CInot Preact
  • Transactional email with shared layouts across many message typesnot Preact
  • An agency building reusable email components for several clientsnot Preact
  • Developers who want Outlook-safe layouts without hand-writing tablesnot Preact

Preact

  • Embedded widgets that load inside someone else’s page and must stay smallnot MJML
  • Marketing and content sites where JavaScript payload affects Core Web Vitalsnot MJML
  • Applications targeting low-bandwidth or low-powered devicesnot MJML

Where do MJML and Preact fall short?

MJML's most cited limit: it is a code framework, so marketers without HTML knowledge cannot use it without a developer or a separate editor. Preact's: behavioural differences from React exist in edge cases, particularly around event handling. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

MJML

  • It is a code framework, so marketers without HTML knowledge cannot use it without a developer or a separate editor
  • It does not send or host email, so you need an ESP and a preview tool such as an email testing service alongside it
  • Output is table-based HTML that is larger and harder to read than hand-crafted markup, which makes manual debugging of client quirks slower
  • Custom components need JavaScript knowledge, so extending it is not a no-code task
  • Origins in Mailjet and now Sinch mean the project direction depends on a vendor whose main business is selling email delivery, not maintaining the framework

Preact

  • Compatibility through preact/compat is good but not total, and some React libraries break in ways that are hard to diagnose
  • Behavioural differences from React exist in edge cases, particularly around event handling
  • A much smaller community, so unusual problems have fewer existing answers than React

How much do MJML and Preact cost?

MJML is free to use; Preact is free to use. Plan by plan below, from each vendor's own pricing page.

MJML

Free
  • MJMLFree
    • Open-source framework
    • No licence fee
    • Community support

Preact

Free
  • PreactFree
    • Full library
    • Commercial use permitted
    • No usage limits

Which should you pick?

Choose MJML if

  • You need semantic components.
  • You want to start without paying.
  • You work on Web, macOS, Windows, Linux, API.
  • You also want responsive by default.

Choose Preact if

  • You need 3kb runtime.
  • You want to start without paying.
  • You also want preact/compat.

Questions people ask

Is MJML or Preact better?
It depends on the job. MJML fits a development team keeping email templates in git and compiling them in CI; Preact fits embedded widgets that load inside someone else’s page and must stay small. MJML starts at Free and Preact at Free.
Which is cheaper, MJML or Preact?
MJML starts at Free and Preact at Free.
Does MJML or Preact run on more platforms?
MJML runs on Web, macOS, Windows, Linux, API. Preact runs on Web.
Can I use MJML for free?
Both have a free tier, so you can try either at no cost before committing.
What is MJML best used for?
MJML is most often used for a development team keeping email templates in git and compiling them in ci, transactional email with shared layouts across many message types, an agency building reusable email components for several clients, developers who want outlook-safe layouts without hand-writing tables. Of those, a development team keeping email templates in git and compiling them in ci and transactional email with shared layouts across many message types are not what Preact is typically brought in for.
What can MJML do that Preact cannot?
MJML covers Semantic components, Responsive by default, Custom components, Compiler to HTML. Preact covers 3kB runtime, preact/compat, Same modern API, Fast rendering.

Answered from the vendors’ own pages

MJML: Is MJML free?

Yes. It is open source with no licence fee.

Preact: Is Preact free?

Yes, open source under the MIT licence.

MJML: Does MJML send email?

No. It compiles markup to HTML; you send it with an ESP.

Preact: Can I use React libraries with Preact?

Most, through the preact/compat layer. Compatibility is good but not complete, so libraries relying on React internals can break.

MJML: Who created MJML?

Developers at Mailjet, in early 2015.

Preact: Why choose Preact over React?

Bundle size, almost always. If payload is not a binding constraint, React’s ecosystem is usually the better trade.

MJML: Does it work with Outlook?

Its output is built to be responsive in the most popular clients, including Outlook.

Share

Related pages

Other head to heads