License compatibility is the property of two or more software licenses that allows code governed by them to be combined into a single work and distributed without breaking the terms of any of them. In software licensing, two licenses are compatible when it is possible to satisfy all of their conditions at the same time for the combined result.
The question arises constantly in open source development, where a typical application includes dozens or hundreds of third-party components. Compatibility is usually directional: code under a permissive license can often flow into a copyleft project, while the reverse is generally not allowed.
How license compatibility is determined
License compatibility is determined by comparing the obligations and restrictions of each license and checking whether one distribution can honor them all simultaneously. If one license demands that the combined work be released under its own terms and another forbids exactly that, the licenses conflict and the combination cannot be lawfully distributed.
The analysis usually considers four questions: what each license permits, what it requires (attribution, notices, source disclosure), what it forbids (additional restrictions, certain uses), and whether it requires derivative works to carry the same license. The last condition, known as copyleft, is the most common source of incompatibility.
Compatibility normally matters only at the point of distribution. Combining incompatible code privately, for internal use, is generally not restricted by these licenses, with the notable exception of the AGPL, whose obligations extend to users interacting with the software over a network.
The following table shows how license categories typically behave when combined.
| Combination | Usual result | Reason |
|---|---|---|
| Permissive into permissive | Compatible | Both require mainly attribution |
| Permissive into strong copyleft | Usually compatible | Copyleft terms can absorb permissive code |
| Strong copyleft into permissive project | Combined work becomes copyleft | Copyleft terms extend to the whole work |
| Two different strong copyleft licenses | Often incompatible | Each demands its own terms for the whole |
| Copyleft into proprietary product | Incompatible for distribution | Source disclosure conflicts with closed terms |
Compatibility between widely used licenses
Specific license pairs have well-established compatibility positions, mostly published by the license authors themselves. These positions depend on the exact license version, which is why projects should always state versions precisely, for example GPL-2.0-only or GPL-3.0-or-later in SPDX identifier form.
| Incoming license | Into GPLv2-only | Into GPLv3 | Notes |
|---|---|---|---|
| MIT License | Yes | Yes | Attribution notice must be retained |
| BSD 3-clause | Yes | Yes | Non-endorsement clause is acceptable |
| Apache License 2.0 | No | Yes | Patent and indemnity terms conflict with GPLv2 |
| Mozilla Public License 2.0 | Yes, by default | Yes, by default | Secondary license clause allows it unless opted out |
| LGPL 2.1 | Yes | Yes | Can be relicensed under GPL terms |
| AGPL 3.0 | No | Yes, with conditions | GPLv3 section 13 permits combination |
A frequent surprise is that GPLv2-only and GPLv3 are incompatible with each other, because each version requires the combined work to be licensed under that exact version. Code released as “version 2 or any later version” avoids this problem because the recipient may choose GPLv3.
License compatibility compared with related licensing concepts
License compatibility is often confused with neighboring licensing concepts. Each one answers a different legal question, and treating them as the same leads to wrong conclusions about what can be shipped.
| Concept | Question it answers | Relation to compatibility |
|---|---|---|
| License compatibility | Can these codes be combined and distributed? | The central question |
| Dual licensing | May the recipient choose between licenses? | Choosing one option can resolve a conflict |
| Relicensing | Can the owner change the license? | Requires all copyright holders to agree |
| Contributor License Agreement | Who may relicense contributions? | Can make later relicensing possible |
| License compliance | Are all obligations actually met? | Compatible licenses still need compliance |
Compatibility is a precondition, not a guarantee. Two compatible licenses still impose attribution, notice and source-availability duties that must be fulfilled in the shipped product.
Managing license compatibility in practice
Organizations manage license compatibility through policy, tooling and review. A written open source policy defines which licenses are approved, which need review, and which are banned for particular kinds of products, such as distributed binaries or SaaS offerings.
- Identify every dependency, including transitive ones, with a software composition analysis tool.
- Record licenses in a software bill of materials (SBOM) using SPDX identifiers.
- Compare each license against the project’s outbound license and distribution model.
- Escalate conflicts to legal review and resolve them by replacing, isolating or relicensing components.
- Re-run the analysis on every release, because dependency updates can change licenses.
The architecture of the combination also matters. Whether dynamic linking, plug-ins or separate processes communicating over a network create a single derivative work is legally disputed and depends on jurisdiction and facts, so organizations should not rely on technical separation alone without legal advice.
| Conflict situation | Resolution option | Trade-off |
|---|---|---|
| GPL library in proprietary app | Replace with permissively licensed alternative | Engineering effort, possible feature gaps |
| Apache 2.0 code in GPLv2-only project | Move project to GPLv3 if permitted | Needs agreement of all copyright holders |
| Dual-licensed component | Select the compatible license option | May require a commercial license fee |
| Incompatible copyleft modules | Ship them as separate programs | Legal certainty depends on integration depth |
Common mistakes and misconceptions
Most license compatibility problems come from assumptions rather than unusual licenses. The following mistakes appear repeatedly in audits and acquisitions.
- Assuming open source means compatible: two open source licenses approved by the Open Source Initiative can still conflict.
- Ignoring license versions: GPLv2-only and GPLv3 code cannot be mixed, even though both are GPL.
- Overlooking transitive dependencies: a permissive package may itself depend on copyleft code.
- Treating source-available licenses as open source: licenses such as the Server Side Public License and the Business Source License add use restrictions that conflict with GPL terms.
- Removing attribution: dropping copyright notices breaks even the most permissive license.
In plain words
Software licenses are sets of rules that say how code may be used and shared. License compatibility asks a simple question: if code with one set of rules is mixed with code that has another set, can both sets of rules be followed at once?
Some rules are relaxed and only ask for credit. Others insist that anything built with the code must be shared under the same rules. When two strict rule sets each demand to be in charge, they clash, and the combined program cannot be legally shared. Checking compatibility early avoids rebuilding a product later.
A real-world example
A startup builds a commercial desktop video editor and plans to sell it as a closed-source product. Before release, its engineering lead runs a software composition analysis scan on the build. The report lists 240 dependencies, of which 231 use MIT, BSD or Apache 2.0 terms, but one audio codec library is licensed under GPL-3.0-only.
Because distributing a proprietary binary that incorporates GPL code would require releasing the editor’s source under the GPL, the team treats the finding as a release blocker. They replace the library with a codec under the Apache License 2.0, which costs two weeks of integration work, and they add the scan to their continuous integration pipeline. The product ships on schedule with a complete notice file, and no copyleft obligation applies to the proprietary code.