Your repo needs a LICENSE file. Here’s the fast way.
You pushed the project to GitHub, the README looks decent, and then it hits you: there’s no license. Without one, technically nobody can legally use your code. Not the way you’d hope, anyway. The default in most countries is “all rights reserved,” which is the opposite of what most people putting code on GitHub actually want.
Pick a license from the dropdown. Type your name and the year. The full, legally complete text shows up on the right with the placeholders already swapped in. Copy it, or download a file literally named LICENSE, and you’re done.
Eight licenses, and which one fits
The big three you’ll reach for most:
- MIT is the crowd favorite. Six short paragraphs, permissive, easy to read. React, jQuery, Rails, and roughly a third of all GitHub projects use it.
- Apache-2.0 is MIT with a real patent grant baked in. If your code touches anything patent-adjacent, or you just want that extra protection, this is the safer call. Kubernetes and Android lean on it.
- GPL-3.0 is strong copyleft. Anyone who distributes a modified version has to release their source under the GPL too. Pick it when you want derivatives to stay open, period.
Then the rest: BSD-2-Clause and BSD-3-Clause (permissive, the 3-clause adds a no-endorsement rule), ISC (npm’s default, basically MIT with fewer words), MPL-2.0 (file-level copyleft, a middle ground), and The Unlicense if you want to throw the code into the public domain and walk away.
Not sure? MIT for almost anything small. Apache-2.0 if patents worry you. GPL if you care about keeping forks open.
A couple of things worth knowing
The author and year fields only matter for licenses that actually use them. MIT, Apache, BSD, and ISC stamp a copyright line with your name. GPL-3.0 puts it in the notice for your source files instead, since the license text itself can’t be edited. The Unlicense and MPL-2.0 don’t use them at all, so those fields gray out automatically.
GPL-3.0 and MPL-2.0 deserve a flag. Both must be shipped word for word, so the LICENSE you get is the complete official text, about 5,600 words for the GPL and 2,400 for the MPL, untouched. Each also wants a short notice at the top of every source file. That notice gets its own box under the license: for the GPL it carries your name, the year and, if you type one, the program’s name and purpose; for the MPL it’s the standard three-line header.
Nothing you type gets sent anywhere. Type a name, watch it appear. That’s the whole loop.
One naming tip: call the file LICENSE with no extension. GitHub and GitLab both detect that automatically and show a tidy license badge on your repo page. LICENSE.txt works too, but the plain version is the convention.
FAQ
Which license should I actually pick?
For most personal and small open-source projects, MIT. It’s short, permissive, and universally understood. Go Apache-2.0 if you want patent protection, or GPL-3.0 if you want to force derivatives to stay open source.
Is the generated text legally valid?
Yep. These are the canonical texts from the license authors (OSI, the FSF, Mozilla). For the short licenses only the year and name are filled in; GPL-3.0 and MPL-2.0 come out exactly as published, with your details going into the per-file notice.
Why are the name and year boxes sometimes disabled?
Because that license doesn’t use them. The Unlicense and MPL-2.0 have no copyright placeholder, so the fields switch off to keep you from typing into a void.
Does the GPL output include the entire license?
Yes. The LICENSE file is the complete GPL-3.0 text as the FSF publishes it, How to Apply section included. The short notice for your source files sits in a separate box, filled in with your name and year.
Can I change my license later?
You can, for future versions. Code already released under the old license stays available under it forever, since you can’t retroactively revoke what people already received. Pick something you’re comfortable with up front.