Open Source License Generator

Pick an open source licence such as MIT, Apache 2.0 or GPL, compare what each allows, and get the full LICENSE text with your name.

Runs in your browser. Nothing is uploaded.

Not sure which to pick? Answer three questions
If someone changes your code and shares it, must they share their changes?

Licence

    Compare the licences

    LicenceTypeMust share sourcePatent grantKeep noticeMark changes
    MIT LicensePermissiveNoNoYesNo
    Apache License 2.0PermissiveNoYesYesYes
    BSD 3-Clause LicensePermissiveNoNoYesNo
    BSD 2-Clause LicensePermissiveNoNoYesNo
    ISC LicensePermissiveNoNoYesNo
    Boost Software License 1.0PermissiveNoNoYesNo
    Mozilla Public License 2.0Weak copyleftChanged filesYesYesNo
    GNU LGPL v3Weak copyleftChanges to the libraryYesYesYes
    GNU GPL v3CopyleftWhole programYesYesYes
    GNU AGPL v3Network copyleftWhole program, also for online useYesYesYes
    The UnlicensePublic domainNoNoNoNo
    Creative Commons Zero (CC0)Public domainNoNoNoNo

    How to use the Open Source License Generator

    1. Choose a licence, or open Not sure which to pick? and answer three questions to get a suggestion.
    2. Enter the copyright holder (your name or organisation) and the year.
    3. Download the LICENSE file and add it to the root of your repository.
    4. Optionally copy the source file header into the top of each source file, and compare the licences in the table below.

    Give your project a licence

    A licence tells people what they may do with your code: use it, change it, share it, sell products built on it. Without one, the default is “all rights reserved”, which means others can’t safely use your work even if it is public. Adding a LICENSE file to the root of your repository is the simplest way to fix that, and hosting sites like GitHub detect it automatically.

    The main choices

    • Permissive licences (MIT, BSD, ISC, Apache 2.0, Boost) let anyone use your code in any project, including closed-source products, as long as they keep the notice. Apache 2.0 adds an explicit patent licence and asks people to mark files they changed.
    • Weak copyleft licences (MPL 2.0, LGPL v3) require changes to your files or library to stay open, but allow them to be combined with code under other licences.
    • Copyleft (GPL v3) requires anyone who distributes the program, or a version of it, to share the complete source under the same licence. AGPL v3 extends that to people who run a modified version as an online service.
    • Public domain dedications (Unlicense, CC0) give up your rights as far as the law allows.

    The comparison table sets out the differences side by side: whether source must be shared, whether there is a patent grant, and whether notices must be kept and changes marked.

    Fill in your details

    For MIT, BSD and ISC, the copyright line inside the licence gets your name and year. The other licences must be used word for word, so the tool also gives you a short header with an SPDX-License-Identifier line. Putting it at the top of each source file makes the licence clear even when a file is copied on its own, and tools that scan dependencies read it automatically.

    Private

    The licence texts are part of this page and load only when you choose one; nothing you type is sent anywhere. For the rest of your repository, try the README Generator and the .gitignore Generator.

    Frequently asked questions

    Which licence should I choose?

    If you want as many people as possible to use your code with few strings attached, choose MIT. If patents matter, for example in a company project, choose Apache 2.0. If you want improvements to stay open, choose the GPL, or the AGPL for software run as a web service.

    What happens if my project has no licence?

    By default, copyright law reserves all rights to you. Even if your code is public on GitHub, others may look at it but have no clear permission to use, change or share it. Adding a licence makes your intentions clear.

    Can I change the licence later?

    You can release new versions under a new licence if you own all the copyright. Copies already released keep their original licence. Once others have contributed, you usually need their agreement.

    Are the licence texts complete and unchanged?

    Yes. They are the official texts from the SPDX license list. For MIT, BSD and ISC only the copyright line is filled in; the others are used word for word as their authors require.

    Is this legal advice?

    No. It is a quick way to get the standard text and see the main differences. For commercial or unusual situations, ask a lawyer.

    Tutorials