Skip to content

Open Source Licences Explained: MIT, Apache, GPL

“Open source” does not mean “no rules”. The licence decides what you may do with the code — and what you owe in return. The three families that cover most projects.

By Virtuvia Editorial DeskPublished 2 min read
Open Source Initiative logo
Photo: Open Source Initiative / Wikimedia Commons, public domain

Key takeaways

  • Code without a licence is “all rights reserved” — even if it is public on GitHub.
  • Permissive licences (MIT, Apache 2.0) ask mainly for attribution.
  • Copyleft licences (GPL) require that distributed derivative works use the same licence.

What makes software open source?#

Publishing code is not enough. Software is open source when its licence grants everyone the right to use, study, modify and redistribute it — the criteria are set out in the Open Source Definition maintained by the Open Source Initiative (OSI). Without a licence, copyright law applies in full and nobody may legally reuse the code.

Permissive licences: MIT and Apache 2.0#

Permissive licences let anyone use the code in almost any way, including in closed-source commercial products. The main obligation is to keep the copyright notice and licence text.

  • MIT — very short and simple; keep the notice, and the code comes with no warranty.
  • Apache 2.0 — similar freedoms, plus an explicit patent grant from contributors and a requirement to state significant changes.

Copyleft licences: the GPL family#

The GNU General Public License (GPL) lets you use and modify the code too, but if you distribute software built on it, you must release that software’s source under the GPL as well. The goal is that improvements stay open. The AGPL extends this to software offered over a network, such as a web service.

LicenceUse in closed-source productMain obligation
MITYesKeep copyright and licence notice
Apache 2.0YesKeep notices, state changes; patent grant included
GPL v3Only if you release your source under GPL when distributingShare source of derivative works
The short version — always read the licence text itself

How to choose a licence for your project#

  1. Want maximum adoption, including by companies? Choose MIT or Apache 2.0.
  2. Want patent clarity in a larger project with many contributors? Apache 2.0 is the common choice.
  3. Want every improvement to stay open? Choose the GPL (or AGPL for network services).
  4. Add a LICENSE file to the repository root and an SPDX identifier, such as MIT, to your package metadata.

Source and further reading

  1. The Open Source Definition— Open Source Initiative
  2. Choose an open source license— GitHub
  3. SPDX License List— SPDX / Linux Foundation