
MJML
A markup language that compiles simple email templates into responsive HTML that works across email clients.
- Stars
- 18.3k
- Forks
- 1k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 14 days ago
- Type
- Dev tool
What it is
MJML is a markup language created by Mailjet for building responsive HTML emails with less effort. You write simpler, semantic tags and its open-source engine translates them into the responsive HTML that email clients need. It ships with a standard component library to speed up building.
- Compile an MJML file to HTML with the command line: mjml input.mjml -o output.html
- Render MJML inside a Node.js app to generate email HTML on the fly
- Watch a folder of templates and rebuild them as you edit
- Edit templates in Visual Studio Code using the official plugin
Great for
- Developers who build transactional or marketing emails by hand
- Teams that need emails to display well on phones and desktop clients
- People who want a readable template format instead of nested email HTML tables
- Anyone who wants to try it in the browser before installing
Not ideal for
- People who only need a plain-text or single-page web layout, since MJML targets email output
- Users who do not work with Node.js or the command line and want no setup; the README points to an online editor for that case
How to get it
- 1
Install with a package manager
You'll need: Node.js
Install MJML with NPM
npm install mjml - 2
Run it
- Install MJML with npm install mjml, or try the free online editor at mjml.io
- Write a small .mjml file with an mj-body, mj-section, mj-column and mj-text
- Run mjml input.mjml -o output.html to produce the HTML
- Open output.html in a browser to preview it
- 3
Get the most out of it
- Use the -w flag to watch a file or folder and rebuild on every change
- Enable --config.minify or --config.beautify to control the final HTML size and format
- Install the Visual Studio Code plugin for editing support
- Use the Node.js API with the options object to control output such as keepComments
Downloads
Strengths
- Simple, semantic syntax designed specifically for responsive email
- Open-source engine with a standard component library
- Multiple ways to use it: npm package, CLI, online editor, and editor plugins
Trade-offs
- Output depends on the MJML engine version, so template and tool versions need to stay in sync
- Advanced options such as includes and template syntax need careful configuration, per the CLI and options tables
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| mjml (this) | 18.3k | Dev tool | beginner | 14 days ago | Developers who build transactional or marketing emails by hand |
| react-email | 19.9k | Library | beginner | 7 days ago | Developers who already build web apps with React and want to write email templates the same way |
| responsive-html-email-template | 13.7k | Design asset | beginner | 2.2 years ago | Developers sending transactional or product emails through an API service |
| tailwindcss | 98.3k | Library | intermediate | 4 days ago | Web developers who build their own interfaces and want to avoid writing large custom stylesheets |
| ngx-admin | 25.7k | Framework | intermediate | 2.1 years ago | Developers starting a new Angular admin or back-office dashboard |
| tachyons | 11.7k | Library | beginner | 4 months ago | Developers who want to prototype or build a UI quickly with plain HTML or a component framework |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.