MIT License: Maximum Freedom
The MIT license is two paragraphs: use the code however you want, include the license text. No copyleft, no patent clauses, no restrictions on commercial use. React, jQuery, Rails, and most npm packages use MIT. Choose MIT when you want maximum adoption with minimal friction.
GPL: Copyleft Protection
The GPL (GNU General Public License) requires derivative works to also be GPL-licensed. If you modify GPL code and distribute it, you must share your modifications. GPLv2 (Linux kernel) and GPLv3 (many GNU tools) are the most common versions. GPLv3 adds patent protection and anti-tivoization clauses.
Apache 2.0: Business-Friendly
Apache 2.0 is permissive like MIT but adds explicit patent grants — contributors grant users a license to any patents covered by their contributions. It also requires attribution in a NOTICE file. Kubernetes, TensorFlow, and Android use Apache 2.0. Choose it when patent clarity matters.
AGPL: SaaS Copyleft
The AGPL extends GPL to network use. If you run modified AGPL code as a service (SaaS), you must share the source code. MongoDB, Grafana, and Nextcloud use AGPL. This prevents companies from taking open source code, modifying it, and offering it as a closed-source service. Many companies have policies against using AGPL code.
BSD and MPL
BSD (2-clause, 3-clause): similar to MIT, slightly different wording. FreeBSD and Nginx use BSD. MPL 2.0 (Mozilla Public License): file-level copyleft — modified files must stay MPL, but you can combine with proprietary code. Firefox and Rust use MPL. MPL is a good middle ground between MIT and GPL.
Choosing a License
Want maximum adoption? MIT. Want to ensure derivatives stay open? GPL. Want patent protection? Apache 2.0. Want SaaS protection? AGPL. Want file-level copyleft? MPL. No license is NOT an option — unlicensed code is "all rights reserved" by default, meaning nobody can legally use it.
Conclusion
Understanding licenses is essential for both using and publishing open source code. For most new projects, MIT or Apache 2.0 are safe choices. For projects where you want to ensure the community benefits from improvements, GPL or AGPL provide stronger protections. Always read the license before using a dependency in commercial software.