Open Source License Generator
Pick a license, enter the year and copyright holder, then download the complete LICENSE file and copy the matching per-file header.
MITMIT License (MIT) — Short and permissive: anyone may reuse the code, including in closed-source products, as long as the copyright and license notice are kept.
LICENSE file (full text)
Source file header
// SPDX-License-Identifier: MIT // Copyright (c) 2026 Your Name
License texts are reproduced verbatim from their official sources. This tool is not legal advice — for commercial or dual-licensing questions, ask a lawyer.
What This License Generator Does
Code published without a license is not open source: by default copyright law reserves all rights to the author, so nobody can legally reuse it. Adding a LICENSE file to the root of your repository fixes that. This tool produces the complete, official text of the nine most common open source licenses, fills in your name and year where the license expects them, and generates the short header you can paste at the top of each source file.
Short licenses (MIT, ISC, BSD, Unlicense) contain the copyright line inside the LICENSE file itself. Long licenses (Apache 2.0, GPL, AGPL, MPL) are distributed unmodified; for those the copyright line lives in the per-file notice, exactly as each license's own "how to apply" appendix recommends.
How to Use It
- Choose a license in the License menu. A one-line summary appears below the controls.
- Enter the Year (a single year or a range such as
2019-2026) and the Copyright holder — your name or your organization. - For GPL or AGPL, pick Version 3 or any later version or Version 3 only. The SPDX identifier updates to match.
- Click Download LICENSE and commit the file to the root of your repository.
- In Source file header, choose your language's comment style and click Copy header to paste it at the top of your files.
Example: an MIT Header
With MIT, year 2026, holder Jane Doe and the // comment style, the header box contains:
// SPDX-License-Identifier: MIT // Copyright (c) 2026 Jane Doe
Also set "license": "MIT" in package.json (or the equivalent field in pyproject.toml, Cargo.toml, etc.) so registries display it.
License Comparison
| License | Type | Patent grant | Attribution | Same license required for | Typical use |
|---|---|---|---|---|---|
| MIT | Permissive | No | Keep copyright + license notice | No | Libraries, small tools, maximum adoption |
| ISC | Permissive | No | Keep copyright + license notice | No | Same as MIT; npm default |
| BSD 2-Clause | Permissive | No | Keep notice in source and binary docs | No | Like MIT, older academic style |
| BSD 3-Clause | Permissive | No | Same as BSD-2 + no endorsement | No | When you want to protect your name |
| Apache 2.0 | Permissive | Yes (explicit) | Keep notices, NOTICE file, mark changed files | No | Company-backed projects, patent concerns |
| MPL 2.0 | Weak copyleft (per file) | Yes (explicit) | Keep notices | Modified MPL files only | Mixing open and proprietary files |
| GPL v3 | Strong copyleft | Yes (explicit) | Keep notices | Whole program when distributed | Apps that must stay free software |
| AGPL v3 | Strong copyleft + network | Yes (explicit) | Keep notices | Whole program, also when offered over a network | Server software / SaaS |
| Unlicense | Public domain | No | None | No | Snippets, examples, giving code away |
"No" in the patent column means the license has no explicit patent clause; some lawyers argue MIT and BSD imply one, but it is not written down.
Which License Should I Pick?
- You want the widest possible use: MIT. It is short, well understood and accepted by almost every company.
- Contributors from companies, or patents matter: Apache 2.0. The explicit patent grant is why many corporate projects prefer it.
- Improvements must come back to the community: GPL v3. Anyone distributing a modified version must publish its source.
- It is a web service: AGPL v3, because the GPL does not cover software that is only used over a network.
- A library that companies may embed but whose own files should stay open: MPL 2.0.
- You do not care at all: the Unlicense (or MIT if your company forbids public-domain dedications).
Limitations
- The tool does not check compatibility with your dependencies. You cannot release a project that bundles GPL code under MIT, for example.
- You can only license code you own. Changing the license of a project with outside contributors usually needs their agreement.
- LGPL and Creative Commons licenses are not included; Creative Commons licenses are not designed for software.
- This page is general information, not legal advice.
Tips
- Name the file exactly
LICENSE(orLICENSE.md/COPYING) so GitHub and GitLab detect it. - Mention the license at the end of your README — the README Generator adds a License section and badge for you.
- Keep the year as the first publication year or a range; you do not need to update it every January.
- Starting a new repository? Pair the license with a .gitignore for your stack.
Frequently Asked Questions
Which licenses does the generator support?
MIT, Apache 2.0, GNU GPL v3, GNU AGPL v3, Mozilla Public License 2.0, BSD 2-Clause, BSD 3-Clause, ISC and the Unlicense. Each one is produced as its complete official text, ready to save as a LICENSE file.
What is the difference between MIT and Apache 2.0?
Both are permissive. Apache 2.0 adds an explicit patent license from every contributor, terminates that patent license for anyone who sues over patents in the work, and requires modified files to carry a notice that they were changed.
Should I choose GPL-3.0-only or GPL-3.0-or-later?
"Or later" lets people use your code under future GPL versions published by the Free Software Foundation, which keeps it compatible with projects that move to a newer version. "Only" locks it to version 3. The LICENSE text is the same; only the file header and the SPDX identifier change.
Why isn't my name inside the Apache or GPL LICENSE file?
Those licenses are meant to be distributed unmodified. Your copyright line goes in the short notice at the top of each source file (the 'Source file header' box), and for Apache optionally in a NOTICE file.
What is an SPDX license identifier?
A standard short name such as MIT or GPL-3.0-or-later. Adding a line like SPDX-License-Identifier: MIT to each file and "license": "MIT" to package.json lets scanners and package registries detect your license automatically.
Is anything I type sent to a server?
No. The license texts are bundled with the page and filled in by JavaScript in your browser. Your name and project details are never uploaded.
Is this legal advice?
No. The tool reproduces the official license texts and summarises their main differences. For questions about commercial use, dual licensing or relicensing existing code, consult a lawyer.
Related tools
- Signature GeneratorCreate a handwritten-style signature by drawing or typing your name. Pick pen color and style, then download a transparent PNG or SVG.
- .gitignore GeneratorGenerate .gitignore files for any language or framework. Select from Node, Python, Java, Go, Rust, React, Next.js, and more. Copy or download.
- Chart MakerMake bar, line, pie and doughnut charts from pasted data or CSV. Customize colors, titles and labels, then download a high-resolution PNG.
- Favicon GeneratorGenerate favicons in multiple sizes (16×16, 32×32, 48×48, 64×64, 128×128) from any uploaded image. Download all sizes as individual PNGs.
- README GeneratorGenerate a professional GitHub README.md with sections for description, badges, installation, usage, and contributing. Copy or download as .md.
- SVG Placeholder GeneratorGenerate SVG placeholder images with custom size, background color, text color, and label. Copy as SVG code or data URL.
All Generators tools · Found a bug or a wrong result? Report it.