Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Open Source License Generator

Find the right licence, see what it asks of others, and get every file you need.

Developer No upload Works offline Free, no sign-up

1. Find a licence

Answer what matters to you and leave the rest at “No preference”. Each licence below says why it fits or not. Know your licence already? Go to your details

When someone shares a changed version, must they publish its source code?
Must copies keep your copyright notice?
Do you want an explicit patent licence from contributors?
Must projects under the GPL v2 be able to include your code?
Should the licence protect your name and trademarks?

    More licences

      2. Compare licences

      Choose the licences to show side by side.

      What each chosen licence allows, requires and limits

      Facts come from the licence texts; OSI approval from the SPDX License List (opens in a new tab), free-software status and GPL compatibility from the FSF licence list (opens in a new tab).

      3. Your details

      Common set-ups:

      The year of first publication, then the years of later releases: a list, or a range if every year in it had changes.

      The person or organisation that owns the copyright; for code written at work, often your employer.

      Goes into file headers, not into the licence text.

      Used in the GNU and CC0 file notices.

      File options

      4. Your files

      Loading…

         

        Next steps

        For general information only, not legal advice. Templates are generic starting points — have a qualified lawyer review anything you rely on.

        About the Open Source License Generator

        Choose an open-source licence by answering five plain questions, see side by side what each licence lets people do and what it asks of them, then get the files: the LICENSE text with your name and year in it, a header for your source files, the licence field for package.json and six other package manifests, and a README section. Eighteen licences are built in: MIT, Apache 2.0, the GPL, LGPL and AGPL, MPL 2.0, BSD 2- and 3-Clause, ISC, the Unlicense, CC0, Boost, EPL 2.0, 0BSD, MIT-0 and zlib.

        Every licence text is copied word for word from its steward: gnu.org for the GNU licences, apache.org, mozilla.org, eclipse.org, creativecommons.org, boost.org and unlicense.org; the short licences match the SPDX License List. Only the copyright line is filled in, never a word of the terms. Identifiers follow SPDX, so a GNU licence comes out as GPL-3.0-or-later or GPL-3.0-only rather than the deprecated GPL-3.0.

        How to use it

        1. Under Find a licence, answer the questions that matter to you: whether changes must be shared, whether copies must keep your name, a patent licence, GPL v2 compatibility and protection for your name. Each licence card says point by point why it fits or not.
        2. In Compare licences, pick the licences to see side by side: what they permit, what they require, what they limit, OSI approval, GPL compatibility and the length of each text.
        3. Press Use this licence (or pick one in the list), then enter the year and the copyright holder. For GNU licences choose this version or any later or this version only; tick Offer a second licence for dual licensing such as MIT OR Apache-2.0, or use a common set-up.
        4. Download the licence file, or all files as a ZIP, and put it in the root folder of your repository. Copy the File header to the top of each source file, the Package files field into your manifest and the README section into README.md.

        Examples

        MIT License for a small library
        Input
        Licence: MIT License
        Year: 2026
        Copyright holder: Jane Doe
        Result
        LICENSE
        
        MIT License
        
        Copyright (c) 2026 Jane Doe
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        …
        
        File header (//):
        // SPDX-FileCopyrightText: 2026 Jane Doe
        //
        // SPDX-License-Identifier: MIT
        
        package.json:
        "license": "MIT"
        A Rust crate under MIT OR Apache-2.0
        Input
        Common set-up: Rust crate
        Year: 2024-2026
        Copyright holder: The Lumen developers
        Result
        LICENSE-MIT, LICENSE-APACHE
        
        Cargo.toml:
        [package]
        license = "MIT OR Apache-2.0"
        
        README: "Licensed under either of … at your option."

        The Rust API Guidelines recommend exactly this pair, file names and README text, as the Rust project itself uses.

        An LGPL v3 library
        Input
        Licence: GNU Lesser General Public License v3.0 (or any later version)
        Result
        COPYING         (the GNU GPL v3)
        COPYING.LESSER  (the GNU LGPL v3)
        
        SPDX-License-Identifier: LGPL-3.0-or-later

        The LGPL v3 is a set of extra permissions on top of the GPL v3, so both texts ship together, in the file names the FSF uses.

        Permissive, weak copyleft and strong copyleft

        • Permissive (MIT, Apache 2.0, BSD, ISC, Boost, zlib): anyone may use the code in any product, open or closed, as long as they keep the notices. Apache 2.0 adds an explicit patent licence and asks that changed files say so.
        • Weak copyleft (MPL 2.0, LGPL, EPL 2.0): changes to your code must stay open under the same licence, but it can be combined with closed code: per file for the MPL, per library for the LGPL, per module for the EPL.
        • Strong copyleft (GPL v2 and v3): anyone who distributes a program that includes your code must offer the source of the whole program under the GPL.
        • Network copyleft (AGPL v3): like the GPL v3, plus users of a changed version over a network must be offered its source (section 13).
        • Public domain style (Unlicense, CC0, 0BSD, MIT-0): no conditions at all, not even keeping your name.

        Which files go where

        • LICENSE (or LICENSE.txt or COPYING) in the root folder holds the full licence text; GitHub reads it to label the repository.
        • Two licences: one file each, LICENSE-MIT and LICENSE-APACHE for the usual pair, and the SPDX expression MIT OR Apache-2.0 everywhere else.
        • LGPL v3: COPYING (the GPL v3) and COPYING.LESSER (the LGPL v3).
        • Apache 2.0: the LICENSE file stays exactly as published; your name goes into the notice at the top of each file, and a NOTICE file is optional (section 4(d) asks redistributors to keep its attribution notices).
        • Each source file: an SPDX-License-Identifier line, or the licence’s own notice where it has one (Apache appendix, GNU “How to Apply These Terms”, MPL Exhibit A, Boost and Eclipse templates, the CC0 notice).
        • The REUSE layout puts each licence in LICENSES/<SPDX-ID>.txt and SPDX tags in every file (REUSE specification).

        GPL compatibility in short

        Following the FSF’s licence list: MIT, BSD, ISC, zlib, Boost, 0BSD, MIT-0, the Unlicense, CC0, the LGPL v2.1 and MPL 2.0 can be used in projects under the GPL v2 and v3. Apache 2.0, the LGPL v3 and the GPL v3 work with the GPL v3 but not with GPL-2.0-only code; GPL-2.0-or-later code can move to the GPL v3. The AGPL v3 and GPL v3 may be combined through section 13 of each. EPL 2.0 code needs a named Secondary License to mix with the GPL, and MPL 2.0 code loses its GPL compatibility when it is marked “Incompatible With Secondary Licenses”.

        Where the texts and facts come from

        Licence texts: GNU licences, Apache License 2.0, MPL 2.0, EPL 2.0, CC0 1.0, Boost Software License, the Unlicense, and for MIT, BSD, ISC, 0BSD, MIT-0 and zlib the SPDX License List and choosealicense.com. OSI approval: SPDX License List and opensource.org. GPL compatibility and free-software status: FSF licence list. File notices: Apache’s guidance, Mozilla’s headers, the Eclipse project handbook, the Boost licence FAQ and the CC0 FAQ. Manifest fields: the documentation of npm, Python packaging, Cargo, Composer, NuGet, RubyGems and Maven.

        Limitations

        • Eighteen widely used licences are built in. For others, such as the EUPL 1.2, Artistic 2.0, the SIL Open Font License or the Creative Commons licences for documentation and media, take the official text from the SPDX License List.
        • The chooser and the comparison summarise the licence texts; they do not cover every clause (for example the GPL v3’s installation-information rules or the details of Apache 2.0’s patent termination). Read the full text of the licence you choose.
        • Name the real copyright holder: code written for an employer often belongs to the employer, as the Eclipse project handbook points out about employment contracts.
        • EPL 2.0 Secondary Licenses (Exhibit A) are not filled in for you; add that notice by hand if you need one.
        • GitHub may not recognise a LICENSE file that holds two licences, so two licences get one file each by default (GitHub’s documentation).

        Privacy

        Everything happens in your browser: the licence texts are part of this site and the files are put together on your device, so nothing you type is sent anywhere. Your name, project details and choices are remembered in this browser only, for your next visit; Reset clears them.

        Frequently asked questions

        Which open-source licence should I choose?

        It depends on what you want people to do with changed versions. If anyone may use your code anywhere, closed products included, a permissive licence fits: MIT is a few short paragraphs, and Apache 2.0 adds an explicit patent licence. If changed versions must stay open, a copyleft licence fits: MPL 2.0 per file, the LGPL for a library, the GPL for a whole program and the AGPL when it runs as a network service. Answer the questions on this page and each licence shows why it fits or not.

        What happens if I publish code without a licence?

        Then normal copyright applies. As GitHub’s documentation puts it, you keep all rights and nobody may reproduce, distribute or create derivative works from your code, even if they can read it. A licence file is what gives people permission.

        What is the difference between GPL-3.0-only and GPL-3.0-or-later?

        With or later, people may follow version 3 or any later version of the GPL that the Free Software Foundation publishes; the FSF’s own notice template uses this wording (“or (at your option) any later version”). With only, version 3 applies and nothing else. The SPDX License List deprecated the plain GPL-3.0 identifier because it does not say which one you mean.

        Which year goes in the copyright line?

        The year the work was first published, plus later years in which you changed it. The FSF’s guidance asks for the year each release was finished, and allows a range of years only if every year in it had copyrightable changes and your documentation says that you use ranges; otherwise list the years separated by commas. Write the word “Copyright”: the © sign is optional, and “(c)” has no legal significance but does no harm.

        Do I put my name into the GPL or Apache LICENSE file?

        No. Those files stay word for word; Apache asks you to copy LICENSE-2.0.txt into a file called LICENSE. Your copyright line goes into the notice at the top of each source file and into the README, which this page fills in for you. Only licences whose text starts with a copyright line, such as MIT, BSD, ISC and zlib, carry your name in the LICENSE file itself.

        How does dual licensing such as MIT OR Apache-2.0 work?

        People who use your code may pick either licence. You ship both texts (usually LICENSE-MIT and LICENSE-APACHE) and write the SPDX expression MIT OR Apache-2.0 in your manifest and file headers. It is the convention the Rust API Guidelines recommend for crates.

        What is an SPDX licence identifier and where does it go?

        A short, standard name for a licence from the SPDX License List, such as MIT, Apache-2.0 or GPL-3.0-or-later. Put it in a comment at the top of each source file (SPDX-License-Identifier: MIT) and in the licence field of your package manifest; tools such as npm, Cargo and NuGet read it. The REUSE specification adds an SPDX-FileCopyrightText line for the copyright holder.

        Is CC0 or the Unlicense a good choice for code?

        Both give up all conditions. CC0 is not OSI-approved and says outright that it does not license patents; the CC0 FAQ suggests an OSI-approved licence such as Apache 2.0 or GPL 3.0 when that matters, and the FSF counts CC0 as GPL-compatible but does not recommend it for software for the same reason. 0BSD and MIT-0 are OSI-approved licences with no conditions at all, if you want the same freedom in the form of an ordinary licence.

        Which licence do WordPress plugins need?

        A GPL-compatible one: the WordPress.org plugin guidelines accept any GPL-compatible licence and strongly recommend WordPress’s own “GPLv2 or later”, which the WordPress plugin set-up on this page selects.

        Why does GitHub not show my licence?

        GitHub compares the LICENSE file in the root of the repository with known licence texts (it uses the Licensee library). An edited text, or several licences in one file, can stop the match, so keep the text unchanged and give each licence its own file.

        Is anything uploaded?

        No. The licence texts are part of this site and the files are put together in your browser; your name and project details stay on your device, where this page remembers them for your next visit.

        Quick answers and tool search

        Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.