Everybody knows that you shouldn't use a CC BY-SA license on your code. Even the Creative Commons folk recommend against it. What I don't know or understand is why. I can't seem to find any information explaining this.

I contribute as both an asker and answerer on Code Review Stack Exchange. Since SE asks us to license our contributions under CC BY-SA, I'd like to know the implications this has on code I post there. Most of my code is released under GPL3 or MIT otherwise. I know by posting it on SE I'm dual licensing, but what exactly am I agreeing to?

  1. Why is CC BY-SA discouraged for code?
  2. What implications does dual licensing have for these (sometimes quite large) sections of code have from my projects?

Stack Exchange proposed an update to their terms of service in regards to code licensing in late 2015/early 2016 but that change is "delayed indefinitely"

  • 1
    I'll give you an example. One of the frequent problems with code is this: is linking to a library considered derivative work? Licenses such as the GPL address this question, CC BY-SA doesn't. Commented Sep 3, 2015 at 19:06
  • 4
    @AndreaCorbellini, A licence does not define what the legal term "derivative work" means. GPL purports to do so, but that is legally void. What GPL (and other open source licenses) do is to specify that source code (format useful for changes) should be available for modification and extension by the user.
    – vonbrand
    Commented Jan 19, 2016 at 17:42
  • 1
    @vonbrand: the GPL does more than that. Be sure to read it. Read the four freedoms too: they are the foundations for the GPL and they go beyond source code. Remember: a program and the source code for the program are very different things. The distinction is really important and raises important problems. Commented Jan 19, 2016 at 17:55

2 Answers 2


CC's own FAQ addresses the reasons, which I find satisfactory, so I'm just going to reproduce it here and expand on the key points:

Unlike software-specific licenses, CC licenses do not contain specific terms about the distribution of source code, which is often important to ensuring the free reuse and modifiability of software. Many software licenses also address patent rights, which are important to software but may not be applicable to other copyrightable works. Additionally, our licenses are currently not compatible with the major software licenses, so it would be difficult to integrate CC-licensed work with other free software. Existing software licenses were designed specifically for use with software and offer a similar set of rights to the Creative Commons licenses.

Our licenses are currently not compatible with the GPL, though the CC0 Public Domain Dedication is GPL-compatible and acceptable for software. For details, see the relevant CC0 FAQ entry. We are looking into compatibility of BY-SA with GPL in the future; see the license compatibility page for more information.)

(Bold is mine)

That is, CC-BY-SA

  • Doesn't mention source code
  • Doesn't mention patents
  • Isn't compatible with major software licenses1

Why are these good reasons for not using CC-BY-SA?

It doesn't protect access to source code. The "-SA" part simply means, "I'll share this piece of work, and you can use it as long as you then share yours under the same terms". But there is no mention of alternate forms; this only covers the final, publicly-available form. So someone is perfectly within their rights to take CC-BY-SA code, produce a derivative software, and only share the binary under CC-BY-SA. By contrast, GPL explicitly mentions source code, and requiring the distributing source code, when you convey alternate forms such as binary form.

It doesn't protect against patent disputes. This may or may not be important, as evidenced by many software licenses also not mentioning patents, but for some use cases it is very important.

It isn't compatible with major software licenses. The FAQ specifically mentions GPL incompatibility, that is, it's impossible to combine and distribute CC-BY-SA and GPL licensed code in the same piece of software. Since the body of GPL-licensed and GPL-compatible-licensed software is much bigger than that for CC-BY-SA, releasing using CC-BY-SA greatly limits the usefulness of the code.

When choosing a license, you should define what you're trying to achieve with the license. CC-BY-SA provides much weaker protection than copyleft software licenses, since it doesn't guarantee access to source code, but because it is so incompatible with other licenses, it is more restrictive in practice. It's very likely that there are much more appropriate licenses than CC-BY-SA, for whatever you're trying to achieve. For example, if access to source is not an issue, try a permissive license. If you want to ensure that your code remains freely available, try a copyleft license.

1: @kyll has mentioned that CC BY-SA version 4.0 has a one-way compatibility with GPLv3. This is specific to BY-SA content integrated in a GPLv3 project. Using CC BY-SA on still suffers from the incompatibility problem. From the FAQ:

Version 4.0 of CC's Attribution-ShareAlike (BY-SA) license is one-way compatible with the GNU General Public License version 3.0 (GPLv3). This compatibility mechanism is designed for situations in which content is integrated into software code in a way that makes it difficult or impossible to distinguish the two. There are special considerations required before using this compatibility mechanism. Read more about it here.

  • 7
    All of this applies equally to the MIT license which doesn't mention source code, doesn't mention patents, and also isn't compatible with GPL (you can't use GPL code in an MIT project). If these are the only reasons, then CC-BY-SA is just as appropriate for code as the second most popular open source license. Commented Aug 26, 2015 at 7:51
  • 11
    @AbhiBeckert please don't use your own definitions for concepts like license compatibility. When two licenses are incompatible, it is legally impossible to mix and distribute code. MIT is said to be GPL-compatible, because you can mix and distribute, provided that the whole work is under GPL and the MIT license is included. Commented Aug 26, 2015 at 8:29
  • 5
    TL;DR: So someone is perfectly within their rights to take CC-BY-SA code, produce a derivative software, and only share the binary under CC-BY-SA.
    – RubberDuck
    Commented Aug 26, 2015 at 9:08
  • 4
    @RubberDuck: of course. Similarly, they're entitled to take CC-BY-SA novel, write an audio play closely based on it, and only share the .mp3 file under CC-BY-SA but keep the script of the play to themselves. The reason is that the "SA" part of the license is represented by a restriction what you must do if you "distribute or publicly perform" an adaptation. If you keep an adaptation to yourself (as would be the case for modified source code that you do not distribute at all, or only distribute the binary) then no restrictions are stated. Commented Aug 26, 2015 at 11:31
  • 7
    @AbhiBeckert: the terminology is that licenses X and Y are compatible if they both permit a new work that is derivative of both work A (licensed under X) and work B (licensed under Y) to be distributed. Therefore GPL and MIT are said to be compatible (since you can distribute the jointly-derived work, albeit you must GPL-license it in order to do so). GPL and CC-BY-SA are not compatible since CC-BY-SA says you must CC-BY-SA the jointly-derived work if you distributed it, whereas GPL forbids releasing the jointly-derived work under CC-BY-SA. Commented Aug 26, 2015 at 11:41


  1. CC-BY-SA is a technically perfect open source license.
  2. CC-BY-SA's use is discouraged because of the "license proliferation" problem.

Going into more detail on the first point, first we need to know what it means to be an "open source" license. OSI has a great definition of what it means to be open: http://opensource.org/osd

Lets go through each point:

  1. Free Redistribution – The license shall not restrict any party from selling or giving away the software as a component of an aggregate software distribution

This is the most important requirement for a license to be "open". CC-BY-SA does not restrict selling or giving away the software and therefore it passes.

Other creative commons licenses (such as CC-BY-NC and CC-BY-NC-SA) fail here and are not open source.

  1. Source Code – The program must include source code, and must allow distribution in source code as well as compiled form.

CC-BY-SA allows distribution of the source code or the binary.

  1. Derived Works – The license must allow modifications and derived works, and must allow them to be distributed under the same terms as the license of the original software.

CC-BY-SA passes here too, you are allowed to modify the work and can distribute under the same terms.

  1. Integrity of The Author's Source Code

This is an extension of point 3, clarifying some areas where an open source license can block distribution. CC-BY-SA passes.

  1. No Discrimination Against Persons or Groups

  2. No Discrimination Against Fields of Endeavor

CC-BY-SA is fine for these points.

  1. Distribution of License – The rights attached to the program must apply to all to whom the program is redistributed without the need for execution of an additional license by those parties.

CC-BY-SA is fine again, you can redistribute without permission.

  1. License Must Not Be Specific to a Product

CC-BY-SA is definitely not specific to any product - that's the whole point.

  1. License Must Not Restrict Other Software – The license must not place restrictions on other software that is distributed along with the licensed software.

Just an extension/clarification of point 1. CC-BY-SA passes here.

  1. License Must Be Technology-Neutral – No provision of the license may be predicated on any individual technology or style of interface.

Again, CC-BY-SA passes.

CC-BY-SA fits the definition of open source perfectly and is therefore suited to open source code.

There is, however, one reason to avoid using the license: The issue of "license prolifiration", which OSI has explained nicely: http://opensource.org/proliferation and there's a wikipedia page going into more detail: https://en.wikipedia.org/wiki/License_proliferation

Basically, it's bad for the community to have a bunch of licenses that may or may not be compatible with other licenses. Far better if everybody settles on a small number of licenses where the community clearly knows which licenses are/aren't compatible with other licenses.

This is especially true for "restrictive" licenses like CC-BY-SA, since those are the ones most likely to have compatibility issues. Proliferation is less of an issue with "permissive" licenses (like CC-0) so the community generally is happy for those licenses to be used (although OSI and the FSF do not actively encourage their use).

This is why CC-BY-SA is discouraged. But you can use it if you want, and still consider your project open source.

  • License proliferation isn't just an issue with CC-BY-SA. Here's looking at you GPL... ++. Nice answer.
    – RubberDuck
    Commented Aug 26, 2015 at 12:56
  • Note that Open Source requires in point 2 the source to be distributed, which CC-BY_SA doesn't even mention. So CC-BY-SA isn't "open source" at all.
    – vonbrand
    Commented Dec 19, 2015 at 22:36
  • 8
    @vonbrand you're wrong. The MIT license doesn't mention source code at all and does not require the source code be open. Point 2 says the program must include source code to be "open source" but it does not say the license must require that, and many open source licenses don't. Commented Dec 22, 2015 at 7:20
  • Wrong, point 2: CC-BY-SA doesn't require "source code" to be available at all (as per the version 1.9 of the Open Source definition requirement). The Open Source Initiative doesn't list any Creative Commons license as "open". but list MIT.
    – vonbrand
    Commented Feb 27, 2020 at 13:57
  • 1
    This answer claims that CC-BY-SA checks all the boxes for the OSD, but this is correct only when looking at copyright issues. It is no longer correct when looking at patent rights. Free redistribution? Not if patents are involved. Derived works? Not if patents are involved. No discrimination against fields of endeavor? Not if patents are involved. Some Open Source licenses don't mention patents but include explicit permission to use/modify/distribute the software (e.g. MIT license), whereas CC licenses explicitly exclude patents from the scope of the license.
    – amon
    Commented Mar 4, 2022 at 15:19

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.