elefcode

LICENSE Generator

Answer three questions to find the right open-source license, compare them in plain language, and get the full LICENSE file with your name filled in.

Help me choose
May others use your code in closed-source products?
Suggested:
Your details
Compare
LicenseCopyleftPatent grantCredit needed
No—✓
No✓✓
Whole program✓✓
Whole program + network use✓✓
Library only✓✓
Per file✓✓
No—✓
No—✓
No—✓
No——

MIT

Do almost anything, including closed-source and commercial use, as long as the copyright notice stays. Short and the most popular choice.

Used by React, Node.js, Rails, jQuery.

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Put it in the root of your repository.

  • Enter the copyright holder — usually your name or your organisation.
  • This is general information, not legal advice. For a commercial product or a dual-licensing plan, check with a lawyer.

Advertisement

Guide

About the LICENSE Generator

Code without a license is “all rights reserved” by default: others can read it but have no legal right to use, copy or change it. Adding a LICENSE file is what makes a project open source, and the license you pick decides what others may do with it.

The licenses fall into two families. Permissive licenses like MIT and Apache let anyone use the code, even in closed-source products. Copyleft licenses like the GPL require anyone who distributes changes to share them under the same license.

MIT or Apache 2.0?

Both let people do nearly anything. Apache 2.0 is longer because it adds an explicit patent license from every contributor, ends that license for anyone who sues over patents, and asks for changed files to be marked. Large companies often prefer it for that certainty; MIT wins on simplicity.

GPL, LGPL, AGPL and MPL

The GPL covers the whole program, so linking GPL code into your app makes the app GPL. The LGPL relaxes that for libraries, the MPL applies per file, and the AGPL extends the GPL to software offered over a network, which plain GPL does not cover.

How to use it

  1. 1Answer the questions, or pick a license from the table.
  2. 2Read the plain-language summary.
  3. 3Enter your name and the year.
  4. 4Save the file as LICENSE in the root of your repository.

Frequently asked questions

What happens if I do not add a license?

Copyright law applies by default, so nobody may legally reuse, modify or redistribute your code, even if it is public on GitHub.

Can I change the license later?

You can relicense code you own outright. Contributions from others stay under the license they were made under unless every contributor agrees, which is why some projects use a contributor agreement.

Which license is best for an npm package?

MIT or ISC are the most common and cause the least friction for users. Apache 2.0 is a good choice if patents are a concern.

Can I use GPL code in a commercial product?

Yes, you can sell it, but if you distribute the product you must provide its full source code under the GPL. Internal use without distribution has no such requirement (except under the AGPL for network services).

What year should the copyright line show?

The year of first publication. Many projects use a range like 2023–2026; updating it every year is optional.

Is this legal advice?

No. It is a plain-language overview of widely used licenses. For anything with real legal or business risk, ask a lawyer.

Related tools