License Generator
Choose an open source license, fill in the copyright holder and year, and get a ready LICENSE file plus the matching source file header and SPDX identifier. Compare what each license allows and requires before you pick.
1. Choose a license
Standard license texts reproduced for convenience. This is not legal advice.
How to use the License Generator
- Pick a license from the list. The summary shows what it permits, what it requires and what it limits.
- Enter the copyright holder (your name or organization) and the year. Use a range such as 2021-2026 for older projects.
- Optionally add the project name; it is used in GPL-family notices and the README snippet.
- Copy or download the LICENSE file and place it in the root of your repository.
- Add the file header to your source files if you want each file to state its license (recommended for Apache, GPL and MPL).
Open source licenses compared
| License | Type | Patent grant | Must share changes? | Typical use |
|---|---|---|---|---|
| MIT | Permissive | No explicit grant | No | Libraries and apps that want maximum adoption (React, Rails, .NET runtime) |
| Apache-2.0 | Permissive | Yes | No, but changed files must say so | Company-backed projects (Kubernetes, Android, TensorFlow) |
| BSD-2-Clause / BSD-3-Clause | Permissive | No explicit grant | No | Systems software, academic code (FreeBSD) |
| ISC | Permissive | No explicit grant | No | npm packages (default for npm init) |
| MPL-2.0 | Weak copyleft (per file) | Yes | Only modified MPL-licensed files | Firefox and projects that mix open and proprietary files |
| LGPL-3.0 | Weak copyleft (library) | Yes | Changes to the library itself | Libraries meant to be linked by any program |
| GPL-3.0 | Strong copyleft | Yes | Yes, the whole combined work when distributed | Applications that should stay free software (GIMP, Bash) |
| AGPL-3.0 | Network copyleft | Yes | Yes, also when offered as a network service | Server software and SaaS components |
| Unlicense / 0BSD / MIT-0 | Public domain style | No explicit grant | No, and no attribution required | Snippets, examples, templates |
“Must share changes” only applies when you distribute the software (or, for AGPL, let users interact with it over a network). Using GPL software privately inside a company does not trigger the source-sharing condition.
How to add a license to your repository
- Create a file named
LICENSE(orLICENSE.txt,LICENSE.md,COPYING) in the root of the repository and paste the full license text. GitHub, GitLab and package registries detect it automatically. - Declare the SPDX identifier in your package manifest, for example
"license": "MIT"in package.json orlicense = "Apache-2.0"in Cargo.toml. - Optionally add a short header with
SPDX-License-Identifierto each source file. This is recommended for Apache, GPL and MPL projects, where files are often copied individually. - Mention the license in your README so visitors see it at a glance.
- If you include third-party code, keep its original license and copyright notices intact. For Apache-licensed dependencies, also carry over their NOTICE file content.
Compatibility tips
Permissive code (MIT, BSD, ISC, Apache-2.0) can generally be included in GPL-3.0 projects, but GPL code cannot be relicensed under a permissive license. Apache-2.0 is compatible with GPL-3.0 but not with GPL-2.0-only. MPL-2.0 files can be combined with GPL code thanks to its secondary-license clause, unless the author marked the files as “Incompatible With Secondary Licenses”. When in doubt, check the license's official FAQ.
Frequently asked questions
Which open source license should I choose?
For maximum reuse with minimal conditions, MIT or ISC are the most common choices. Apache-2.0 is similar but adds an explicit patent grant and is popular for company projects. Choose GPL-3.0 if you want modified versions to stay open source, LGPL-3.0 for libraries that proprietary apps may link to, MPL-2.0 for file-level copyleft, and AGPL-3.0 if the software runs as a network service.
What year should I put in the copyright line?
Use the year the work was first published. Many projects use a range such as 2019-2026 to show the first and latest year of changes. The notice is informative; copyright exists automatically even without it.
Do I need to include the full license text?
Yes. The license text itself should be in a LICENSE (or COPYING) file in your repository. For Apache, GPL and MPL you can also add the short notice to the top of each source file, which points to the full text.
What is an SPDX license identifier?
SPDX identifiers are standard short names such as MIT, Apache-2.0 or GPL-3.0-or-later. Package managers (npm, Cargo, PyPI) and tools use them to detect licenses, and a line like SPDX-License-Identifier: MIT at the top of a file states its license in a machine-readable way.
What is the difference between GPL-3.0-only and GPL-3.0-or-later?
GPL-3.0-only means the code is licensed under version 3 only. GPL-3.0-or-later (the wording in the official GNU notice) also lets users choose any later version the Free Software Foundation publishes. This tool uses the or-later wording from the GNU how-to by default, and you can switch it.
Is this legal advice?
No. The generator reproduces the standard license texts and notices, but it cannot advise you on your specific situation. For commercial or dual-licensing questions, talk to a lawyer.
Does the tool send my name anywhere?
No. The LICENSE is assembled in your browser. Only if you press Load full official text for a long license does the page download that public license text from a CDN; your name is not sent.