Why You Need a License
If you publish code on GitHub without a license, it's not open source. Default copyright law applies: nobody has permission to use, modify, or redistribute your code. They can look at it, but they can't legally use it. Choosing a license — explicitly, in a LICENSE file — grants those permissions with specific conditions. The license you pick determines whether companies can use your code in proprietary products, whether modifications must be shared back, and how credit must be given.
The Major Licenses
MIT — "Do whatever you want, just keep the notice"
The simplest and most permissive widely-used license. Allows use, modification, distribution, sublicensing, and commercial use — with one condition: the copyright notice and license text must be included in copies. No copyleft, no patent grant, no restrictions. The default choice for libraries that want maximum adoption.
Best for: Libraries, npm packages, projects where adoption matters more than controlling derivatives.
Apache 2.0 — MIT + patent protection + contributor terms
Like MIT but adds an explicit patent grant (contributors can't later sue users for patent infringement based on the contributed code) and requires stating changes made to the original files. More legally comprehensive than MIT — preferred by large companies for this reason.
Best for: Projects where patent concerns matter, corporate-backed open source, projects that want permissive terms with legal thoroughness.
GPL v3 — "Share alike, always"
The strong copyleft license: any modified version or software that includes GPL code must also be released under GPL. This ensures derivatives remain open source. v3 also addresses patent grants, anti-tivoization (preventing hardware lockdown), and compatibility with other licenses.
Best for: Projects that want to ensure all derivatives stay open source. Linux kernel, GNU tools, WordPress.
GPL v2 — GPL without the v3 additions
The previous version, still widely used. Doesn't include the patent or anti-tivoization provisions of v3. Linux specifically uses GPLv2-only, not "v2 or later." Incompatible with Apache 2.0 (this is why many projects moved to "GPLv2 or later" or "GPLv3").
BSD (2-Clause and 3-Clause)
Very similar to MIT. 2-clause = MIT. 3-clause adds a non-endorsement clause: you can't use the project's name or contributors' names to promote derivatives without permission.
AGPL v3 — "GPL for network services"
Like GPL v3 but closes the "SaaS loophole": if you modify AGPL code and run it as a network service, you must release your modifications. GPL only requires release when you distribute the software — not when you host it. AGPL covers both.
Decision Framework
- Do you want derivatives to stay open source? Yes → GPL or AGPL. No → MIT or Apache 2.0.
- Is patent protection important? Yes → Apache 2.0. No → MIT.
- Is this a network service? Yes and copyleft → AGPL. No → GPL.
- Does a company sponsor this? Apache 2.0 is the corporate standard.
Pick a License Now
Use ToolsVito's Open Source License Picker — answer a few questions about your project and get a recommended license. Understand the trade-offs without reading legal textbooks. All in your browser.