LICENSE File Generator — MIT, Apache 2.0, GPL, BSD and More

Add the right open-source license to your project in seconds. Pick MIT, Apache 2.0, GPL 3.0, BSD, ISC, MPL 2.0, AGPL, LGPL or the Unlicense, fill in your name and the year, and copy or download a ready LICENSE file — with the SPDX identifier for package.json, a README badge and the short notice to put at the top of source files. Not sure which one? The comparison shows what each allows and requires.

Runs on our serverUpdated

LICENSE

Also add

This tool fetches the public URL you enter from our server. Results are held in temporary memory for a few minutes and never stored in a database.

How to use the LICENSE File Generator

  1. Choose a license — the summary shows what it allows and what it requires of people who use your code.
  2. Enter the copyright holder (you or your company), the year and the project name.
  3. Copy or download the LICENSE file and put it in the root of your repository.
  4. Add the SPDX identifier to package.json, the README badge, and — for Apache, GPL and MPL — the short notice at the top of your source files.

Which license should I choose?

LicenseIn shortMust share changes?
MITDo anything, keep the notice. The most popular choice.No
Apache 2.0Like MIT, plus an explicit patent grant and a notice of changes.No
BSD 2 / 3-Clause, ISCShort permissive licenses; BSD-3 also forbids using your name to promote derived products.No
MPL 2.0Changed files must stay open; can be combined with closed code.Changed files only
LGPL 3.0Changes to the library stay open; apps that only link to it can be closed.The library
GPL 3.0Anything you distribute that includes the code must also be GPL.Yes
AGPL 3.0Like GPL, and also applies when people use it over a network (SaaS).Yes, also for SaaS
UnlicensePublic domain — no conditions at all.No

The short licenses are included in full. The full texts of Apache 2.0, the GPL family and MPL 2.0 are long, so the generator fetches the official text from apache.org, gnu.org or mozilla.org when you pick one. This page explains licenses but isn’t legal advice — for company code, check with your legal team. Related: README Generator, package.json Generator, .gitignore Generator.

Also searched as: license generator, mit license generator, open source license generator, apache license 2.0, gpl 3.0 license, choose a license, spdx license, bsd license generator.

Tools that pair well with the LICENSE File Generator

  • Changelog Generator — Paste your git log and get a tidy CHANGELOG.md section: commits grouped into Features, Bug Fixes, Performance and Breaking Changes, scopes in bold, links to commits — plus the next semantic version.
  • Conventional Commit Builder — Write commit messages that follow the Conventional Commits spec without memorizing it.
  • .editorconfig Generator — Make every editor on your team use the same indentation, line endings and charset.
  • HTML Formatter — Paste minified or messy markup and get clean, consistently indented HTML — including embedded <style> and <script> blocks.

Frequently asked questions

How do I add a license to my GitHub project?
Generate the license here, save it as LICENSE (no extension) in the repository root and commit it. GitHub then shows the license on the repository page.
What is the difference between MIT and Apache 2.0?
Both let anyone use, change and sell your code. Apache 2.0 adds an explicit patent license and requires people to note changes; MIT is shorter and simpler.
What does copyleft mean?
Copyleft licenses (GPL, AGPL, and partly LGPL and MPL) require that distributed changes stay under the same license, so the code stays open. Permissive licenses (MIT, BSD, Apache) don’t.
What should I put in package.json?
The SPDX identifier, for example "license": "MIT" or "license": "Apache-2.0". The generator shows it for the license you pick.

Related tools