I'm working on a personal project that I'm planning on licensing under GNU Affero GPL. However, I found some code that's licensed under MIT that really want to utilize, but I'm not sure what I should do about licensing.

The rest of the code will be mine under GNU Affero, it's just a source file and a header file that I'm utilizing that's licensed under MIT.

I've read this Q here on Programmers about MIT/GPL code working together, and this one on SO about software under MIT using GPL libraries, as well as several others, but I'm still not entirely clear on what I should do with the licensing.

As far as I can tell, all I need to do is leave the MIT license on the library and include a note in the license file about the two different licenses and what code they apply to, is that correct?

  • 2
    Maybe a duplicate: programmers.stackexchange.com/questions/204410/…
    – Doc Brown
    Apr 21, 2016 at 14:18
  • 4
    Oh, the irony of using the most restrictive possible copyleft license, while appropriating code from one of the least restrictive. Apr 21, 2016 at 14:48
  • 2
    One choice might be to license your code under MIT, which would simplify everything. Do you really need to protect your code with a restrictive license? And if you feel strongly about the goals of GPL, why are you using non-GPL code in your project? Apr 21, 2016 at 15:26
  • 6
    @DavidArno: to me, free is free. When I use MIT, you're welcome to use my code however you want, including using it with GPL code. And if you get rich off of my code, I'll simply applaud your success. Apr 21, 2016 at 15:27
  • 2
    @DavidArno: hah, yeah. I don't understand the whole "I want my code to be open, but I want to restrict how you use it" mentality. "Either make it open or don't" is how I look at it. The vast, vast, vast majority of code isn't worth protecting anyway, so I don't understand why so much energy is putting toward protecting it. Apr 21, 2016 at 15:44

1 Answer 1


AFAIK, the typical GPL variants apply only to your work "as a whole", and the MIT license is "compatible" with GPL. That means, if parts of your program are under MIT license, that is fine, as long as you do obey to the terms of the MIT license for that part (which is what you have in mind). And the only requirement that license states is

... "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."...

Most Linux systems contain MIT licensed parts (like the X Window System) which are under MIT license. The GPL only applies to Linux "as a whole", not to the individual MIT licensed parts. Same will be true for your program if you combine those two licenses in a similar manner.

  • 1
    So I don't have to anything special other than include a note in the license file that the project uses a MIT license for parts? Apr 21, 2016 at 14:23
  • @RPiAwesomeness: either that, or you include the copyright and permission notice as part of the header & source file.
    – Doc Brown
    Mar 8, 2017 at 21:47

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.