The various GNU licenses enjoy broad compatibility between each other. Theonly time you may not be able to combine code under two of these licenses is when youwant to use code that'sonly under an older version of a licensewith code that's under a newer version.
Below is a detailed compatibility matrix for various combinations of theGNU licenses, to provide an easy-to-use reference for specific cases. Itassumes that someone else has written some software under one of theselicenses, and you want to somehow incorporate code from that into a projectthat you're releasing (either your own original work, or a modified versionof someone else's GPLed software). Find the license for your own work in acolumn at the top of the table, and the license for the other code in a rowon the left. The cell where they meet will tell you whether or not thiscombination is permitted.
When we say "copy code," we mean just that: you're taking a section ofcode from one source, with or without modification, and inserting it intoyour own program, thus forming a work based on the first section of code."Use a library" means that you're not copying any sourcedirectly, but instead interacting with it through linking, importing, orother typical mechanisms that bind the sources together when you compile orrun the code.
Skip compatibility matrix
| I want to release a project under: |
|---|
| GPLv2 only | GPLv2 or later | GPLv3 or later | LGPLv2.1 only | LGPLv2.1 or later | LGPLv3 or later |
|---|
| I want to copy code under: | GPLv2 only | OK | OK [2] | NO | OK if you convert to GPLv2 [7] | OK if you convert to GPLv2 [7][2] | NO |
|---|
| GPLv2 or later | OK [1] | OK | OK | OK if you convert to GPL [7] | OK if you convert to GPL [7] | OK if you convert to GPLv3 [7] |
|---|
| GPLv3 | NO | OK if you upgrade to GPLv3 [3] | OK | OK if you convert to GPLv3 [8] | OK if you convert to GPLv3 [8][3] | OK if you convert to GPLv3 [7] |
|---|
| LGPLv2.1only | OK if you convert to GPLv2 [7] | OK if you convert to GPL [7][2] | OK if you convert to GPLv3 [8] | OK | OK [6] | OK if you convert to GPLv3 [8] |
|---|
| LGPLv2.1or later | OK if you convert to GPLv2 [7][1] | OK if you convert to GPL [7] | OK if you convert to GPLv3 [7] | OK [5] | OK | OK |
|---|
| LGPLv3 | NO | OK if you upgrade and convert to GPLv3 [7][3] | OK if you convert to GPLv3 [7] | OK if you convert to GPLv3 [8] | OK if you upgrade to LGPLv3 [4] | OK |
|---|
| I want to use a library under: | GPLv2 only | OK | OK [2] | NO | OK if you convert to GPLv2 [7] | OK if you convert to GPLv2 [7][2] | NO |
|---|
| GPLv2 or later | OK [1] | OK | OK | OK if you convert to GPL [7][1] | OK if you convert to GPL [7] | OK if you convert to GPLv3 [7] |
|---|
| GPLv3 | NO | OK if you upgrade to GPLv3 [3] | OK | OK if you convert to GPLv3 [8] | OK if you convert to GPLv3 [7][3] | OK if you convert to GPLv3 [7] |
|---|
| LGPLv2.1 only | OK | OK | OK | OK | OK | OK |
|---|
| LGPLv2.1 or later | OK | OK | OK | OK | OK | OK |
|---|
| LGPLv3 | NO | OK | OK | OK | OK | OK |
|---|
Skip footnotes
1:You must follow the terms of GPLv2 when incorporating the code in thiscase. You cannot take advantage of terms in later versions of the GPL.
2:If you do this, as long as the project contains the code released underGPLv2 only, you will not be able to upgrade the project's license to GPLv3or later.
3:If you have the ability to release the project under GPLv2 or any laterversion, you can choose to release it under GPLv3 or any laterversion—and once you do that, you'll be able to incorporate the codereleased under GPLv3.
4:If you have the ability to release the project under LGPLv2.1 or any laterversion, you can choose to release it under LGPLv3 or any laterversion—and once you do that, you'll be able to incorporate the codereleased under LGPLv3.
5:You must follow the terms of LGPLv2.1 when incorporating the code in thiscase. You cannot take advantage of terms in later versions of the LGPL.
6:If you do this, as long as the project contains the code released underLGPLv2.1 only, you will not be able to upgrade the project's license toLGPLv3 or later.
7:Every version of the LGPL gives you permission to relicense the code underthe corresponding version (or any later version) of the GPL. If you canswitch the LGPLed code in this case to using the GPL instead, you can makethis combination.
8:Every version of the LGPL gives you permission to relicense the code underthe corresponding version, or any later version, of the GPL. In thesecases, you can combine the code if you migrate its license to GPLv3, anduse GPLv3 for your own work as well.