Permissions, conditions and limitations at a glance
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
- If you distribute an executable, inform recipients how they can obtain the source of the MPL-covered files (Section 3.2).
- Do not remove or alter the license notices of MPL files.
- If you modified MPL files, continue to distribute those files under MPL-2.0.
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
- "Using an MPL library makes my app MPL" — No. Files you create yourself do not have to be MPL.
- "The MPL cannot be mixed with the GPL" — From 2.0 on it can, unless Exhibit B is present.
- "If I copy MPL code and paste it into my own file, my file is still free" — The pasted MPL code remains MPL. Because file boundaries are the boundaries of the obligation, it is safer to keep code in separate files rather than mixing it.
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 project | Verdict | Notes |
|---|---|---|
| Proprietary (closed-source) software | Allowed with conditions | MPL 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 conditions | MPL 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 conditions | MPL 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 conditions | MPL-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 conditions | MPL-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 conditions | MPL-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 conditions | MPL-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 conditions | MPL-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.