I would like to allow users of my code to make derivatives, but disallow derivatives from imposing any restrictions on the usage of my code. Is there an existing license that would fit this specification?

  • 8
    Diallowing derivatives from imposing restrictions would prevent derivatives from barring licence changes downstream from them. Which do you want for derivatives: complete freedom from restrictions, or a requirement to reissue under the same licence? They're mutually exclusive, so you can only pick (at most) one.
    – MadHatter
    Commented Jan 5, 2023 at 9:08
  • @MadHatter I'm not sure that's true. Isn't it legally possible to provide a software S under license A to someone and license A forces that person to use license B != A to distribute any changes? Where license B forces anyone else who obtained the product with that license to keep using license B.
    – GACy20
    Commented Jan 5, 2023 at 13:00
  • 1
    @GACy20 I suspect so, but in that case the derivative is still placing restrictions on usage (must keep using license B), so it still won't satisfy both the OP's requirements at the same time.
    – MadHatter
    Commented Jan 5, 2023 at 13:28
  • 1
    Just about every software license forbids changing the license, for obvious reasons. Exceptions are the so-called "permissive licenses" (MIT, BSD and Apache). Commented Jan 5, 2023 at 16:31

5 Answers 5


Firstly, you need a copyleft license, so that you can ensure derivatives would be subject to the same license conditions.

Secondly, the license must prevent imposition of additional restrictions that are not found in the license.

Both of these are fulfilled by the GPLv2. Section 6 states:

You may not impose any further restrictions on the recipients' exercise of the rights granted herein.

And also Section 10 of the GPLv3:

You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License.

The same conditions can be found in LGPLv2.1 and LGPLv3.

  • Or cc-sa and any variants
    – Trish
    Commented Jan 5, 2023 at 11:23
  • 2
    @Trish though those are not generally recommended for code.
    – MadHatter
    Commented Jan 5, 2023 at 12:05
  • 1
    The GPL forces derivatives to be open source. While it almost fits the specifications, it does too much. Commented Jan 5, 2023 at 16:51
  • 2
    This. I found over the years that its best to stick to the following license progression, from least to most permissive: GPL < GPL w/ linking exceptions < CC0. Few other "Open Source" licenses provide any benefits over all of these 3 worth the effort of learning their limitations. What the OQ asked for is a job for GPL.
    – T.E.D.
    Commented Jan 5, 2023 at 21:03
  • 4
    @linklinklink If you consider taking away the source code as a kind of restriction, then it's actually a good fit, because without the source code you can't do a lot of things, no matter what the license says! Commented Jan 5, 2023 at 21:09

I voted up Ruben's answer, but also noticed a possible confusion in the question:

allow users of my code to make derivatives, but disallow derivatives from imposing any restrictions on the usage of my code

If you meant "disallow the copyright holder of the derivates from imposing any restrictions on the usage of their derivatives", Ruben is correct; use the GPL. This is exactly what it was designed for.

If you meant "disallow the copyright holder of the derivatives from imposing any restriction on my use of my own code", that just can't happen. If you own the copyright, licenses don't limit you. You can do whatever you want with your own code. That includes continuing to license it however you want. Your users will remain quite free to continue to use your code in accordance with the license(s) you gave them, no matter what someone else does with a "derivative" copy they made.

Where the GPL comes in is if you don't want someone with resources swooping in, improving your code (or perhaps building a great product using it), and then requiring different license terms you had no input into in order to use their new improved "derivative" code.


I think the Ms-PL license follows the exact specifications listed.

Under section 3 (D): (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

  • Note that this still would allow someone to compile the code "in object form" and then include that in a different project with a different license, as long as that other license "complies" with the Ms-PL license, and as long as the other license allows including object-only code in the project. Personally I think that makes it compatible with Apache, for example, but one would have to specifically compile your Ms-PL part before including it in her Apache project. See opensource.stackexchange.com/questions/13087/…
    – Brandin
    Commented Jan 5, 2023 at 9:28

CC BY-SA or its non-commercial cousin, CC BY-NC-SA, do not allow changing out of the license for derivates as altering the license is violating the SA Part, unless it is essentially reworded. There is no compatible license for the 3.0 version.

For your application, the CC BY-SA 4.0 compatible GNU GPL v3 might be the better choice: it shares the force to stay in the license scheme and is worded even stronger in this regard, disallowing to put any different license on it. It is also very common in software projects.

  • 3
    It's not recommended to apply any CC license to software: creativecommons.org/faq/…
    – kapex
    Commented Jan 5, 2023 at 15:50
  • @kapex yeah, because of the source code thing, but the asker didn't say they wanted to share source code, which does make me wonder why this is on Open Source Stack Exchange Commented Jan 5, 2023 at 16:32
  • @user253751 it was transferred from LAW.SE to here, imho erroneously. I n the migration, a paragraph I wrote about GPLv3 being similar and possibly better was lost...
    – Trish
    Commented Jan 5, 2023 at 20:49

Apache License 2.0 is one that should achieve what you need. https://opensource.org/licenses/Apache-2.0

  • 2
    I notice the following clause defies my requirements: Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense
    – linklinklink
    Commented Jan 5, 2023 at 2:45
  • 1
    @linklinklink I think you're mistaken on what sublicensing means. It does not mean to use a different license. It means to give somebody else the rights that were given to you.
    – user71659
    Commented Jan 5, 2023 at 6:23
  • @usee71659 you are correct. I did find that the Ms-PL license meets my specifications more than the Apache 2.0 license however.
    – linklinklink
    Commented Jan 5, 2023 at 6:32
  • 5
    I think this is not right since Apache License 2.0 states "You ... may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License."
    – ruben2020
    Commented Jan 5, 2023 at 10:15

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.