Mozilla Public License

Also known as: MPL

On this page 8

The Mozilla Public License (MPL) is a weak, file-level copyleft license in software licensing: anyone may use, modify and distribute covered code, but modifications to MPL-licensed files must stay under the MPL and their source must remain available. Code in separate files may carry any license, including a proprietary one, which places the MPL between permissive licenses such as the MIT License and strong copyleft licenses such as the GPL.

The current version, MPL 2.0, was published by the Mozilla Foundation in January 2012. It is approved by the Open Source Initiative, recognized by the Free Software Foundation as a free software license and, by default, compatible with the GPL family. It governs Firefox, Thunderbird and many infrastructure tools, and it is a common choice when a project wants its own files protected without forcing a license on the surrounding product.

How file-level copyleft works in the MPL

The MPL applies its copyleft obligation to the individual source file, not to the whole program. The license defines Covered Software as the files that carry an MPL notice plus any Modifications to them; a Modification is any change to such a file or any new file that contains code copied out of one.

Section 3.3 introduces the Larger Work, a combination of Covered Software with other material. The distributor may license the Larger Work under any terms, provided the MPL files inside it keep their MPL obligations. In practice, a company can add new proprietary files that call an MPL library, ship the result as a closed product and still comply, as long as the MPL files themselves stay open.

The following table maps the main types of code to the obligations the MPL attaches to each.

Kind of codeLicense that appliesSource disclosure duty
Unmodified MPL fileMPL 2.0Yes, when distributed
Edited MPL fileMPL 2.0Yes, including the edits
New file with copied MPL codeMPL 2.0Yes
New independent fileAny license chosen by the authorNo MPL duty
Larger Work as a wholeAny terms the distributor choosesOnly for its MPL files
What the MPL requires for different kinds of code

Core obligations and rights under MPL 2.0

The obligations of MPL 2.0 are triggered by distribution, not by private use or internal modification. A developer who changes MPL files and runs them only inside an organization owes nothing; the duties begin when the software is shipped to others in Source Code Form or Executable Form.

  • Source availability: a binary distribution must tell recipients how to obtain the MPL source at no more than the cost of distribution.
  • Notice preservation: existing copyright, patent and license notices in covered files must not be removed or altered.
  • Explicit patent license: each contributor grants a royalty-free patent license for claims infringed by its contribution.
  • Patent retaliation: a party that sues alleging that the software infringes a patent loses the patent grants it received.
  • No trademark rights: the license does not grant use of names, logos or trademarks of any contributor.

Termination is automatic on non-compliance, but MPL 2.0 includes a cure period: rights are reinstated permanently if the violator receives a first notice and fixes the problem within 30 days. The table below summarizes these terms and their practical meaning.

ClauseWhat it saysPractical effect
Section 2 grantsCopyright and patent licenses to all recipientsBroad freedom to use and modify
Section 3.2Binary distribution requires source accessShip an offer or link to the source
Section 3.3Larger Works may use other licensesProprietary integration is allowed
Section 3.3 secondary licensesCombination may follow GPL termsInteroperates with GPL projects
Section 5Termination with 30-day cureHonest mistakes can be repaired
Section 10Later versions may be chosenUpgrade path without relicensing
Key clauses of MPL 2.0

MPL compared with other open source licenses

The MPL occupies the middle ground between permissive and strong copyleft licenses. Its scope unit is the file, while the LGPL uses the library and the GPL uses the entire derivative work, which makes MPL obligations easier to locate and audit.

LicenseCopyleft scopeProprietary combinationPatent grant
MIT LicenseNoneAllowed freelyNot explicit
Apache License 2.0NoneAllowed freelyExplicit, with retaliation
MPL 2.0Per fileAllowed in separate filesExplicit, with retaliation
LGPLPer libraryAllowed with relinking conditionsExplicit in version 3
GPLWhole derivative workNot allowed when distributedExplicit in version 3
AGPLWhole work, including network useNot allowedExplicit
How the MPL relates to neighboring licenses

Unlike the AGPL, the MPL has no network-use clause: offering MPL software as a hosted service does not count as distribution. Unlike the LGPL, it imposes no relinking requirement, so static linking of MPL code into a closed binary is acceptable when the MPL files remain available.

GPL compatibility and secondary licenses

MPL 2.0 resolved the GPL incompatibility of MPL 1.1 through a mechanism called Secondary Licenses. When MPL code is combined with code under the GPL 2.0 or later, LGPL 2.1 or later, or AGPL 3.0 or later, the recipient may distribute the combination under those GNU terms while the MPL files stay dual-available under the MPL.

An author can opt out by attaching the “Incompatible With Secondary Licenses” notice from Exhibit B. That opt-out restores the older, stricter behavior and is rarely used in new projects, because it blocks combination with GPL code. Earlier versions, MPL 1.0 from 1998 and MPL 1.1 from 1999, lacked this bridge and required separate dual licensing, which is why older Mozilla code was released under a tri-license of MPL, GPL and LGPL.

Applying the MPL in a project

Adopting the MPL correctly is mostly a matter of placing the standard header from Exhibit A at the top of each covered file and including the full license text in the repository. Because obligations attach per file, the header is not decoration: it is how recipients identify Covered Software.

Project goalSuitable choiceReason
Keep library improvements publicMPL 2.0Edited files must stay open
Maximize corporate adoptionMPL 2.0 or Apache License 2.0Proprietary combination is allowed
Prevent closed derivatives entirelyGPL or AGPLMPL permits closed surrounding code
Cover hosted servicesAGPLMPL has no network clause
Simplest possible termsMIT LicenseMPL needs per-file notices
Choosing the MPL for common project goals

Teams using MPL components should keep modified MPL files clearly separated from proprietary code and track them in a software bill of materials. Mixing proprietary logic into an MPL file, even a few lines, places that logic under the MPL once the file is distributed.

Common misconceptions and compliance risks

Most MPL compliance problems come from misreading the scope of the copyleft, either by overestimating it and avoiding the license unnecessarily or by underestimating it and closing modified files.

  • “MPL infects the whole application.” It does not; only covered files and their Modifications carry obligations.
  • “Renaming a file escapes the license.” Copied MPL code remains covered in whatever file it appears.
  • “Binaries need no source offer.” Executable distribution still requires access to the MPL source.
  • “Notices can be cleaned up.” Removing license headers is a breach of Section 3.4.
  • “SaaS use triggers disclosure.” Running MPL code on a server without distributing it creates no source duty.

In plain words

The Mozilla Public License lets anyone use and change shared code, with one main condition. If you edit one of the files that came under this license and give the software to others, your edits to that file must be shared too.

Everything you write in your own separate files stays yours. You can sell it, keep it secret or license it however you like. Think of it as borrowing pages from a shared notebook: corrections on the borrowed pages go back to everyone, but the new pages you wrote yourself remain your property.

A real-world example

A mid-sized company builds a commercial desktop application for engineering reports. It needs a PDF rendering engine and selects an open component licensed under MPL 2.0. The team writes about 40 new files of proprietary layout logic that call the engine through its public interface, and it fixes a font-handling bug inside two of the engine’s original files.

At release, the legal team checks the boundary. The two modified engine files keep their MPL headers, and the company publishes them in a public repository linked from the product’s about screen. The 40 proprietary files are licensed under the company’s own commercial terms, and the installer contains no source for them.

The outcome is a fully compliant closed-source product that still contributes its bug fix back to the community. Had the engine been under the GPL, the same distribution would have required releasing the entire application source, which the company was not willing to do.