License File Generator

Pick the right open source license with a guided chooser, generate the full LICENSE file with your name and year, get the SPDX identifier and a per-file comment header. Ten licenses including MIT, Apache 2.0, GPL, AGPL, LGPL, BSD, ISC, MPL 2.0 and Unlicense. Free, private and no sign-up.

License File Generator by Utiliby

Free License File Generator

Choose a license, generate the full text, copy the SPDX identifier and the per-file header. Everything runs in your browser.

Question 1 of 4

Share, cite or embed this tool

What is a free license file generator online?

A free license file generator online is a tool that produces the complete, correctly formatted text of an open source license with your name and year already filled in, ready to save as a LICENSE file in the root of your repository. Without a license file, published source code is legally "all rights reserved" — anyone can read it, but nobody has the right to use, copy, modify or distribute it, even though GitHub shows the code publicly[reference:0]. Adding a LICENSE file transforms your code from visible-but-restricted into genuinely open and reusable.

This license file generator goes beyond a simple text filler. It combines four tools in one page: a guided chooser that walks you through four plain-English questions to recommend a license, a generator that outputs the full license text with SPDX identifiers and optional per-file comment headers, a permissions and limitations matrix comparing ten licenses side by side, and a comprehensive guide to open source licensing. Everything runs in your browser — no sign-up, no account, no upload, no tracking.

How to use this free license generator online

  1. License Picker tab. Answer up to four questions about copyleft, patents and commercial use. The tool recommends the most suitable license with a plain-English explanation.
  2. Generate LICENSE tab. Enter your name or organisation, the year, and optionally a project name. Select a license from the grid. Click Generate to see the full license text, the SPDX identifier, and — if you chose a comment style — a ready-to-paste header block for your source files.
  3. Compare Licenses tab. View the permissions, requirements and limitations of every license in a single matrix. Useful when you are deciding between two similar options.
  4. Guide tab. Read the fuller explanation of permissive vs copyleft, SPDX identifiers, header styles and the common mistakes to avoid.

The ten licenses covered

These are the ten OSI-approved licenses that account for the overwhelming majority of open source projects. Each entry shows the SPDX identifier, a one-line summary and quick permission badges.

LicenseSPDX IDFamilyOne-line summary
MITMITPermissiveDo almost anything, keep the copyright notice. The most popular license on GitHub.
Apache 2.0Apache-2.0Permissive + patentLike MIT but with an explicit patent grant and a requirement to state changes.
BSD 2-ClauseBSD-2-ClausePermissiveFunctionally equivalent to MIT with a slightly different warranty clause.
BSD 3-ClauseBSD-3-ClausePermissiveBSD 2-Clause plus a non-endorsement clause protecting the project name.
ISCISCPermissiveEven shorter than MIT. Used by npm, OpenBSD and many JavaScript packages.
MPL 2.0MPL-2.0Weak copyleftFile-level copyleft: modified MPL files stay MPL, your other files are unaffected.
LGPL 3.0LGPL-3.0-onlyWeak copyleftDesigned for libraries: proprietary code can link against LGPL libraries.
GPL 3.0GPL-3.0-onlyStrong copyleftDerivative works must be distributed under GPL. Source must be provided.
AGPL 3.0AGPL-3.0-onlyNetwork copyleftLike GPL, but the obligation triggers when the software is provided as a network service.
UnlicenseUnlicensePublic domainDedicates the work to the public domain. No conditions at all.

Permissive vs copyleft: the one distinction that matters

Every open source license grants the right to use, modify and distribute the software. What separates them is the conditions attached — and the single most important condition is whether the license is permissive or copyleft[reference:1].

Permissive licenses — MIT, Apache 2.0, BSD, ISC — ask very little. You can use the code however you like, including inside closed-source commercial products, as long as you preserve the copyright notice and license text. They do not require you to share your own changes. Among permissive licenses, the practical ranking for commercial use is Apache 2.0 (permissive plus patent protection), then MIT and BSD (permissive, no patent language)[reference:2].

Copyleft licenses — GPL, AGPL, LGPL, MPL — require that derivative works be distributed under the same license. In practice this means sharing your source code under those terms. Copyleft comes in strengths: strong (GPL, affects the whole combined work), weak (LGPL and MPL, affects only the licensed component or file) and network (AGPL, triggers even when the software is provided as a service without distributing it)[reference:3].

Which family a component belongs to matters far more than the specific license name. If you are building a proprietary product, permissive dependencies are usually safe; copyleft dependencies need review.

SPDX identifiers and why they matter

SPDX (Software Package Data Exchange) is an open standard maintained by the Linux Foundation for communicating software bill of materials information[reference:4]. Every SPDX-recognised license has a short, unambiguous identifier — MIT, Apache-2.0, GPL-3.0-only, BSD-3-Clause. Using the correct SPDX identifier in your package manifest and in source file headers lets automated license scanners, SBOM tools and compliance pipelines identify your license without guessing.

SPDX also distinguishes between "only" and "or-later" versions. GPL-3.0-only means exactly version 3; GPL-3.0-or-later means version 3 or any later version published by the FSF. The choice matters for compatibility and is recorded in the header. This generator uses the "only" form by default because it is the more conservative option.

Do you need a license header in every file?

Modern practice has moved away from long per-file headers. The three common approaches are:

All three are valid. Pick by context. This generator supports the first two: choose a comment style and it will produce a header block you can paste at the top of your files, with the correct comment syntax for C-style languages, hash-comment languages, HTML, SQL and others.

How to add a LICENSE file to GitHub

Adding a license to a GitHub repository takes under a minute:

  1. Navigate to the main page of the repository.
  2. Above the file list, click the Add file dropdown, then Create new file[reference:5].
  3. In the file name field, type LICENSE or LICENSE.md — all capitals, no other punctuation[reference:6].
  4. Paste the full text of the license into the editor.
  5. Commit the file. GitHub will detect the license and display it at the top of the repository page.

GitHub also offers a "Choose a license template" button that appears when you name the file LICENSE. You can use that instead of pasting, but the template picker does not let you pre-fill your name and year, which is why a generator is faster for the common case.

Common licensing mistakes

Frequently asked questions

What is a free license file generator online?

A free license file generator online produces the complete text of an open source license with your name and year pre-filled, ready to save as a LICENSE file. This tool adds a guided chooser, SPDX identifiers, comment headers and a permissions matrix.

Which open source license should I choose?

Choose MIT for maximum simplicity and adoption. Choose Apache 2.0 if you also want an explicit patent grant. Choose GPL-3.0 if you want derivatives to stay open. Choose AGPL-3.0 for network services. Choose LGPL-3.0 for libraries linked by proprietary software. Choose MPL-2.0 for file-level copyleft.

What is an SPDX identifier?

SPDX is an open standard for software bill of materials information. Each SPDX-recognised license has a short identifier such as MIT, Apache-2.0 or GPL-3.0-only. Using the correct identifier lets automated tools identify your license without ambiguity.

What file name should the license file use?

Name the file LICENSE (all caps, no extension) in the repository root. GitHub, GitLab and npm auto-detect LICENSE, LICENSE.md and LICENSE.txt. The Unlicense is conventionally saved as UNLICENSE.

What is the difference between permissive and copyleft licenses?

Permissive licenses (MIT, Apache 2.0, BSD, ISC) allow use in closed-source commercial products if the copyright notice is preserved. Copyleft licenses (GPL, AGPL, LGPL) require derivative works to be distributed under the same license, meaning source code must be shared.

Do I need a license header in every source file?

No. Modern practice keeps the full text in a single LICENSE file and either omits per-file headers or uses a short SPDX one-liner such as // SPDX-License-Identifier: MIT. Full traditional headers are still common in C, C++ and Java codebases.

Can I change the license of my project later?

You can change the license for future versions if you are the sole copyright holder. If others have contributed, you need their permission to relicense their contributions. Dual licensing is another option.

What happens if I publish code without a license?

Default copyright law applies. Others have no legal right to use, copy, modify or distribute your code, even though they can see it. GitHub displays "No license" on the repository page.

Does this tool give legal advice?

No. This tool generates the standard, unmodified text of well-known licenses with your name and year filled in. It does not analyse your project or your dependencies and does not constitute legal advice. For commercial or patent-sensitive projects, consult a qualified attorney.

Is this license file generator free?

Yes. Free, browser-based, no sign-up, no tracking, no ads.

Disclaimer: This tool is provided for development and educational purposes only. It generates the standard, unmodified text of well-known open source licenses with the copyright holder and year you provide. It does not analyse your project, your dependencies or your business model, and it does not constitute legal advice. License compatibility, patent implications and relicensing questions are fact-specific and should be reviewed by a qualified attorney for commercial or patent-sensitive projects. Always verify that the generated text matches the canonical license published by the OSI, the SPDX License List, or the license steward (Apache Software Foundation, Free Software Foundation, Mozilla Foundation, etc.). Utiliby accepts no liability for licensing decisions made using this tool.