Weak copyleft

Mozilla Public License 2.0

A file-level copyleft: only modified MPL files must be published, and the rest of the code can be under any license. It can also be combined with the GPL.

SPDXMPL-2.0

Permissions, conditions and limitations at a glance

Permissions

  • Commercial useThe software and derivatives may be used for commercial purposes.
  • ModificationThe software may be modified.
  • DistributionThe software may be distributed.
  • Patent useContributors expressly grant patent rights.
  • Private useThe software may be used and modified privately without publishing it.

Conditions

  • Disclose sourceSource code must be made available when distributing.
  • License and copyright noticeA copy of the license and the copyright notice must be included when distributing.
  • Same license (file)Modifications to existing files must be distributed under the same license.

Limitations

  • LiabilityExpressly states that there is no liability for damages.
  • Trademark useExpressly states that no trademark rights are granted.
  • WarrantyExpressly states that no warranty is provided.

Permissions, conditions and limitations are classified using data from choosealicense.com (GitHub, MIT License).

What kind of license is it?

The Mozilla Foundation published MPL 2.0 in January 2012. It is used by Mozilla products such as Firefox and Thunderbird, and is characterized by setting the scope of copyleft at the file level. Files under the MPL (and changes to them) must have their source published under the MPL, but newly written separate files can be under other licenses, and a "Larger Work" (Section 3.3) combining MPL code can as a whole be distributed on terms of your choice. It also has an express patent grant and a clause terminating the grant upon patent litigation.

What you must do when distributing

Secondary Licenses and GPL compatibility

Section 1.12 of MPL-2.0 defines GPL-2.0, LGPL-2.1, AGPL-3.0 and their later versions as "Secondary Licenses". Under Section 3.3, a Larger Work combining MPL code with code under a GNU license can be distributed under the GNU license. However, if the original author attached an Exhibit B ("Incompatible With Secondary Licenses") notice to the file, this compatibility does not apply. MPL-1.1 had no such mechanism and was incompatible with the GPL; this was improved in 2.0.

Common misconceptions

How to apply it

Put the text in LICENSE; attaching the Exhibit A notice ("This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0…") to the top of each source file is recommended. If that is impractical, you may put it somewhere recipients are likely to look, such as a LICENSE file in the relevant directory. The SPDX identifier is MPL-2.0 (MPL-2.0-no-copyleft-exception if Exhibit B is present).

When it fits

It is a good compromise when you want improvements to your library or engine returned but do not want to constrain the licenses of the products that use it. Its conditions are simpler than the LGPL's, and there is no static linking issue. When HashiCorp changed Terraform from MPL-2.0 to the BUSL in 2023, the community forked the MPL-2.0 version as OpenTofu.

Can MPL-2.0 code go into another project?

General verdicts for taking code released under this license and distributing it combined into a project under each license below. See other combinations in the compatibility checker →

Target projectVerdictNotes
Proprietary (closed-source) software Allowed with conditionsMPL files must remain under MPL-2.0 on a per-file basis and their source must be provided. The rest of the code can be under another license.
MIT Allowed with conditionsMPL files must remain under MPL-2.0 on a per-file basis and their source must be provided. The rest of the code can be under another license.
Apache-2.0 Allowed with conditionsMPL files must remain under MPL-2.0 on a per-file basis and their source must be provided. The rest of the code can be under another license.
LGPL-2.1 Allowed with conditionsMPL-2.0 recognizes GPL-2.0 or later, LGPL-2.1 or later and AGPL-3.0 or later as 'Secondary Licenses', so the combined work may be distributed under a GNU license. This is not possible if the original author attached 'Incompatible With Secondary Licenses' (Exhibit B).
LGPL-3.0 Allowed with conditionsMPL-2.0 recognizes GPL-2.0 or later, LGPL-2.1 or later and AGPL-3.0 or later as 'Secondary Licenses', so the combined work may be distributed under a GNU license. This is not possible if the original author attached 'Incompatible With Secondary Licenses' (Exhibit B).
GPL-2.0 Allowed with conditionsMPL-2.0 recognizes GPL-2.0 or later, LGPL-2.1 or later and AGPL-3.0 or later as 'Secondary Licenses', so the combined work may be distributed under a GNU license. This is not possible if the original author attached 'Incompatible With Secondary Licenses' (Exhibit B).
GPL-3.0 Allowed with conditionsMPL-2.0 recognizes GPL-2.0 or later, LGPL-2.1 or later and AGPL-3.0 or later as 'Secondary Licenses', so the combined work may be distributed under a GNU license. This is not possible if the original author attached 'Incompatible With Secondary Licenses' (Exhibit B).
AGPL-3.0 Allowed with conditionsMPL-2.0 recognizes GPL-2.0 or later, LGPL-2.1 or later and AGPL-3.0 or later as 'Secondary Licenses', so the combined work may be distributed under a GNU license. This is not possible if the original author attached 'Incompatible With Secondary Licenses' (Exhibit B).

The content on this site is general information, not legal advice. For actual distribution, contracts or disputes, consult a lawyer or other qualified professional.