ModernCalcs

License Generator

Generate open-source license text for your project. Choose from MIT, Apache 2.0, GPL v3, ISC, or Unlicense.

MIT License

SPDX: MIT

MIT License

Copyright (c) 2026 Your Name

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.

Open Source License Generator — MIT, Apache 2.0, GPL, and More

Every software project on GitHub needs a LICENSE file. Without one, your code is under exclusive copyright by default — no one has the legal right to use, modify, or distribute it, even if it is publicly visible. Select a license, enter your name and year, and get the exact text to paste into your project's LICENSE file — no formatting required, ready to commit.

Formula
LICENSE file = license template filled with [Year] and [Author/Organization name]

Place the output in a file named LICENSE (no extension) or LICENSE.txt at the root of your repository. Most package managers and GitHub automatically detect and display it.

Why Open Source Licenses Matter

A license defines what others are legally permitted to do with your code. It answers: Can they use it in a commercial product? Can they modify it and keep the changes private? Must they credit you? Must they open-source their own project? Without a license, the answer to all these questions is 'no' by default — your code is copyrighted and unusable by others without explicit permission. A permissive license like MIT essentially answers 'yes' to all of them; a copyleft license like GPL says 'yes, but only if your project is also open source'.

The Permissive vs Copyleft Spectrum

At one end: Unlicense and CC0 — no conditions at all, pure public domain dedication. Then MIT and ISC — use for anything, attribution required (just keep the copyright notice). Then BSD 2-Clause and 3-Clause — same as MIT with a non-endorsement clause. Then Apache 2.0 — MIT-equivalent plus explicit patent grant. Then MPL 2.0 (Mozilla) — file-level copyleft: modified files must be open-sourced, but the rest of your project can be proprietary. Then LGPL — library copyleft: you can link it in proprietary code, but LGPL modifications must be released. Then GPL v3 — strong copyleft: any software that distributes GPL code must release its full source under GPL.

Choosing the Right License for Your Project

For a JavaScript library or npm package: MIT or ISC — these are what the ecosystem expects and what downstream developers assume. For a company-sponsored SDK or framework: Apache 2.0 — the patent grant protects both the company and users. For software you want to keep free and open forever: GPL v3 — forces all derivatives to remain open source, prevents proprietary forks. For a web service or SaaS platform: AGPL v3 — extends GPL's copyleft to network use (prevents hosting GPL software as a private service without releasing modifications). For creative works, datasets, or documentation: CC0 or CC BY — designed for non-software content.

The Unlicense and CC0 — Dedicating Code to the Public Domain

The Unlicense explicitly disclaims all copyright and places the software in the public domain. The CC0 does the same for creative and data content. These are appropriate when you want zero friction for reuse: no attribution required, no license header in derivative works, no copyleft conditions. Some jurisdictions do not legally recognise public domain dedications, which is why both licenses include a fallback permissive license grant for maximum legal coverage. The difference: Unlicense is written for software; CC0 is written for all creative works and is more commonly recognised internationally.

Quick Reference

  • MIT — most popular, permissive, attribution-only: React, Vue, Rails, .NET Core
  • Apache 2.0 — permissive + patent grant: Android, Kubernetes, TensorFlow
  • GPL v3 — strong copyleft: WordPress, Linux kernel (GPLv2), GCC
  • LGPL — library copyleft, linkable in proprietary code: Qt, glibc
  • ISC — MIT-equivalent, cleaner language: OpenBSD, npm itself
  • BSD 2/3-Clause — permissive + non-endorsement: FreeBSD, Django
  • MPL 2.0 — file-level copyleft: Firefox, Thunderbird
  • Unlicense / CC0 — public domain, no restrictions

Frequently Asked Questions

What is the most popular open source license?

The MIT License is the most widely used open source license. According to GitHub surveys, roughly 45% of public repositories use MIT. It is extremely permissive: anyone can use, copy, modify, distribute, and sell your code with the only requirement being that the original copyright notice and license text are included. Major projects using MIT: React, Vue.js, jQuery, Ruby on Rails, .NET Core.

What is the difference between MIT and Apache 2.0?

Both are permissive licenses with similar practical freedoms — use commercially, modify, distribute, sublicense. The key difference: Apache 2.0 includes an explicit patent grant. Contributors to Apache 2.0 projects grant users a license to any patents they hold that are necessary to use the software. MIT has no such clause. If patent protection matters for your project (common in enterprise or hardware-adjacent software), Apache 2.0 is safer. Apache 2.0 is also slightly more complex — it requires a NOTICE file if one exists.

What does copyleft mean?

Copyleft is a licensing principle that requires any derivative work to be distributed under the same (or a compatible) license. The GPL (GNU General Public License) is the best-known copyleft license: if you use GPL code in your project and distribute it, your entire project's source code must also be released under GPL. This is sometimes called 'viral'. Copyleft prevents companies from taking open source code, adding proprietary improvements, and distributing the result without contributing back.

Can I use GPL code in my commercial project?

It depends on how you use it. If you use GPL software as a separate tool (e.g., a build tool or CLI utility you run but do not link against), your code is generally not affected. If you link GPL code into your application (distribute it as part of your product), you must release your application's source under GPL — which is incompatible with proprietary commercial distribution. LGPL (Lesser GPL) allows linking without this requirement. AGPL extends copyleft to network use (SaaS).

What is the Unlicense?

The Unlicense is a public domain dedication — it explicitly waives all copyright and related rights to your code. Anyone can do anything with it, with no attribution requirement, no restrictions, and no conditions. It is functionally equivalent to releasing code as public domain but uses explicit legal language. The CC0 (Creative Commons Zero) serves the same purpose and is more commonly used for creative works, datasets, and documentation. Use Unlicense or CC0 when you want absolutely zero restrictions on use.

Which license should I choose for my npm package?

For most npm packages: MIT is the default choice — it is what the ecosystem expects and what most package managers display prominently. Use Apache 2.0 if your organisation cares about patent protection. Use ISC if you want MIT-equivalent simplicity with slightly cleaner legal language (BSD, ISC, and MIT are functionally equivalent). Avoid GPL for libraries unless you specifically want to enforce copyleft — GPL libraries cannot be used in proprietary software, which limits adoption significantly.

Do I need a license if my code is on GitHub?

Yes — without an explicit license, your code is under exclusive copyright by default. Posting code on GitHub makes it visible but does not give anyone the legal right to use, modify, or distribute it. GitHub's Terms of Service allow others to view and fork repositories, but forking does not grant a usage license for the code. If you want others to actually use your code, you must add a LICENSE file. The absence of a license is not the same as public domain.