Compare MIT, Apache 2.0, GPL 3.0, MPL 2.0, AGPL and more side by side, then make the file
Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 16 Oct 2026.The choice is mostly between permissive licences, which let others close their changes, and copyleft licences, which make them share changes under the same terms. The table sets eight common licences side by side: commercial use, patent grant, disclosing source, same licence for changes and network use. Tap a row to see its full text with your name filled in.
Set the options you need, or start from the example.
The result is made again every time you change something.
Copy it or download it. Nothing was sent anywhere.
Code without a licence is not open source: by default, copyright law lets nobody else copy, change or share it, even when the repository is public. Adding a LICENSE file in the top folder is what grants those rights, and choosing the licence decides on what terms.
| Licence | Others may close their changes | Patent grant | Changes shared under the same licence |
|---|---|---|---|
| MIT | Yes | No | No |
| Apache 2.0 | Yes | Yes | No |
| BSD 3-Clause | Yes | No | No |
| MPL 2.0 | Yes, outside changed files | Yes | Changed files only |
| GPL 3.0 | No | Yes | Whole program |
| AGPL 3.0 | No, even over a network | Yes | Whole program, including web services |
MIT is the most common choice for libraries; Apache 2.0 adds an explicit patent licence, which larger companies often prefer; GPL 3.0 keeps every version of the program open.
The rest of the article, and all 6 questions about License Generator, are on the License Generator page.
For most libraries, MIT: short, permissive and understood everywhere. Choose Apache 2.0 if you want an explicit patent grant, GPL 3.0 if every changed version must stay open source, and AGPL 3.0 if that should also apply to software offered as a web service. MPL 2.0 sits between them, applying only to the files you wrote.
Both let anyone use, change and sell the code, including in closed products. Apache 2.0 also grants a licence to any patents the contributors hold on their contributions, ends that grant for anyone who sues over patents, and asks that changed files say they were changed. MIT is a few lines long and says nothing about patents.
Then the default copyright rules apply: you keep all rights, and nobody else may copy, change or distribute the code, even if it is in a public repository. People can look at it, but using it in their projects is not allowed. Adding a LICENSE file is what turns published code into open source.
In the top folder of the project, named LICENSE, or COPYING for GPL 3.0 as GNU suggests. GitHub and npm find it there and show the licence on the project page. Also set the license field in package.json to the SPDX identifier, such as MIT, and mention the licence in the README.
Rates and rules change; check the source before you rely on a figure.
Still stuck? Ask about License Generator and anybody who knows can answer. No account needed.
Same job, other tools: Open Graph Tag Generator – Generate og:title, og:description, og:image and og:url tags.
On the related tools: Cron Expression Generator – Generate a cron expression by choosing when the job should run · Sitemap Index Generator – Split a large site into numbered sitemaps with an index file.