This question already has an answer here:

If this is possible, how do I go about putting this in the license file or in the source files where the BSD licensed code was used?

marked as duplicate by durron597, Bart van Ingen Schenau, ChrisF Apr 5 '15 at 15:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 6
    Within the respective license terms, what makes you think it wouldn't be okay? – user53019 Apr 2 '15 at 20:46
  • @GlenH7 - It doesn't seem like it would be "restricted" to not do this. I'm just not sure how to list the license as legally both licensees would have to be listed, but its not "dual license" as its actually different parts of the code have different liceneses – David Apr 3 '15 at 0:20
  • @durron597 - Dual license refers to a single code base allowing either license to be used which I believe is a separate issue. – David Apr 3 '15 at 0:20

Exhibit A: BSD license text
Exhibit B: MIT license text

First off, you really ought to read both of those licenses. Really, go on now, it shouldn't take more than a few minutes to read both.

What you should immediately notice is just how similar the two licenses are. Really, they are. Basically, they both state "retain the copyright notice" and "retain the as-is / no warranty statement."

That's it. That's really all there is to them.

So you asked:

Is it legal to include BSD licensed code within an MIT licensed project?

Well, why wouldn't it be legal? You read the licenses, right? There's nothing within either license restricting combining two projects together with those licenses.

To be more clear, yes, it's perfectly legal to combine Project A licensed with the MIT license along with Project B that is licensed with the BSD license.

You also asked:

If this is possible, how do I go about putting this in the license file or in the source files where the BSD licensed code was used?

The easiest way to do this is to keep each project in their own separate sub-folder within your overarching project that utilizes the two other projects. From there, you can put a LICENSE.txt file in each sub-folder as appropriate. Another bonus for using the sub-folder within the overarching project is that you can just copy things in verbatim from the original projects. That makes it very clear what code is owned under what copyright and what license.

If, for whatever reason, you can't keep the projects isolated to their own sub-project folder, then you simply need to state that various portions are owned by different projects and licensed under X terms.

Copyright for portions of project Foo are held by [MIT original author, year] as part of project Bar and are provided under the MIT license.
Copyright for additional portions of project Foo are held by [BSD original author, year] as part of project Baz and are provided under the BSD license.
All other copyright for project Foo are held by [your name, year].

Note that the ordering of projects Bar and Baz is immaterial.
Also note how similar that is to my answer on your other question.
Also note that you don't really have to specify the license that each portion is provided under, but it certainly doesn't hurt.2

You need to have a section within your LICENSE.txt file that says Project Bar is provided under such-and-such license whereas Project Baz is provided under such-and-such license.2

Editorial note: The BSD and MIT licenses are called permissive licenses for a reason. All they really say is A) "You can't exclusively claim this as your own" and B) "I'm not taking any liability for how you use the code I provided."

Once you understand the spirit behind the two licenses, it becomes much more clear on how to apply their terms.

1Note, we're using the 2-clause, not the 3-clause version of BSD as a) most everyone uses the 2-clause now and b) 3-clause just adds a bit more hassle with the "no endorsements" bit.

2This would appear to be a contradiction of statements, but it really isn't. To be more clear - you don't have to specify the license when you identify the copyright ownership. It's convenient, but not required. Likewise, when you state the license for incorporated projects you don't have to state the copyright ownership at the same point. It's just convenient to capture both aspects at the same time.

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