Last updated
Generating an MIT License
The MIT License is the most popular open source license. Enter your name and year, and the generator produces the complete license text:
Settings:
License: MIT
Copyright holder: Alice Johnson
Year: 2024
Generated LICENSE file:
─────────────────────────────────────────
MIT License
Copyright (c) 2024 Alice Johnson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Save this as LICENSE in your project root. The MIT license allows anyone to use, copy, modify, and distribute your software, including in commercial products, as long as they include the copyright notice.
Generating an Apache 2.0 License
Apache 2.0 adds patent protection on top of MIT-style permissions:
Settings:
License: Apache License 2.0
Copyright holder: Acme Corp
Year: 2024
Generated LICENSE file (excerpt):
─────────────────────────────────────────
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright 2024 Acme Corp
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Apache 2.0 is preferred for enterprise projects because it explicitly grants patent rights from contributors to users, protecting users from patent claims.
Generating a GPL v3 License
The GPL v3 is a copyleft license — any derivative work must also be GPL v3:
Settings:
License: GNU General Public License v3.0
Program name: MyOpenSourceApp
Copyright holder: Bob Smith
Year: 2024
Generated LICENSE file (excerpt):
─────────────────────────────────────────
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2024 Bob Smith
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Use GPL v3 when you want to ensure that all derivative works remain open source. It prevents companies from taking your code, modifying it, and distributing it as proprietary software.
Generating a BSD 2-Clause License
BSD 2-Clause (Simplified BSD) is similar to MIT but with slightly different wording:
Settings:
License: BSD 2-Clause "Simplified" License
Copyright holder: Carol Williams
Year: 2024
Generated LICENSE file:
─────────────────────────────────────────
BSD 2-Clause License
Copyright (c) 2024, Carol Williams
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES...
SPDX Identifier for package.json
The generator also outputs the SPDX license identifier for use in package manifests:
License selected: MIT
SPDX identifier: MIT
For package.json:
{
"name": "my-package",
"version": "1.0.0",
"license": "MIT"
}
For pyproject.toml:
[project]
license = {text = "MIT"}
For Cargo.toml (Rust):
license = "MIT"
For pom.xml (Maven):
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
Choosing Between MIT and Apache 2.0
The generator explains the key differences to help you choose:
MIT License:
✓ Simplest permissive license
✓ Maximum compatibility with other licenses
✓ Widely recognized and understood
✗ No explicit patent grant
✗ No contributor patent protection
Apache 2.0:
✓ Explicit patent grant from contributors
✓ Protects users from patent claims
✓ Compatible with GPL v3
✓ Includes NOTICE file requirement
✗ Slightly more complex
✗ Incompatible with GPL v2
Recommendation: Use Apache 2.0 for libraries and frameworks
where patent protection matters. Use MIT for simple utilities
and scripts where simplicity is the priority.
Generating the Unlicense (Public Domain)
For maximum freedom, dedicate your work to the public domain:
Settings:
License: The Unlicense
Generated LICENSE file:
─────────────────────────────────────────
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND...
The Unlicense is appropriate for code snippets, examples, and utilities where you want zero restrictions on use.
License Compatibility Reference
The generator shows which licenses are compatible when combining code from multiple projects:
License Compatibility Matrix:
MIT Apache2 GPL2 GPL3 LGPL MPL2
MIT ✓ ✓ ✓ ✓ ✓ ✓
Apache 2.0 ✓ ✓ ✗ ✓ ✓ ✓
GPL v2 ✓ ✗ ✓ ✗ ✓ ✗
GPL v3 ✓ ✓ ✗ ✓ ✓ ✓
LGPL ✓ ✓ ✓ ✓ ✓ ✓
MPL 2.0 ✓ ✓ ✗ ✓ ✓ ✓
✓ = Compatible (can be combined)
✗ = Incompatible (cannot be combined in same binary)
Apache 2.0 and GPL v2 are incompatible — you cannot include Apache 2.0 licensed code in a GPL v2 project. This is a common pitfall when building on top of open source libraries.