esdecode

GPL-2.0 vs GPL-3.0 License

GNU General Public License v2.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):

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

Likely Incompatible

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

GPL-2.0-only code cannot be combined into a work under GPL-3.0: GPL-2.0-only requires the whole work under GPL-2.0, while GPL-3.0 requires version 3 terms.

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

Likely Incompatible

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

GPL-3.0 code cannot be combined into a GPL-2.0-only work: the version 2 and version 3 licences each require the combined work under their own terms.

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

Compatible With Conditions

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

GPL-2.0-or-later code may be used under GPL-3.0, so it can be combined into a work under GPL-3.0 distributed under version 3 terms.

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

Potential Conflict

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

GPL-3.0 code can only be combined with a project under GPL-2.0-or-later if the combined work is distributed under version 3 terms; the project could then no longer be distributed under GPL-2.0 alone.

Key Differences

  • Express patent licence: GPL-2.0: no; GPL-3.0: yes.
  • Patent termination clause: GPL-2.0: no; GPL-3.0: yes.

Comparison Table

GPL-2.0GPL-3.0
TypeOpen sourceOpen source
OSI approvedYesYes
Commercial usePermittedPermitted
ModificationPermittedPermitted
DistributionPermittedPermitted
CopyleftStrongStrong
Network-use (SaaS) clauseNoNo
Source disclosureWhole distributed work based on itWhole distributed work based on it
Same licence for distributed changesYesYes
Attribution / noticesYesYes
Mark modified filesYesYes
Express patent licenceNoYes
Patent termination clauseNoYes
Trademark rights grantedNot addressedNot addressed

Commercial Use

  • GPL-2.0: permitted.
  • GPL-3.0: permitted.
  • GPL-2.0 code in a project licensed under GPL-3.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.
  • GPL-3.0 code in a project licensed under GPL-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

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.

GPL-3.0 code in closed-source commercial software

Likely Incompatible

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.

  • 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.
  • 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: GPL-2.0: no; GPL-3.0: no.

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.

GPL-3.0 code in a closed-source SaaS

Compatible With Conditions

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.

  • 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.
  • 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

  • GPL-2.0: permitted; modified files must be marked.
  • GPL-3.0: permitted; modified files must be marked.

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 GPL-3.0 code used in closed-source software

Likely Incompatible

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.

  • 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.
  • 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

  • GPL-2.0: permitted.
  • GPL-3.0: permitted.
  • GPL-2.0 code in a project licensed under GPL-3.0: GPL-2.0-only code cannot be combined into a work under GPL-3.0: GPL-2.0-only requires the whole work under GPL-2.0, while GPL-3.0 requires version 3 terms.
  • GPL-3.0 code in a project licensed under GPL-2.0: GPL-3.0 code cannot be combined into a GPL-2.0-only work: the version 2 and version 3 licences each require the combined work under their own terms.

Copyleft

  • GPL-2.0: strong copyleft.
  • GPL-3.0: strong copyleft.
  • GPL-2.0 code in a project licensed under GPL-3.0: GPL-2.0-only code cannot be combined into a work under GPL-3.0: GPL-2.0-only requires the whole work under GPL-2.0, while GPL-3.0 requires version 3 terms.
  • GPL-3.0 code in a project licensed under GPL-2.0: GPL-3.0 code cannot be combined into a GPL-2.0-only work: the version 2 and version 3 licences each require the combined work under their own terms.

Source Disclosure

  • GPL-2.0: whole distributed work based on it.
  • GPL-3.0: whole distributed work based on it.
  • GPL-2.0 code in a project licensed under GPL-3.0: When the obligation applies, GPL-2.0 requires making available the complete corresponding source of the whole distributed work based on it.
  • GPL-3.0 code in a project licensed under GPL-2.0: When the obligation applies, GPL-3.0 requires making available the complete corresponding source of the whole distributed work based on it.

Attribution

  • 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.
  • 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.
  • GPL-2.0 code in a project licensed under GPL-3.0: GPL-2.0 requires the copyright and licence notices to be kept with copies you distribute.
  • GPL-3.0 code in a project licensed under GPL-2.0: GPL-3.0 requires the copyright and licence notices to be kept with copies you distribute.

Patent Considerations

  • Express patent licence: GPL-2.0: no; GPL-3.0: yes.
  • Patent termination clause: GPL-2.0: no; GPL-3.0: yes.
  • GPL-2.0 code in a project licensed under GPL-3.0: GPL-2.0 contains no express patent licence. Any patent permission would depend on implied licence doctrines, which vary by jurisdiction.
  • GPL-3.0 code in a project licensed under GPL-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

ScenarioGPL-2.0 code in a project licensed under GPL-3.0GPL-3.0 code in a project licensed under GPL-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)Compatible With ConditionsCompatible With Conditions
Internal / private use onlyGenerally CompatibleGenerally Compatible
Resell the softwareLikely IncompatibleLikely Incompatible
White-label / rebrandLikely IncompatibleLikely Incompatible

FAQ

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

Using GPL-2.0-licensed code in a project under GPL-3.0 is likely incompatible in this scenario, as the licence terms are generally understood. GPL-2.0-only code cannot be combined into a work under GPL-3.0: GPL-2.0-only requires the whole work under GPL-2.0, while GPL-3.0 requires version 3 terms.

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

Using GPL-3.0-licensed code in a project under GPL-2.0 is likely incompatible in this scenario, as the licence terms are generally understood. GPL-3.0 code cannot be combined into a GPL-2.0-only work: the version 2 and version 3 licences each require the combined work under their own terms.

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.

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 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.

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 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.

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

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.