I've seen several statements that the zlib license is compatible with the GPL. But this does not seem to be correct. The zlib license contains the following clause:

"Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software."

For a license to be GPL compatible, it must not contain any restrictions on modifications that are not also found in the GPL. But the GPL has no restriction on modification that is analogous to the first part of this clause.

The GPL contains the following clause (5a in 3.0):

"a) The work must carry prominent notices stating that you modified it, and giving a relevant date."

But this is a restriction on distribution. You could comply with this term by never distributing your modified code or by adding such notices prior to distribution. But this would violate the zlib license.

So how is the zlib license GPL compatible when it contains a restriction on modification that is not like any restriction found in the GPL and the presence of additional restrictions is what makes a license not GPL compatible?

  • "You could comply with this term by never distributing your modified code or by adding such notices prior to distribution. But this would violate the zlib license." - Which one of those would violate the license? "Not distributing your code" or "adding such notices"? Also could you explain how you believe it violates the license? I don't quite see how adding a notice according to GPL requirements would violate the zlib license.
    – Brandin
    Dec 2, 2022 at 10:37

2 Answers 2


I don't see an issue, as the preservation (and introduction) of legal markings on modified forms, and a prohibition against misrepresentation, are permissible requirements to add to a GPL distribution, per GPLv3 7(b) and (c):

Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or

Note these Section 7 restrictions do not necessarily activate on distribution. A license term that applies only to private modification still fits within the definitions set forth in Section 7. I expect the allowances for additional restrictions are written in this broad way precisely to allow terms like the second term of the zlib license.

  • Suppose Alice writes a zlib-licensed work.
  • Then Bob modifies that work, and releases it under the GPL. This is allowed because his GPL-licensed + zlib-licensed distribution has only extended normal GPL requirements by making GPL-permissible 7(b/c) restrictions.
    • This is exactly how the addition-restrictions mechanism is intended to work, by allowing broad GPL compatibility with miscellaneous harmless (but technically restrictive) terms in other licenses.
  • Then Charlie makes further modifications to Bob's work. According to your reasonable, scrupulous read of the zlib license, Charlie must maintain modification notices at all times, even prior to distribution, per zlib requirements. Bob's GPL+zlib grant allows Alice to require this, and Bob's GPL terms allow this as an acceptable Section-7 restriction. Charlie (optionally) releases modified versions in the same way as Bob.

The GPL License does not care what you do at home, you don't need to comply to the rules as long as you don't distribute any code.

There is no difference between the impact of Restriction 2 of the ZLIB License and Section 5.a) in GPLv3 at the point of time when the software is distributed. Therefore the difference in the wording is no obstacle in GPL-compatibility.

  • I agree with everything except your last sentence. It follows from everything else that it is an obstacle. The GPL doesn't impose any restrictions on what you do if you don't distribute. The zlib license does. There is a difference in impact before the code is distributed. Therefore, relative to the GPL, the zlib license has an additional restriction. Why doesn't that make it GPL-incompatible? Dec 2, 2022 at 8:06
  • You seem to be confusing 'license compatibility' with 'permission to re-license'. In case of a re-licensing your concern would be an issue, however the ZLIB License contains the language "This notice may not be removed or altered from any source distribution." which effectively prevents re-licensing. Dec 2, 2022 at 8:19
  • @DavidSchwartz It's probably helpful to remember that such licenses are basically only relevant when you distribute the work. The reason is because without the license, to redistribute the work would be a copyright violation. This is why a license can't impose requirements on you if what you're doing does not involve possible copyright infringement. Making private changes in your own home, for example, could never be copyright infringement, so you don't need a license for that. GPL goes above and beyond by giving explicit permissions to do those things, but in general that's not required.
    – Brandin
    Dec 2, 2022 at 20:25
  • @Brandin What if you need to modify the work after having distributed it? Dec 5, 2022 at 4:50
  • @DavidSchwartz I would view those as two distinct acts of distribution. On Monday, if I give you the unmodified GPL/zlib work, then that act of distribution seems to be OK, no violations for distributing verbatim copies. On Tuesday, if I modify the work, and then I add notices as required by both licenses, and then redistribute the modified version to you, then this is a separate act of distribution that also seems to be OK to me by my reading of the licenses, as long as the changes are "clearly marked as such" (GPL) and not "misrepresent[ed] as being the original software" (zlib).
    – Brandin
    Dec 5, 2022 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.