Apache-2.0 vs GPL-3.0 License
Apache License 2.0 compared with GNU General Public License v3.0: what each licence allows, and whether code under one can be used in a project under the other. Results are generated by the open-source license compatibility checker.
Quick Answer
Compatibility is directional, so both directions are answered separately (distributed software):
Apache-2.0 code in a project licensed under GPL-3.0
Compatible With ConditionsUsing Apache-2.0-licensed code in a project under GPL-3.0 is generally possible if the listed conditions are met.
Apache-2.0 code can be included in a project under GPL-3.0; the combined work is distributed under the GNU licence while the Apache-2.0 notices are retained. This is one-directional: GPL-3.0 code cannot be relicensed under Apache-2.0.
GPL-3.0 code in a project licensed under Apache-2.0
Potential ConflictUsing GPL-3.0-licensed code in a project under Apache-2.0 may conflict, depending on how the code is combined, distributed and licensed.
Using GPL-3.0 code in a project under Apache-2.0 is one-directional: Apache-2.0 code can go into a work under GPL-3.0, but a distributed work containing GPL-3.0 code must as a whole be licensed under GPL-3.0. Your own files may keep Apache-2.0, yet the project can no longer be distributed under Apache-2.0 alone.
Key Differences
- Copyleft: Apache-2.0: none; GPL-3.0: strong.
- Source disclosure: Apache-2.0: not required; GPL-3.0: whole distributed work based on it.
- Same licence for distributed changes: Apache-2.0: no; GPL-3.0: yes.
- Trademark rights granted: Apache-2.0: no; GPL-3.0: not addressed.
Comparison Table
| Apache-2.0 | GPL-3.0 | |
|---|---|---|
| Type | Open source | Open source |
| OSI approved | Yes | Yes |
| Commercial use | Permitted | Permitted |
| Modification | Permitted | Permitted |
| Distribution | Permitted | Permitted |
| Copyleft | None | Strong |
| Network-use (SaaS) clause | No | No |
| Source disclosure | Not required | Whole distributed work based on it |
| Same licence for distributed changes | No | Yes |
| Attribution / notices | Yes | Yes |
| Mark modified files | Yes | Yes |
| Express patent licence | Yes | Yes |
| Patent termination clause | Yes | Yes |
| Trademark rights granted | No | Not addressed |
Commercial Use
- Apache-2.0: permitted.
- GPL-3.0: permitted.
- Apache-2.0 code in a project licensed under GPL-3.0: Apache-2.0 permits commercial use.
- GPL-3.0 code in a project licensed under Apache-2.0: GPL-3.0 permits commercial use. Commercial use, including selling copies, is allowed; the copyleft conditions still apply to how the code is distributed.
Proprietary Software
Apache-2.0 code in closed-source commercial software
Generally CompatibleUsing Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario.
Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.
GPL-3.0 code in closed-source commercial software
Likely IncompatibleUsing GPL-3.0-licensed code in a proprietary project is likely incompatible in this scenario, as the licence terms are generally understood.
If a work based on GPL-3.0 code is distributed, the whole work must be licensed under GPL-3.0 with its complete source available. That is generally incompatible with distributing the project under proprietary terms.
- Apache-2.0 code in closed-source commercial software: Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.
- GPL-3.0 code in closed-source commercial software: If a work based on GPL-3.0 code is distributed, the whole work must be licensed under GPL-3.0 with its complete source available. That is generally incompatible with distributing the project under proprietary terms.
SaaS
- Network-use clause: Apache-2.0: no; GPL-3.0: no.
Apache-2.0 code in a closed-source SaaS
Generally CompatibleUsing Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario.
Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.
GPL-3.0 code in a closed-source SaaS
Compatible With ConditionsUsing GPL-3.0-licensed code in a proprietary project is generally possible if the listed conditions are met.
GPL-3.0 has no network-use clause: running GPL-3.0 code on your servers to provide a service, without distributing it, generally does not require releasing source. This depends on the code not being distributed.
- Apache-2.0 code in a closed-source SaaS: Apache-2.0 has no network-use (SaaS) clause.
- GPL-3.0 code in a closed-source SaaS: GPL-3.0 has no network-use clause: running GPL-3.0 code on your servers to provide a service, without distributing it, generally does not require releasing source. This depends on the code not being distributed.
Modification
- Apache-2.0: permitted; modified files must be marked.
- GPL-3.0: permitted; modified files must be marked.
Modifying Apache-2.0 code used in closed-source software
Generally CompatibleUsing Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario.
Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.
Modifying GPL-3.0 code used in closed-source software
Likely IncompatibleUsing GPL-3.0-licensed code in a proprietary project is likely incompatible in this scenario, as the licence terms are generally understood.
If a work based on GPL-3.0 code is distributed, the whole work must be licensed under GPL-3.0 with its complete source available. That is generally incompatible with distributing the project under proprietary terms.
- Modifying Apache-2.0 code used in closed-source software: Apache-2.0 permits modification. Apache-2.0 requires modified files to carry notices stating that they were changed.
- Modifying GPL-3.0 code used in closed-source software: GPL-3.0 permits modification. GPL-3.0 requires modified files to carry notices stating that they were changed.
Distribution
- Apache-2.0: permitted.
- GPL-3.0: permitted.
- Apache-2.0 code in a project licensed under GPL-3.0: Apache-2.0 code can be included in a project under GPL-3.0; the combined work is distributed under the GNU licence while the Apache-2.0 notices are retained. This is one-directional: GPL-3.0 code cannot be relicensed under Apache-2.0.
- GPL-3.0 code in a project licensed under Apache-2.0: Using GPL-3.0 code in a project under Apache-2.0 is one-directional: Apache-2.0 code can go into a work under GPL-3.0, but a distributed work containing GPL-3.0 code must as a whole be licensed under GPL-3.0. Your own files may keep Apache-2.0, yet the project can no longer be distributed under Apache-2.0 alone.
Copyleft
- Apache-2.0: none copyleft.
- GPL-3.0: strong copyleft.
- Apache-2.0 code in a project licensed under GPL-3.0: Apache-2.0 code can be included in a project under GPL-3.0; the combined work is distributed under the GNU licence while the Apache-2.0 notices are retained. This is one-directional: GPL-3.0 code cannot be relicensed under Apache-2.0.
- GPL-3.0 code in a project licensed under Apache-2.0: Using GPL-3.0 code in a project under Apache-2.0 is one-directional: Apache-2.0 code can go into a work under GPL-3.0, but a distributed work containing GPL-3.0 code must as a whole be licensed under GPL-3.0. Your own files may keep Apache-2.0, yet the project can no longer be distributed under Apache-2.0 alone.
Source Disclosure
- Apache-2.0: not required.
- GPL-3.0: whole distributed work based on it.
- Apache-2.0 code in a project licensed under GPL-3.0: Apache-2.0 code can be included in a project under GPL-3.0; the combined work is distributed under the GNU licence while the Apache-2.0 notices are retained. This is one-directional: GPL-3.0 code cannot be relicensed under Apache-2.0.
- GPL-3.0 code in a project licensed under Apache-2.0: Using GPL-3.0 code in a project under Apache-2.0 is one-directional: Apache-2.0 code can go into a work under GPL-3.0, but a distributed work containing GPL-3.0 code must as a whole be licensed under GPL-3.0. Your own files may keep Apache-2.0, yet the project can no longer be distributed under Apache-2.0 alone.
Attribution
- Apache-2.0: Give recipients a copy of the licence.
- Apache-2.0: Cause modified files to carry prominent notices stating that you changed them.
- Apache-2.0: Retain copyright, patent, trademark and attribution notices from the source form.
- Apache-2.0: If a NOTICE file is included, include its attribution notices in the distribution.
- GPL-3.0: License the whole conveyed work under GPL-3.0.
- GPL-3.0: Provide Corresponding Source when conveying object code.
- GPL-3.0: Keep copyright and licence notices and include the licence.
- GPL-3.0: Mark modified versions with prominent notices of changes.
- Apache-2.0 code in a project licensed under GPL-3.0: Apache-2.0 requires the copyright and licence notices to be kept with copies you distribute. If the Apache-2.0 component ships a NOTICE file, its attribution notices must be reproduced in your distribution (section 4(d)).
- GPL-3.0 code in a project licensed under Apache-2.0: GPL-3.0 requires the copyright and licence notices to be kept with copies you distribute.
Patent Considerations
- Express patent licence: Apache-2.0: yes; GPL-3.0: yes.
- Patent termination clause: Apache-2.0: yes; GPL-3.0: yes.
- Apache-2.0 code in a project licensed under GPL-3.0: Apache-2.0 includes an express patent licence from contributors. That patent licence terminates for anyone who initiates patent litigation alleging that the work infringes a patent.
- GPL-3.0 code in a project licensed under Apache-2.0: GPL-3.0 includes an express patent licence from contributors. That patent licence terminates for anyone who initiates patent litigation alleging that the work infringes a patent.
Common Scenarios
| Scenario | Apache-2.0 code in a project licensed under GPL-3.0 | GPL-3.0 code in a project licensed under Apache-2.0 |
|---|---|---|
| Use as a dependency / library | Compatible With Conditions | Potential Conflict |
| Copy source code into the project | Compatible With Conditions | Potential Conflict |
| Modify the component | Compatible With Conditions | Potential Conflict |
| SaaS / network service (not distributed) | Generally Compatible | Compatible With Conditions |
| Internal / private use only | Generally Compatible | Generally Compatible |
| Resell the software | Compatible With Conditions | Potential Conflict |
| White-label / rebrand | Compatible With Conditions | Potential Conflict |
FAQ
Can I use Apache-2.0 code in a project licensed under GPL-3.0?
Using Apache-2.0-licensed code in a project under GPL-3.0 is generally possible if the listed conditions are met. Apache-2.0 code can be included in a project under GPL-3.0; the combined work is distributed under the GNU licence while the Apache-2.0 notices are retained. This is one-directional: GPL-3.0 code cannot be relicensed under Apache-2.0.
Can I use GPL-3.0 code in a project licensed under Apache-2.0?
Using GPL-3.0-licensed code in a project under Apache-2.0 may conflict, depending on how the code is combined, distributed and licensed. Using GPL-3.0 code in a project under Apache-2.0 is one-directional: Apache-2.0 code can go into a work under GPL-3.0, but a distributed work containing GPL-3.0 code must as a whole be licensed under GPL-3.0. Your own files may keep Apache-2.0, yet the project can no longer be distributed under Apache-2.0 alone.
Can Apache-2.0-licensed code be used in closed-source commercial software?
Using Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario. Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.
Can GPL-3.0-licensed code be used in closed-source commercial software?
Using GPL-3.0-licensed code in a proprietary project is likely incompatible in this scenario, as the licence terms are generally understood. If a work based on GPL-3.0 code is distributed, the whole work must be licensed under GPL-3.0 with its complete source available. That is generally incompatible with distributing the project under proprietary terms.
Do I have to publish my source code when I use Apache-2.0 code?
Apache-2.0 does not require you to publish source code.
Do I have to publish my source code when I use GPL-3.0 code?
If a work based on GPL-3.0 code is distributed, the whole work must be licensed under GPL-3.0 with its complete source available. That is generally incompatible with distributing the project under proprietary terms.
Can I use Apache-2.0 code in a closed-source SaaS?
Using Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario. Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.
Can I use GPL-3.0 code in a closed-source SaaS?
Using GPL-3.0-licensed code in a proprietary project is generally possible if the listed conditions are met. GPL-3.0 has no network-use clause: running GPL-3.0 code on your servers to provide a service, without distributing it, generally does not require releasing source. This depends on the code not being distributed.
Try the Interactive Checker
Change the scenario, say whether the code is modified, distributed or offered as SaaS, and see every rule that applies.
Related Comparisons
Authoritative Sources
- SPDXSPDX License List: Apache-2.0
- OSIOpen Source Initiative: Apache License, Version 2.0
- Official textApache License, Version 2.0 (official text)
- SPDXSPDX License List: GPL-3.0-only
- OSIOpen Source Initiative: GNU General Public License version 3
- Official textGNU GPL v3.0 (official text)
- FAQGNU Project: Frequently Asked Questions about the GNU Licenses
- Licence stewardApache Software Foundation: Apache License v2.0 and GPL Compatibility
- FSFGNU Project: Various Licenses and Comments about Them
This tool provides general software licensing information and is not legal advice. License obligations may depend on how software components are combined, modified, distributed and used. For high-risk results, review the actual license text before relying on this result.