Open Source Licenses Comparison
Choosing the right open source license is a critical decision that affects how your code can be used, modified, and distributed. Whether you’re releasing a new project or evaluating dependencies for commercial software, understanding license differences helps avoid legal issues and align with your goals. This article provides a comprehensive comparison of major open source licenses, covering legal implications, practical considerations, and business perspectives.
Quick Reference Matrix
Permissions and Conditions
| License | Type | Commercial Use | Modification | Distribution | Private Use | Sublicense |
|---|---|---|---|---|---|---|
| MIT | Permissive | Yes | Yes | Yes | Yes | Yes |
| Apache 2.0 | Permissive | Yes | Yes | Yes | Yes | Yes |
| BSD 2-Clause | Permissive | Yes | Yes | Yes | Yes | Yes |
| BSD 3-Clause | Permissive | Yes | Yes | Yes | Yes | Yes |
| GPL-2.0 | Strong Copyleft | Yes | Yes | Yes | Yes | Yes (same terms) |
| GPL-3.0 | Strong Copyleft | Yes | Yes | Yes | Yes | Yes (same terms) |
| LGPL-3.0 | Weak Copyleft | Yes | Yes | Yes | Yes | Yes (same terms) |
| AGPL-3.0 | Strong Copyleft | Yes | Yes | Yes | Yes | Yes (same terms) |
| MPL-2.0 | Weak Copyleft | Yes | Yes | Yes | Yes | Yes |
Requirements and Restrictions
| License | Include License | Copyright Notice | State Changes | Disclose Source | Same License | Network Clause |
|---|---|---|---|---|---|---|
| MIT | Yes | Yes | No | No | No | No |
| Apache 2.0 | Yes | Yes | Yes | No | No | No |
| BSD 2-Clause | Yes | Yes | No | No | No | No |
| BSD 3-Clause | Yes | Yes | No | No | No | No |
| GPL-2.0 | Yes | Yes | Yes | Yes | Yes | No |
| GPL-3.0 | Yes | Yes | Yes | Yes | Yes | No |
| LGPL-3.0 | Yes | Yes | Yes | Library only | Library only | No |
| AGPL-3.0 | Yes | Yes | Yes | Yes | Yes | Yes |
| MPL-2.0 | Yes | Yes | Yes | Modified files | Modified files | No |
Patent and Trademark Rights
| License | Patent Grant | Patent Retaliation | Trademark Grant |
|---|---|---|---|
| MIT | No | No | No |
| Apache 2.0 | Yes | Yes | No (explicit) |
| BSD 2-Clause | No | No | No |
| BSD 3-Clause | No | No | No (endorsement clause) |
| GPL-2.0 | Implicit | No | No |
| GPL-3.0 | Yes | Yes | No |
| LGPL-3.0 | Yes | Yes | No |
| AGPL-3.0 | Yes | Yes | No |
| MPL-2.0 | Yes | Yes | No |
Compatibility Matrix
| License | GPL-2.0 Compatible | GPL-3.0 Compatible | Proprietary Compatible |
|---|---|---|---|
| MIT | Yes | Yes | Yes |
| Apache 2.0 | No | Yes | Yes |
| BSD 2-Clause | Yes | Yes | Yes |
| BSD 3-Clause | Yes | Yes | Yes |
| GPL-2.0 | Yes | No (one-way) | No |
| GPL-3.0 | No (one-way) | Yes | No |
| LGPL-3.0 | Yes (linking) | Yes | Yes (linking) |
| AGPL-3.0 | No | Yes | No |
| MPL-2.0 | Secondary license | Yes | Yes (new files) |
Use in Proprietary Projects
| License | Can Link/Use | Source Disclosure Required | Notes |
|---|---|---|---|
| MIT | Yes | No | Include license file |
| Apache 2.0 | Yes | No | Include license + NOTICE |
| BSD 2-Clause | Yes | No | Include license file |
| BSD 3-Clause | Yes | No | Include license, no endorsement |
| GPL-2.0 | No | Entire project | Cannot link without open sourcing |
| GPL-3.0 | No | Entire project | Cannot link without open sourcing |
| LGPL-3.0 | Yes (dynamic) | Library modifications | Allow library replacement |
| AGPL-3.0 | No | Entire project + network | SaaS must disclose source |
| MPL-2.0 | Yes | Modified MPL files only | File-level copyleft |
License Categories
Open source licenses fall into two main categories based on how they treat derivative works.
Permissive Licenses
Permissive licenses impose minimal restrictions on how software can be used, modified, and redistributed. They allow proprietary derivatives and commercial use with few obligations.
Common permissive licenses:
- MIT License
- Apache License 2.0
- BSD 2-Clause (Simplified)
- BSD 3-Clause (New BSD)
- ISC License
Copyleft Licenses
Copyleft licenses require derivative works to be distributed under the same or compatible license terms. They ensure modifications remain open source.
Common copyleft licenses:
- GNU General Public License v2 (GPL-2.0)
- GNU General Public License v3 (GPL-3.0)
- GNU Lesser General Public License (LGPL)
- GNU Affero General Public License (AGPL)
- Mozilla Public License 2.0 (MPL-2.0)
Permissive Licenses in Detail
MIT License
Most popular open source license due to simplicity. Permits use, copy, modify, merge, publish, distribute, sublicense, and sell. Only requirement: include copyright notice and license text. Compatible with almost all other licenses.
Apache License 2.0
Similar to MIT but adds explicit patent grants and trademark protection. Contributors grant patent licenses, modified files must state changes, and NOTICE files must be preserved. Better for enterprise adoption due to clear patent and trademark boundaries.
| Aspect | MIT | Apache 2.0 |
|---|---|---|
| Patent grant | Implicit/none | Explicit grant |
| Trademark rights | Not addressed | Explicitly excluded |
| State changes | Not required | Required for modified files |
| NOTICE file | Not applicable | Must preserve if present |
BSD Licenses
BSD licenses come in several variants. BSD 2-Clause requires copyright notice in source and binary distributions. BSD 3-Clause adds prohibition on using project name for endorsement. BSD 4-Clause (rarely used) requires advertising to mention the project, causing GPL incompatibility.
| Clause | BSD 2-Clause | BSD 3-Clause | BSD 4-Clause |
|---|---|---|---|
| Copyright notice | Required | Required | Required |
| No endorsement | No | Yes | Yes |
| Advertising | No | No | Yes |
| GPL compatible | Yes | Yes | No |
Copyleft Licenses in Detail
GNU General Public License (GPL)
GPL-2.0 is a strong copyleft license requiring derivative works to be licensed under GPL-2.0. Source code must be provided, and all modifications must be open sourced. Cannot use in proprietary software as linked library. No explicit patent license.
GPL-3.0 updated GPL-2.0 with explicit patent provisions, anti-tivoization measures (prevents hardware lockdown of GPL software), and better internationalization. More compatible with Apache 2.0. Some projects (Linux kernel) stayed on v2 due to anti-tivoization clause.
| Aspect | GPL-2.0 | GPL-3.0 |
|---|---|---|
| Patent grant | Implicit | Explicit |
| Tivoization | Not addressed | Prohibited |
| DRM restrictions | Not addressed | Anti-circumvention |
| Termination | Permanent | Automatic reinstatement |
GNU Lesser General Public License (LGPL)
Weaker copyleft that allows linking from proprietary software. Library modifications must be licensed under LGPL, but combined work can be proprietary. Must allow users to replace the LGPL library. Good for libraries wanting wider adoption while ensuring modifications are shared back.
GNU Affero General Public License (AGPL)
Extends GPL-3.0 to require source distribution when software is used to provide a network service. Closes the “SaaS loophole” in GPL by requiring SaaS providers to share modifications. Often avoided by commercial SaaS companies.
Mozilla Public License 2.0 (MPL-2.0)
File-level copyleft: only modified MPL files must remain open source. New files can use any license. Balanced between permissive and copyleft with explicit patent grant. Easier commercial adoption than GPL.
| Aspect | GPL-3.0 | LGPL | MPL-2.0 |
|---|---|---|---|
| Scope | Entire derivative | Library boundary | File-level |
| Proprietary combination | No | Linking only | Yes (new files) |
| Complexity | High | Medium | Low |
Practical Guidance
Choosing a License for Your Project
| License | Best For | Key Benefit |
|---|---|---|
| MIT / BSD | Libraries, tools, maximum adoption | Simple terms, proprietary forks allowed |
| Apache 2.0 | Enterprise software, patent-sensitive projects | Explicit patent grant, clear trademark boundaries |
| GPL | Applications requiring open derivatives | Prevents proprietary forks, strong community |
| LGPL | Libraries wanting commercial adoption | Proprietary linking allowed, modifications shared |
| AGPL | SaaS applications | Closes network loophole, encourages commercial licensing |
| MPL-2.0 | Balance between permissive and copyleft | File-level copyleft, proprietary additions allowed |
Dual Licensing Strategy
Dual licensing offers open source version under GPL/AGPL while selling commercial licenses for proprietary use. Requires Contributor License Agreements (CLAs) to ensure contributors grant rights for both licenses.