Advertisement
Guide
About the LICENSE Generator
Code without a license is “all rights reserved” by default: others can read it but have no legal right to use, copy or change it. Adding a LICENSE file is what makes a project open source, and the license you pick decides what others may do with it.
The licenses fall into two families. Permissive licenses like MIT and Apache let anyone use the code, even in closed-source products. Copyleft licenses like the GPL require anyone who distributes changes to share them under the same license.
MIT or Apache 2.0?
Both let people do nearly anything. Apache 2.0 is longer because it adds an explicit patent license from every contributor, ends that license for anyone who sues over patents, and asks for changed files to be marked. Large companies often prefer it for that certainty; MIT wins on simplicity.
GPL, LGPL, AGPL and MPL
The GPL covers the whole program, so linking GPL code into your app makes the app GPL. The LGPL relaxes that for libraries, the MPL applies per file, and the AGPL extends the GPL to software offered over a network, which plain GPL does not cover.
How to use it
- 1Answer the questions, or pick a license from the table.
- 2Read the plain-language summary.
- 3Enter your name and the year.
- 4Save the file as LICENSE in the root of your repository.
Frequently asked questions
What happens if I do not add a license?
Copyright law applies by default, so nobody may legally reuse, modify or redistribute your code, even if it is public on GitHub.
Can I change the license later?
You can relicense code you own outright. Contributions from others stay under the license they were made under unless every contributor agrees, which is why some projects use a contributor agreement.
Which license is best for an npm package?
MIT or ISC are the most common and cause the least friction for users. Apache 2.0 is a good choice if patents are a concern.
Can I use GPL code in a commercial product?
Yes, you can sell it, but if you distribute the product you must provide its full source code under the GPL. Internal use without distribution has no such requirement (except under the AGPL for network services).
What year should the copyright line show?
The year of first publication. Many projects use a range like 2023–2026; updating it every year is optional.
Is this legal advice?
No. It is a plain-language overview of widely used licenses. For anything with real legal or business risk, ask a lawyer.
