Make a LICENSE file: MIT, Apache 2.0, GPL 3.0 and 20 more, with your name and year
Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 16 Oct 2026.A licence generator gives you the full text of an open-source licence with your name and year filled in, ready to save as a LICENSE file. Choose from 23 licences, including MIT, Apache 2.0 and GPL 3.0, see what each permits and requires, and copy the SPDX identifier for package.json.
Tap the licence that fits, such as MIT for simple and permissive, or pick any of 23 from the list.
Type the copyright holder; the year is already filled in.
Click Download to save the LICENSE file, then put it in the top folder of the project.
Copy the SPDX line into package.json or the top of each source file if you want tools to read it.
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.
Choosing. The main question is what others must do with their changes:
| 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.
Filling in. Most permissive licences carry a copyright line with a year and a name. Type the copyright holder and the year is already there; a range such as 2019-2026 also works. Licences such as GPL, Apache and MPL have no line to fill in at the top: the text is used exactly as published.
Where the texts come from. The 23 texts are those of choosealicense.com, the site GitHub uses when you add a licence to a repository, at a fixed commit. Each was compared word by word with the SPDX License List's own text, and at least 95 per cent of the words match in order; the differences are titles and the GNU notes on how to apply the licence.
After saving. Put the file in the top folder of the project, add the SPDX identifier to package.json or the top of each source file, and say which licence you use in the README. This page is not legal advice. Everything runs in your browser.
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.
The year the code was first published, or a range from the first to the latest year of changes, such as 2019-2026. Updating the year is common but not required: the notice records when the work was created. Use the name of the person or organisation that owns the copyright, often an employer for work code.
You can release new versions under a different licence if you own all the copyright, but copies already released keep the licence they came with. If other people contributed code, you need their agreement to relicense their parts, unless they signed a contributor agreement that allows it. Choosing carefully at the start avoids this.
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: MD5 Generator – MD5 hash of text or a file, for checksums and legacy systems · 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.
Open it set for: MIT License Generator.