Which license should I pick for my first open source project?
For most first projects, pick MIT if you want the shortest permissive license, Apache 2.0 if you also want an explicit patent grant, and GPLv3 if you want improvements shared back. If your project joins an existing ecosystem, copy that ecosystem's license. Do not publish with no license at all.
Cite
GitShowcase Forum, "Which license should I pick for my first open source project?", https://gitshowcase.com/forum/discuss/which-license-should-i-pick-for-my-first-open-source-project/, accessed 2026-11-18.- Nils HaugenStaffAPIs and tooling editor: LLM, MCP, payments and portfolios ·
This is general information about how common licenses work, not legal advice. For a company project, a dual licensing plan or anything with money at stake, ask a lawyer.
Start with the default: no license means no permission
Many first time maintainers skip the license because they "just want people to use it." That backfires. According to Choose a License on no license, creative work, code included, is under exclusive copyright by default, and unless you include a license that says otherwise, nobody else can copy, distribute or modify it without risk. Public hosting terms let people view and fork your repository, but that is not enough for the experimenting, modifying and sharing that people usually expect from a public repo.
So a license file is what turns "visible code" into "code others can use". It is also why companies and careful developers will not touch an unlicensed dependency.
The decision rule
Ask two questions:
- Do you mind if someone takes your code into a closed source product? If you do not mind, pick a permissive license. If you want improvements to come back, pick a copyleft license (one that requires derived work to stay open under the same terms).
- Does your project depend on, or plug into, a community with a strong default? If yes, follow it. The Choose a License front page puts this first: use the license preferred by the community you are contributing to or depending on, and your project will fit right in.
The three common options
License In one line Conditions Good fit MIT Short, permissive, lets people do almost anything, including closed source versions Keep the license and copyright notice Libraries, CLIs, templates, portfolio projects Apache 2.0 Permissive, with an express patent grant from contributors Keep notices, state changes Projects where patents or company adoption matter GPLv3 Strong copyleft: people may use and change it, but distributed versions must share source Disclose source, same license, keep notices, state changes Tools where you want improvements shared back The permissions and conditions above come from the Apache 2.0 and GPLv3 pages on Choose a License, and the MIT summary from the home page. The Apache and GPL pages both list commercial use as permitted and list liability and warranty as limitations, meaning you are not on the hook for how others use the code. Apache 2.0 additionally says it does not grant trademark use, so your project name stays yours.
What each one means in practice
- MIT. Someone can bundle your library inside a paid closed source app and owe you only the copyright notice. That is the trade for maximum adoption.
- Apache 2.0. Same freedom, plus an explicit patent license from each contributor. The text also says that if someone sues over patents claiming the work infringes, their patent licenses under it end. It requires modified files to carry notices that they were changed.
- GPLv3. If someone distributes a modified version, the whole work must stay under GPL with source available. That discourages closed forks but can also stop some companies from using your code at all. If you want a library that proprietary apps can link to, the GPL text itself points to the GNU Lesser General Public License for that case.
Step by step: add the license correctly
- Create a file named
LICENSEin the repository root. Choose a License says to copy the license text there (GPL projects traditionally useCOPYING). - Replace placeholders like the year and your name, where the license has them.
- Add the SPDX identifier to your package metadata so registries display it. For example in
package.json:
{ "name": "my-first-project", "version": "0.1.0", "license": "MIT" }Use
Apache-2.0for Apache. For GPL, the site suggestsGPL-3.0-or-later, orGPL-3.0-onlyto disallow future versions.- Mention the license in your README, ideally with a one line section at the bottom. See how to write a README people will try for where it fits.
Mistakes to avoid
- Mixing license text. Paste one full license, not a summary.
- Changing the license later without asking contributors. Once the work has other contributors, each is a copyright holder, as the Choose a License no license page points out, so relicensing gets hard. Decide before you accept outside code.
- Picking a license for a dependency's sake only. Check what your dependencies require before you decide. A GPL dependency can shape what you are allowed to ship.
- Using a made up license. Custom terms scare off adopters and are easy to get wrong.
If you genuinely want no restrictions at all, the site points to a public domain dedication instead of no license, since opting out of licenses does not opt you out of copyright.
Write something first.
Give people something to work with: at least 30 words on what happened and what you tried.
That is too long. Keep it under 6,000 characters.
Write the question as the title, 15 to 140 characters, no links.
Pick a category.
Add a name (2 to 40 characters, no links).
That email address does not look right.
That was quick. Read the thread, then try again.
The form expired. Reload the page and post again.
Something went wrong with the form. Reload and try again.
Please complete the check and post again.
Limit reached for now. Try again later.
This thread is closed to new replies.
This thread no longer accepts replies.
Something went wrong with the form. Reload and try again.
Post a reply or question first (name and email), then this browser can vote, edit and accept answers.
You cannot vote on your own post.
Only the author (within 30 days) or the forum team can do that.
That email already has an account. Use your sign-in link instead.
New accounts are paused for the moment. Try again later.
That was already posted.