Developer / Open source

Open Source License Generator

Create a LICENSE file for MIT, Apache 2.0, GPL, LGPL, AGPL, MPL, BSD, ISC, Unlicense, and more, with your name and year filled in, and compare what each licence allows.

Open Source License Generator: The licence texts are the official ones from the SPDX License List, used by GitHub and package registries to identify licences. Short permissive licences such as MIT and BSD get your name and year in their copyright line; longer ones such as the GPL and Apache 2.0 are used word for word, with your copyright notice going in a header in each file, given here in the SPDX format. The table compares copyleft, patent rights, notice requirements, and OSI and FSF approval. Runs 100% locally in your browser with zero server file uploads.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
License generatorLocal processing

Runs entirely in your browser

How the licences compare

LicenceTypePatent rightsNotice required in copiesOSIFSF
PermissiveNot mentionedYes
PermissiveExplicit grantYes
Strong copyleftExplicit grantYes
Strong copyleftNot mentionedYes
Weak copyleftExplicit grantYes
Strong copyleft, including network useExplicit grantYes
Weak copyleftExplicit grantYes
PermissiveNot mentionedYes
PermissiveNot mentionedYes
PermissiveNot mentionedYes
PermissiveNot mentionedNo
PermissiveNot mentionedNo
PermissiveNot mentionedIn source copies only
PermissiveExpressly not grantedNo
Strong copyleftExplicit grantYes

Texts and OSI and FSF approval come from the SPDX License List 3.29.0. This is a summary, not legal advice: read the licence itself, and ask a lawyer for anything that matters.

Applying the licence

Save the text as LICENSE (or LICENSE.txt, or COPYING for the GPL) in the repository's root, set the licence field in package.json, Cargo.toml, or pyproject.toml to its SPDX identifier, and add the two-line SPDX header to each source file so the licence travels with copied files.

Alongside it, keep build output and secrets out of the repository with the .gitignore generator.

Mixing licences

Permissive code can usually be used in copyleft projects, but not the other way round: GPL code cannot go into an MIT project without making the result GPL. Apache 2.0 code is compatible with GPL version 3 but not version 2.

How to use it

  1. Choose a licence, using the comparison table if you are unsure.
  2. Enter the year and the copyright holder's name.
  3. Download the LICENSE file into your repository's root, and add the header to your source files.

Privacy & limitations

Everything is generated in your browser.

Related tools

Frequently asked questions

Which licence should I choose?

For maximum reuse, MIT or Apache 2.0 (which adds an explicit patent grant). To make sure changes stay open, the GPL; for libraries that proprietary programs may link to, the LGPL or MPL; for software offered over a network, the AGPL.

What does copyleft mean?

Copies and changed versions must be shared under the same licence: strong copyleft covers the whole program, weak copyleft only the licensed files or library, and the AGPL extends to users who reach the program over a network.

What is the difference between GPL-3.0-only and -or-later?

With or-later, users may also follow any later GPL version the FSF publishes; with only, version 3 alone applies. The licence text is the same; the choice goes in your file headers.

Free tool · runs in your browser · no account required