Open Source License Generator (LICENSE File with SPDX ID)
Generate the text of a license such as MIT, Apache-2.0, BSD, ISC or the Unlicense with your name and year filled in. Copy it or download it as a LICENSE file, and get the SPDX identifier for package.json and a source file header. Everything runs in your browser, and nothing you enter is sent to a server. Publishing a website? The robots.txt Generator may help too.
🔒 Runs in your browser · Your data is never sent to a server
Use a form like "2026" or "2020-2026". The text is still generated as typed.
SPDX identifier:
The official text is output unchanged except for the copyright line, which uses your input.
This license is too long to include in full, so the output is the notice to put at the top of each source file. Add the official full text as your LICENSE file.
Related snippets
License comparison
| License | SPDX ID | Commercial use | Modification | Redistribution | Patent clause | Copyleft |
|---|---|---|---|---|---|---|
| MIT License | MIT | Yes | Yes | Yes | Not explicit | None |
| ISC License | ISC | Yes | Yes | Yes | Not explicit | None |
| BSD 2-Clause License | BSD-2-Clause | Yes | Yes | Yes | Not explicit | None |
| BSD 3-Clause License | BSD-3-Clause | Yes | Yes | Yes | Not explicit | None |
| BSD Zero Clause License | 0BSD | Yes | Yes | Yes | Not explicit | None |
| The Unlicense | Unlicense | Yes | Yes | Yes | Not explicit | None |
| Apache License 2.0 | Apache-2.0 | Yes | Yes | Yes | Yes | None |
| Mozilla Public License 2.0 | MPL-2.0 | Yes | Yes | Yes | Yes | Weak |
| GNU Lesser General Public License v3.0 | LGPL-3.0-or-later | Yes | Yes | Yes | Yes | Weak |
| GNU General Public License v3.0 | GPL-3.0-or-later | Yes | Yes | Yes | Yes | Strong |
This is a general overview, not legal advice. Notice and source-disclosure duties differ by license text.
How to use
- Pick a "License". The comparison table shows commercial use, patent terms and more.
- Enter the "Copyright holder" and the "Year". The year defaults to the current year.
- Click "Copy" or "Download" to take the generated text.
- Save it as LICENSE at the project root, and add the SPDX identifier to package.json if needed.
Notes
- The license texts are transcribed from the official versions, but whitespace and line breaks can differ between sources. For important projects, compare with the official full text.
- GPL-3.0, LGPL-3.0 and MPL-2.0 are long, so the full texts are not included. The output is the notice for source file headers; use the full text from the official site as your LICENSE.
- The comparison table is a general overview, not legal advice. Consult a professional when choosing a license or judging compatibility.
- If your project includes other people's code, that code's license terms still apply.
- Nothing you enter is stored or sent.
Glossary
SPDX identifier
A standard short, machine-readable name for a license (for example MIT or Apache-2.0), used in the license field of package.json and in source comments.
Copyleft
A mechanism that requires derived works to be shared under the same license terms. The GPL is strong copyleft; the MPL and LGPL are weak copyleft with a narrower scope.
Permissive license
A family of licenses such as MIT, BSD, ISC and Apache-2.0 whose main conditions are keeping the copyright notice and disclaimer, otherwise allowing broad reuse.
FAQ
Should I choose MIT or Apache-2.0?
Both allow commercial use and modification. MIT is short and simple; Apache-2.0 adds an explicit patent grant and conditions such as stating changes. Many pick Apache-2.0 when patent clarity matters and MIT when simplicity matters most. Check the choice against your own goals.
What should I put for the copyright holder and year?
Use your name, handle or organization as the holder. The year is usually the first year of publication, and a range such as "2020-2026" is also common. The tool starts with the current year, so change it to the year you first published if needed.
Why is there no full text for GPL-3.0 or MPL-2.0?
These texts are very long, and a transcription error would defeat the purpose, so the full texts are not included. The tool outputs the notice for source file headers instead. Save the official full text as your LICENSE file.
Where do I use the SPDX identifier?
In the license field of package.json, in a SPDX-License-Identifier comment at the top of source files, and by license-checking tools that scan dependencies. The tool outputs the identifier of the chosen license in a ready-to-paste form.
Share this page
