Code Generator Tools

Open Source License Generator

Choose a licence, add your name and year, and download a ready-to-commit LICENSE file with the official, unmodified text. For GPL, Apache and MPL you also get the short notice for the top of each source file.

Private by design: anything you enter is processed in your browser only. It is never uploaded to or logged on our servers. Share links contain the chosen licence, name, year and project line.

Licence

official page

Compare licences

Based on the choosealicense.com summaries. Click a row to select it. This is a guide, not legal advice.

Licence Permissions Conditions Limitations

About open source licences

Code published without a licence is "all rights reserved": others may look at it but cannot legally copy, change or redistribute it. Adding a LICENSE file to the root of your repository tells people what they may do. GitHub, GitLab, npm, Packagist and PyPI recognise the standard texts and show the licence automatically, which only works when the text is unmodified.

The texts here are the official versions from gnu.org, apache.org, mozilla.org and choosealicense.com, checked byte for byte. For MIT, BSD and ISC your year and name are written into the copyright line. The GPL family, Apache 2.0 and MPL 2.0 must be copied without changes, so the tool gives you the short notice each licence recommends for the top of every source file, with your name filled in and wrapped in the comment syntax of your language.

Quick guide: choose MIT or ISC for the widest reuse, Apache 2.0 when you want an explicit patent grant, MPL 2.0 to keep changes to your files open while allowing use in closed products, GPL-3.0 to keep every derivative open, AGPL-3.0 when the software runs as a network service, and LGPL-3.0 for libraries that closed-source apps may link to. Also add an "license" field with the SPDX identifier (such as MIT or GPL-3.0-or-later) to package.json or composer.json.

Reference Guide

SPDX identifiers to use in package manifests and SPDX-License-Identifier: file headers:

LicenceSPDX identifierFile name
MITMITLICENSE
Apache License 2.0Apache-2.0LICENSE (plus an optional NOTICE)
GNU GPL v3GPL-3.0-only or GPL-3.0-or-laterLICENSE or COPYING
GNU LGPL v3LGPL-3.0-only or LGPL-3.0-or-laterCOPYING.LESSER plus the GPL text as COPYING
GNU AGPL v3AGPL-3.0-only or AGPL-3.0-or-laterLICENSE
Mozilla Public License 2.0MPL-2.0LICENSE
BSD 2-Clause / 3-ClauseBSD-2-Clause / BSD-3-ClauseLICENSE
ISCISCLICENSE
The UnlicenseUnlicenseUNLICENSE or LICENSE

The GNU notices generated here say "either version 3 of the License, or (at your option) any later version", which is the -or-later variant recommended by the FSF. Remove that phrase if you mean -only.

Frequently Asked Questions

MIT or ISC if you want anyone to reuse your code with minimal conditions, Apache 2.0 if you also want an explicit patent grant, GPL-3.0 if every derivative must stay open source, AGPL-3.0 if the software runs as a web service, LGPL-3.0 for a library that closed-source apps may link to, and MPL 2.0 to keep changes to your files open while allowing use in closed products.

Yes. They are the unmodified texts from gnu.org, apache.org, mozilla.org and choosealicense.com, so GitHub, GitLab and package registries recognise them automatically. Only the copyright line of MIT, BSD and ISC is filled in with your year and name.

Those texts must be copied without changes. Your name and year go into the short notice that the licence asks you to put at the top of each source file, which the generator creates for you in the comment style of your language.

The year the work was first published, or a range such as 2019-2025 if you keep updating it. The year field accepts ranges and lists.