I am looking for an open source license for a library I want to publish. Ideally, one should be allowed to use this library in free or commercial applications without paying me a fee, but if any derivative work from the library is created (any improvement of the library for example), it should be made available to everyone under that same license.

In other words, I want to put the following ethics: "You benefit from this piece of work for free, and if you improve it, I can benefit from your improvement for free too". It's a type copyleft license I am looking for.

The MIT license looks like a possible solution, but it is unclear to me whether derivative works of the code covered by this license MUST be made available PUBLICLY to everyone. Can anyone clarify/confirm this? If there is another more appropriate open source license covering my needs, I am interested too. Thanks.


2 Answers 2


The MIT licence doesn't require derivative works to be open sourced. You are looking for the GPL.

The GPL grants the recipients of a computer program the rights of the Free Software Definition and uses copyleft to ensure the freedoms are preserved whenever the work is distributed, even when the work is changed or added to. The GPL is a copyleft license, which means that derived works can only be distributed under the same license terms...

  • 2
    The GPL forces user to publish derivative work under GPL which is pushing too much restriction. I only want modifications of my library to be made available. Should I use LGPL? Commented Dec 30, 2011 at 17:32
  • 9
    In that case, yep - the LGPL is more appropriate.
    – Ant
    Commented Dec 30, 2011 at 17:34
  • Note that the (L)GPL trigger only on redistribution. An end-user that creates a derivative work for private use only is not bound by (L)GPL obligations. I.e. strictly speaking this is not an answer to the question as phrased.
    – MSalters
    Commented Jan 2, 2012 at 10:53
  • 7
    @MSalters: I think it would be almost impossible to know that someone had derived something from your code unless they published it in some form, making that issue somewhat moot.
    – Ant
    Commented Jan 5, 2012 at 1:03

Short Answer

A combination of the Eclipse Public License and the LGPL ensures exactly what you wish: Modifications of your code have to be made available, but using the code in a larger product does not force the larger product being relicensed. The combination is necessary to allow the code to be used in both GPL and non-GPL projects.

This is a way projects such as JGraphT have done. They relicensed their project under EPL and LGPL. The motivation and procedure is described in their wiki.

Long Answer

I think, the Mozilla Public License (MPL) or the Eclipse Public License (EPL) is the license you are looking for, because "if any derivative work from the library is created (any improvement of the library for example), it [IS] made available to everyone under that same license."

The MPL and the EPL license is between of GPL and MIT.

MIT allows the user to do everything with it, including modification, selling and not giving back the modified code to the community.

GPL forces the user to give away all the code to the community, even if your library is only 1% of the whole product.

LGPL forces the user to give away the modification of the LGPL-part of the code.

MPL and EPL are similar to LGPL: It also forces the user to make the modified source available. "Modified source" includes only the part of the MPL-/EPL-covered code. That means, the user may build a new product out of your library. If he does modification of the MPL-/EPL-part, he has to publish it. The new things by him do not need to be published.

I feel the MPL/EPL more fitting, as LGPL explicitly talks about "libraries" and MPL just talks about "Covered Software" (which is a broader scope).

However, choosing EPL causes trouble with combing the software with GPL software: The EPL is not compatible with GPL. This is not the case if you just use the MPL.

If you want to ensure that your code may be used in both GPL and non-GPL projects, dual license the code under LGPL and EPL as described in the short answer.


  • JGraphT
  • logback
  • qooxdoo. They are planning "to simplify and modernize the qooxdoo licensing terms" and thus they switch from the dual licensing to MIT.
  • Can you please explain why you feel the MPL fits the criteria that the OP is looking for?
    – maple_shaft
    Commented Apr 24, 2012 at 12:54
  • Should 'dual license' look like 'if you use this software in a GPL'd product, this software is licensed to you under GPL, else, under MPL'? Are there any projects that do such a thing?
    – 9000
    Commented Jul 24, 2015 at 18:20
  • @9000 According to the FAQ at GNU, the code is covered by both MPL and GNU. The second paragraph is a bit strange and I didn't quite get the implications.
    – koppor
    Commented Jul 24, 2015 at 18:25
  • JGraphT is dual licensed under EPL and LGPL.
    – koppor
    Commented Jul 9, 2016 at 15: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.