Skip to content

Open Source License Generator

Pick MIT, Apache 2.0, GPL v3, BSD, ISC, MPL 2.0, Unlicense or CC0. Get the full LICENSE file to copy or download.

A short permissive license. Anyone can use, change and sell the code as long as the copyright notice and license text stay with it.

No name entered. The LICENSE file shows [copyright holder] until you add one.

4 digits, or a range like 2019-2026.

LICENSE · MIT · 21 lines
MIT License

Copyright (c) [year] [copyright holder]

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.

Standard text; compare with spdx.org/licenses/MIT.html. This tool reproduces license texts and is not legal advice.

01 · Definition

What is an open source license?

An open source license is the text that tells other people what they may do with your code: use it, change it and redistribute it, and on what conditions. Without one, the code is under exclusive copyright by default and nobody else has permission to reuse it. The license normally sits in a file named LICENSE at the repository root.

02 · Overview

How the Open Source License Generator works

Generate a LICENSE file for an open-source project. MIT, BSD 2-Clause, BSD 3-Clause and ISC are filled in with your name and year. Apache 2.0, GPL v3, MPL 2.0 and CC0 are the full texts as published by Apache, the FSF, Mozilla and Creative Commons, unedited, with the source-file notice each license recommends shown separately. The file downloads as LICENSE with no extension. This tool reproduces license texts and is not legal advice.

03 · Guide

Open source licenses compared

All nine licenses here allow commercial use, modification, distribution and private use, and all disclaim warranty and liability. They differ in what they require in return and in whether they grant patent rights. The conditions and patent columns summarise the license metadata published by choosealicense.com; the line counts are of the LICENSE files this tool produces.

BSD 3-Clause adds a clause that the authors' names may not be used to endorse derived products. This is a summary for orientation, not legal advice: read the license text before relying on it.

LicenseConditionsPatent grantLines
MITKeep the copyright and license noticeNot mentioned21
ISCKeep the copyright and license noticeNot mentioned15
BSD 2-ClauseKeep the copyright and license noticeNot mentioned24
BSD 3-ClauseKeep the copyright and license noticeNot mentioned28
Apache 2.0Keep notices; state changesYes202
MPL 2.0Keep notices; disclose source; same license for modified filesYes373
GPL v3Keep notices; state changes; disclose source; same licenseYes674
UnlicenseNoneNot mentioned24
CC0 1.0NoneExpressly not granted121
Conditions, patent grant and length of each license

04 · Use cases

When to use the Open Source License Generator

  1. 01

    Add a LICENSE file to a new repository

  2. 02

    Get the full Apache 2.0 or GPL v3 text without copying it from a web page

  3. 03

    Get the per-file header notice for Apache 2.0, GPL v3 or MPL 2.0 with your name and year filled in

  4. 04

    Compare what MIT, Apache 2.0 and GPL v3 each require before choosing

05 · Examples

Open Source License Generator examples

MIT, Jane Doe, 2026

ex 01

MIT License Copyright (c) 2026 Jane Doe Permission is hereby granted, free of charge, to any person obtaining a copy…

The file is 21 lines. The name and year go into the copyright line; the rest is fixed.

Apache-2.0, Acme Corp, 2026

ex 02

LICENSE: the 202-line Apache License, Version 2.0, unchanged. Source-file notice: Copyright 2026 Acme Corp Licensed under the Apache License, Version 2.0 (the "License")…

The license text has no name or year in it. They go in the notice the appendix tells you to add to each file.

GPL-3.0, Jane Doe, 2026

ex 03

LICENSE: the 674-line GNU General Public License version 3, unchanged. Source-file notice: Copyright (C) 2026 Jane Doe This program is free software: you can redistribute it and/or modify…

The notice uses the "version 3 or any later version" wording from the license's own instructions.

CC0-1.0

ex 04

Creative Commons Legal Code CC0 1.0 Universal …Statement of Purpose…

The file is 121 lines and has no fields to fill in. It is a public-domain dedication with a fallback license.

06 · FAQ

License: frequently asked questions

MIT or Apache 2.0?

Both are permissive. MIT is about 170 words. Apache 2.0 is about 1,600 words and adds two things MIT lacks: an explicit patent license from each contributor (section 3) and a requirement that modified files carry a notice saying they were changed (section 4). Pick Apache 2.0 if patents matter to you or your users; pick MIT if you want the shortest text people already know.

Is the Apache, GPL or MPL text here complete?

Yes. The Apache 2.0, GPL v3, MPL 2.0 and CC0 files are the full texts published at apache.org, gnu.org, mozilla.org and creativecommons.org, and the tool does not edit them. That is also why your name and year do not appear in those files: the licenses themselves contain no copyright line for you to fill in. Your notice goes at the top of each source file instead, and the tool shows that notice separately.

What's the difference between BSD-2 and BSD-3?

BSD 3-Clause adds one condition: the names of the copyright holder and contributors may not be used to endorse or promote derived products without written permission. BSD 2-Clause is otherwise the same text.

When should I pick GPL?

GPL v3 is copyleft: anyone who distributes your code or a modified version must make the source available under the GPL too. Pick it when you want distributed forks to stay open. It is a poor fit if you want the code used inside closed-source products.

Is Unlicense the same as CC0?

Both aim to put a work in the public domain and both include a fallback license for places where that is not possible. The Unlicense is 24 lines and written for software. CC0 is 121 lines, written by Creative Commons for any kind of work, and states explicitly that it does not license patents or trademarks.

Where does the file go and what should it be called?

Name it LICENSE and put it in the repository root, with no file extension. GitHub, npm and pkg.go.dev look for that name and show the detected license in their UI. LICENSE.md and LICENSE.txt are also recognised by GitHub. The Download button here saves the file as LICENSE.

Do I need a license header in every source file?

MIT, BSD and ISC do not ask for one. The Apache 2.0 appendix and the GPL v3 instructions both recommend a notice at the top of each file, and MPL 2.0 asks for its Exhibit A notice where practical. The tool shows the notice for those three licenses with a separate Copy button. Also set the SPDX identifier in your package metadata, since that is what dependency scanners read.

Is this legal advice?

No. The tool reproduces standard license texts and summarises them in a sentence. It cannot tell you which license suits your project, your employer's policies or your dependencies. If the choice has commercial consequences, ask a lawyer.

07 · Reference

Specs and further reading

These are the primary sources this tool follows. Where a specification defines the behaviour, we link the specification, not a summary of it.

  • SPDX License List

    Linux Foundation. The identifiers used in package metadata, with the reference text of each license. The MIT, BSD and ISC templates here follow these texts.

  • Apache License, Version 2.0

    Apache Software Foundation. The published text that the Apache 2.0 output reproduces byte for byte.

  • GNU General Public License v3.0

    Free Software Foundation. The published text that the GPL v3 output reproduces byte for byte.

  • Mozilla Public License 2.0

    Mozilla. The published text that the MPL 2.0 output reproduces byte for byte.

  • CC0 1.0 Universal legal code

    Creative Commons. The published text that the CC0 output reproduces byte for byte.

  • OSI Approved Licenses

    Open Source Initiative. Which licenses meet the Open Source Definition. CC0 is not on this list.

  • Choose an open source license

    GitHub. A plain-language comparison of the permissions and conditions of each license, and the source of the conditions and patent columns in the comparison table. Its No License page explains that unlicensed code is under exclusive copyright by default.

08 · More

Tools that pair with License

Last updated .