Skip to content

Software Licenses

Reference guide to common open source software licenses and how to choose one.

Lowest friction

Use MIT when you want a short, familiar license that is easy for most developers and companies to adopt.

Patent-aware permissive

Use Apache-2.0 when you want a permissive license with an explicit patent grant.

Keep derivatives open

Use GPL-3.0 or AGPL-3.0 when preserving open source obligations is a core project goal.

LicenseTypeAllows commercial useRequires source disclosurePatent grantBest for
MITPermissiveYesNoNo explicit grantSimple libraries, examples, small tools
BSD 2-ClausePermissiveYesNoNo explicit grantAcademic and infrastructure projects
BSD 3-ClausePermissiveYesNoNo explicit grantProjects that also restrict endorsement
Apache-2.0PermissiveYesNoYesLibraries, SDKs, company-backed projects
GPL-3.0Strong copyleftYesYes, for distributed derivativesYesProjects that should remain open source
LGPL-3.0Weak copyleftYesUsually only changes to the LGPL componentYesLibraries used by proprietary apps
AGPL-3.0Network copyleftYesYes, including network service useYesServer software and hosted applications
MPL-2.0File-level copyleftYesYes, for modified MPL filesYesMixed open/proprietary codebases
UnlicensePublic domain styleYesNoNo explicit grantTiny public-domain-like snippets
CC0-1.0Public domain dedicationYesNoNo patent licenseData, docs, examples, creative assets

Permissive Licenses

Permissive licenses allow broad reuse with minimal obligations. Users can usually copy, modify, redistribute, sublicense, and include the code in proprietary products.

  • Keep the copyright notice.
  • Keep the license text.
  • Do not imply endorsement when the license says so.

Copyleft Licenses

Copyleft licenses allow reuse, but require derivative works to remain under compatible open source terms when distributed.

  • Provide the license text.
  • Preserve notices.
  • Provide source code when distributing covered binaries.

Common permissive choices:

  • MIT: short, widely understood, and easy to comply with.
  • BSD-2-Clause: similar to MIT, with slightly different wording.
  • BSD-3-Clause: adds a non-endorsement clause.
  • Apache-2.0: includes an explicit patent license and patent retaliation terms.

Common copyleft choices:

  • GPL-3.0: strong copyleft for distributed software.
  • LGPL-3.0: weaker copyleft designed for libraries.
  • AGPL-3.0: extends GPL-style obligations to software offered over a network.
  • MPL-2.0: applies copyleft at the file level, allowing easier mixing with proprietary files.
GoalGood default
Maximum adoption with minimal frictionMIT
Permissive license with explicit patent protectionApache-2.0
Keep all distributed derivatives open sourceGPL-3.0
Keep a web service open source even when hostedAGPL-3.0
Open source a library while allowing proprietary apps to link itLGPL-3.0
Protect only modified files, not the whole projectMPL-2.0
Release documentation, datasets, or examples as freely as possibleCC0-1.0
  • MIT, BSD-2-Clause, and BSD-3-Clause code can usually be included in GPL projects.
  • Apache-2.0 is compatible with GPL-3.0, but not with GPL-2.0-only.
  • GPL code generally cannot be combined into proprietary distributed software.
  • LGPL libraries can often be used by proprietary software, but modifications to the LGPL library itself must remain open under LGPL terms.
  • AGPL is stricter for hosted software because network users must be able to receive the source code.
  • CC0 is common for data and examples, but it is usually not the best choice for software when patent rights matter.

When adding a license to a project:

  1. Create a root LICENSE or LICENSE.md file.
  2. Use the exact official license text.
  3. Add the copyright line if the license requires one.
  4. Mention the license in README.md.
  5. Add package metadata where relevant, such as license in package.json.
  6. Check dependencies for incompatible licenses before publishing.
{
"license": "MIT"
}

For dual licensing:

{
"license": "(MIT OR Apache-2.0)"
}
[project]
license = "MIT"

SPDX identifiers are standard short names used by package managers, scanners, and repositories.

LicenseSPDX identifier
MIT LicenseMIT
Apache License 2.0Apache-2.0
GNU General Public License v3.0 onlyGPL-3.0-only
GNU General Public License v3.0 or laterGPL-3.0-or-later
GNU Lesser General Public License v3.0 onlyLGPL-3.0-only
GNU Affero General Public License v3.0 onlyAGPL-3.0-only
Mozilla Public License 2.0MPL-2.0
BSD 2-Clause LicenseBSD-2-Clause
BSD 3-Clause LicenseBSD-3-Clause
Creative Commons Zero v1.0 UniversalCC0-1.0
The UnlicenseUnlicense