esdecode

Apache-2.0 vs GPL-2.0 License

Apache License 2.0 compared with GNU General Public License v2.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-2.0

Likely Incompatible

Using Apache-2.0-licensed code in a project under GPL-2.0 is likely incompatible in this scenario, as the licence terms are generally understood.

The FSF and the Apache Software Foundation consider Apache-2.0 incompatible with GPL-2.0-only, because Apache-2.0's patent termination and indemnification terms are additional restrictions GPL-2.0 does not allow.

GPL-2.0 code in a project licensed under Apache-2.0

Likely Incompatible

Using GPL-2.0-licensed code in a project under Apache-2.0 is likely incompatible in this scenario, as the licence terms are generally understood.

A distributed work containing GPL-2.0-only code must be licensed as a whole under GPL-2.0, and the FSF and the Apache Software Foundation consider Apache-2.0 code incompatible with GPL-2.0. The Apache-2.0 project code and the GPL-2.0-only code therefore generally cannot be combined into one distributed work.

GPL-2.0-or-later code in a project licensed under Apache-2.0

Potential Conflict

Using GPL-2.0-or-later-licensed code in a project under Apache-2.0 may conflict, depending on how the code is combined, distributed and licensed.

Using GPL-2.0 code in a project under Apache-2.0 is one-directional: Apache-2.0 code can go into a work under GPL-2.0, but a distributed work containing GPL-2.0 code must as a whole be licensed under GPL-2.0. Your own files may keep Apache-2.0, yet the project can no longer be distributed under Apache-2.0 alone.

Apache-2.0 code in a project licensed under GPL-2.0-or-later

Compatible With Conditions

Using Apache-2.0-licensed code in a project under GPL-2.0-or-later is generally possible if the listed conditions are met.

Apache-2.0 code can be included in a project under GPL-2.0-or-later when the combination is distributed under GPL-3.0 terms; the combined work is distributed under the GNU licence while the Apache-2.0 notices are retained. This is one-directional: GPL-2.0 code cannot be relicensed under Apache-2.0.

Key Differences

  • Copyleft: Apache-2.0: none; GPL-2.0: strong.
  • Source disclosure: Apache-2.0: not required; GPL-2.0: whole distributed work based on it.
  • Same licence for distributed changes: Apache-2.0: no; GPL-2.0: yes.
  • Express patent licence: Apache-2.0: yes; GPL-2.0: no.
  • Patent termination clause: Apache-2.0: yes; GPL-2.0: no.
  • Trademark rights granted: Apache-2.0: no; GPL-2.0: not addressed.

Comparison Table

Apache-2.0GPL-2.0
TypeOpen sourceOpen source
OSI approvedYesYes
Commercial usePermittedPermitted
ModificationPermittedPermitted
DistributionPermittedPermitted
CopyleftNoneStrong
Network-use (SaaS) clauseNoNo
Source disclosureNot requiredWhole distributed work based on it
Same licence for distributed changesNoYes
Attribution / noticesYesYes
Mark modified filesYesYes
Express patent licenceYesNo
Patent termination clauseYesNo
Trademark rights grantedNoNot addressed

Commercial Use

  • Apache-2.0: permitted.
  • GPL-2.0: permitted.
  • Apache-2.0 code in a project licensed under GPL-2.0: Apache-2.0 permits commercial use.
  • GPL-2.0 code in a project licensed under Apache-2.0: GPL-2.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 Compatible

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.

GPL-2.0 code in closed-source commercial software

Likely Incompatible

Using GPL-2.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-2.0 code is distributed, the whole work must be licensed under GPL-2.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-2.0 code in closed-source commercial software: If a work based on GPL-2.0 code is distributed, the whole work must be licensed under GPL-2.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-2.0: no.

Apache-2.0 code in a closed-source SaaS

Generally Compatible

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.

GPL-2.0 code in a closed-source SaaS

Compatible With Conditions

Using GPL-2.0-licensed code in a proprietary project is generally possible if the listed conditions are met.

GPL-2.0 has no network-use clause: running GPL-2.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-2.0 code in a closed-source SaaS: GPL-2.0 has no network-use clause: running GPL-2.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-2.0: permitted; modified files must be marked.

Modifying Apache-2.0 code used in closed-source software

Generally Compatible

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.

Modifying GPL-2.0 code used in closed-source software

Likely Incompatible

Using GPL-2.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-2.0 code is distributed, the whole work must be licensed under GPL-2.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-2.0 code used in closed-source software: GPL-2.0 permits modification. GPL-2.0 requires modified files to carry notices stating that they were changed.

Distribution

  • Apache-2.0: permitted.
  • GPL-2.0: permitted.
  • Apache-2.0 code in a project licensed under GPL-2.0: The FSF and the Apache Software Foundation consider Apache-2.0 incompatible with GPL-2.0-only, because Apache-2.0's patent termination and indemnification terms are additional restrictions GPL-2.0 does not allow.
  • GPL-2.0 code in a project licensed under Apache-2.0: A distributed work containing GPL-2.0-only code must be licensed as a whole under GPL-2.0, and the FSF and the Apache Software Foundation consider Apache-2.0 code incompatible with GPL-2.0. The Apache-2.0 project code and the GPL-2.0-only code therefore generally cannot be combined into one distributed work.

Copyleft

  • Apache-2.0: none copyleft.
  • GPL-2.0: strong copyleft.
  • Apache-2.0 code in a project licensed under GPL-2.0: The FSF and the Apache Software Foundation consider Apache-2.0 incompatible with GPL-2.0-only, because Apache-2.0's patent termination and indemnification terms are additional restrictions GPL-2.0 does not allow.
  • GPL-2.0 code in a project licensed under Apache-2.0: A distributed work containing GPL-2.0-only code must be licensed as a whole under GPL-2.0, and the FSF and the Apache Software Foundation consider Apache-2.0 code incompatible with GPL-2.0. The Apache-2.0 project code and the GPL-2.0-only code therefore generally cannot be combined into one distributed work.

Source Disclosure

  • Apache-2.0: not required.
  • GPL-2.0: whole distributed work based on it.
  • Apache-2.0 code in a project licensed under GPL-2.0: Apache-2.0 does not require you to publish source code.
  • GPL-2.0 code in a project licensed under Apache-2.0: When the obligation applies, GPL-2.0 requires making available the complete corresponding source of the whole distributed work based on it.

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-2.0: Distribute the whole work based on the program under GPL-2.0.
  • GPL-2.0: Provide or offer complete corresponding source code.
  • GPL-2.0: Keep copyright and licence notices intact and include the licence.
  • GPL-2.0: Mark modified files with notices of changes and dates.
  • Apache-2.0 code in a project licensed under GPL-2.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-2.0 code in a project licensed under Apache-2.0: GPL-2.0 requires the copyright and licence notices to be kept with copies you distribute.

Patent Considerations

  • Express patent licence: Apache-2.0: yes; GPL-2.0: no.
  • Patent termination clause: Apache-2.0: yes; GPL-2.0: no.
  • Apache-2.0 code in a project licensed under GPL-2.0: The FSF and the Apache Software Foundation consider Apache-2.0 incompatible with GPL-2.0-only, because Apache-2.0's patent termination and indemnification terms are additional restrictions GPL-2.0 does not allow.
  • GPL-2.0 code in a project licensed under Apache-2.0: A distributed work containing GPL-2.0-only code must be licensed as a whole under GPL-2.0, and the FSF and the Apache Software Foundation consider Apache-2.0 code incompatible with GPL-2.0. The Apache-2.0 project code and the GPL-2.0-only code therefore generally cannot be combined into one distributed work.

Common Scenarios

ScenarioApache-2.0 code in a project licensed under GPL-2.0GPL-2.0 code in a project licensed under Apache-2.0
Use as a dependency / libraryLikely IncompatibleLikely Incompatible
Copy source code into the projectLikely IncompatibleLikely Incompatible
Modify the componentLikely IncompatibleLikely Incompatible
SaaS / network service (not distributed)Generally CompatibleCompatible With Conditions
Internal / private use onlyGenerally CompatibleGenerally Compatible
Resell the softwareLikely IncompatibleLikely Incompatible
White-label / rebrandLikely IncompatibleLikely Incompatible

FAQ

Can I use Apache-2.0 code in a project licensed under GPL-2.0?

Using Apache-2.0-licensed code in a project under GPL-2.0 is likely incompatible in this scenario, as the licence terms are generally understood. The FSF and the Apache Software Foundation consider Apache-2.0 incompatible with GPL-2.0-only, because Apache-2.0's patent termination and indemnification terms are additional restrictions GPL-2.0 does not allow.

Can I use GPL-2.0 code in a project licensed under Apache-2.0?

Using GPL-2.0-licensed code in a project under Apache-2.0 is likely incompatible in this scenario, as the licence terms are generally understood. A distributed work containing GPL-2.0-only code must be licensed as a whole under GPL-2.0, and the FSF and the Apache Software Foundation consider Apache-2.0 code incompatible with GPL-2.0. The Apache-2.0 project code and the GPL-2.0-only code therefore generally cannot be combined into one distributed work.

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-2.0-licensed code be used in closed-source commercial software?

Using GPL-2.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-2.0 code is distributed, the whole work must be licensed under GPL-2.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-2.0 code?

If a work based on GPL-2.0 code is distributed, the whole work must be licensed under GPL-2.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-2.0 code in a closed-source SaaS?

Using GPL-2.0-licensed code in a proprietary project is generally possible if the listed conditions are met. GPL-2.0 has no network-use clause: running GPL-2.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

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.