# MJML

Open\-source semantic markup and compiler for responsive HTML email templates\.

ID: Q345 · Revision: 331

Type: software · License: MIT[^license] · Status: active

Website: https://mjml.io/



MJML is a markup language and open\-source compiler for responsive HTML email\. Authors describe layouts with email\-oriented components, then compile them into HTML\. The project offers Node\.js and command\-line workflows, making it a candidate for applications that want reusable email templates without writing every underlying table layout by hand\.[^readme]

## A compiler\-based workflow

MJML source describes email components rather than the complete generated HTML\. The Node\.js interface returns compilation output, and the CLI can write HTML to a file\. A browser compiler is also documented\. These routes let template generation live in a development or application workflow without requiring use of the online editor\. The inspected repository package manifest identifies version 5\.4\.1; older snippets should be checked against the installed compiler rather than assumed to describe current options\.[^readme][^package]

## Iteration and build checks

The command\-line tool supports watching files and recompiling on changes\. Its separate validation command reports errors and returns a nonzero exit status when validation fails, making it useful as a build gate\. Template variables embedded in CSS may need the documented sanitization options or a decision to skip CSS minification\. Those options protect template syntax during processing; they should not be read as a general guarantee that arbitrary supplied HTML is safe\.[^cli]

## Validation and raw content

The main documentation describes soft validation as the default: errors are reported but HTML is still rendered\. Strict mode rejects invalid input, while skip bypasses validation\. Ending tags such as mj\-text can contain unprocessed HTML rather than nested MJML components\. Their text is not automatically escaped, so an application must handle content insertion deliberately instead of treating successful compilation as sanitization\.[^docs]

## Shared files and include scope

Current documentation makes includes opt\-in\. When enabled, permitted paths are constrained to configured roots, with additional directories declared through includePath\. This allows shared headers and footers without treating the entire filesystem as template input\. Keep include behavior explicit in generated build configuration, particularly when moving a template from a local project to a hosted rendering service\. The documented defaults are version\-sensitive and are not evidence that an older installed compiler uses the same safeguards\.[^cli]

## Mail\-client differences

Responsive output does not imply identical behavior everywhere\. The documented navbar hamburger behavior is limited to Apple Mail clients; other clients receive inline links\. Outlook desktop also has restrictions around background sizing and nested wrapper/section backgrounds\. These examples make target\-client testing important even when markup passes validation\. No email rendering tests were performed for this submission\.[^docs]

## Licensing and application scope

MJML uses MIT terms, allowing modification and redistribution with notice preservation\. It is an email\-template compiler, not by itself a replacement for the application or service that delivers mail\. The source can be compiled through the documented local interfaces; that software grant does not determine the terms of a hosted editor, rendering API or sending service\.[^license][^readme]

## Substitution considerations

MJML is a candidate alternative to [React Email](/reactemail) when a team prefers dedicated email markup over JSX\-based authoring\. The reverse migration guide explicitly requires conversion of templates and custom components, underscoring that the two source formats are not interchangeable\. Choosing MJML changes the authoring and compilation layer; it does not establish automatic visual equivalence or replace the surrounding delivery workflow\.[^react][^readme]

## Capabilities and substitutions

### Email HTML compilation — supported

Semantic markup compiles through Node\.js or CLI; compilation is separate from sending\.[^readme]

Use case: Authoring and compiling responsive HTML email templates · Platforms: Node\.js, Command line, JavaScript, Web · Region: Version, build and integration requirements apply

### Validation gate — limited

Default soft mode can render invalid markup; strict mode rejects validation errors\.[^docs]

Use case: Authoring and compiling responsive HTML email templates · Platforms: Node\.js, Command line, JavaScript, Web · Region: Version, build and integration requirements apply

### Reusable file includes — limited

Current includes are opt\-in and restricted to configured roots\.[^cli]

Use case: Authoring and compiling responsive HTML email templates · Platforms: Node\.js, Command line, JavaScript, Web · Region: Version, build and integration requirements apply

### Uniform interactive client behavior — limited

Navbar hamburger support and Outlook backgrounds have documented client\-specific restrictions\.[^docs]

Use case: Authoring and compiling responsive HTML email templates · Platforms: Node\.js, Command line, JavaScript, Web · Region: Version, build and integration requirements apply

### [Substitute for React Email](/reactemail) — limited

Can replace React\-based template rendering when a dedicated markup language is preferred; templates and custom components require rewriting\.[^readme][^react]

Use case: Authoring and compiling responsive HTML email templates · Platforms: Node\.js, Command line, JavaScript, Web · Region: Version, build and integration requirements apply

## References

[^readme]: [MJML repository overview](<https://github.com/mjmlio/mjml/blob/master/README.md>) — Semantic components, Node\.js, browser compiler and CLI (vendor; retrieved 2026-10-07T23:34:24Z)

[^docs]: [MJML documentation](<https://documentation.mjml.io/>) — Validation, ending tags, navbar and Outlook background limitations (vendor; retrieved 2026-10-07T23:35:12Z)

[^cli]: [MJML CLI documentation](<https://github.com/mjmlio/mjml/blob/master/packages/mjml-cli/README.md>) — Validation exit status, watch, template CSS and include allowlists (vendor; retrieved 2026-10-07T23:34:31Z)

[^package]: [MJML package manifest](<https://github.com/mjmlio/mjml/blob/master/packages/mjml/package.json>) — Version 5\.4\.1 and compiler dependencies (vendor; retrieved 2026-10-07T23:34:31Z)

[^license]: [MJML MIT license](<https://github.com/mjmlio/mjml/blob/master/LICENSE.md>) — MIT grant, notice conditions and disclaimer (vendor; retrieved 2026-10-07T23:34:24Z)

[^react]: [React Email migration guide](<https://react.email/docs/getting-started/migrating-to-react-email>) — MJML and React template conversion (vendor; retrieved 2026-10-07T23:34:24Z)

Source revision: https://substitutefor.net/entities/Q345?revision=331
