I want to use some source code under CC-BY-SA for my company's project. That project is commercial and closed source code. I want our project not to have obligation to release the source code. Is this possible?

  • 1
    Usually a CC license is not a good choice for software. But since the code you want to use exists, it would be important to know exactly how you want to "use some source code" of it. How do you build and distribute your proprietary software?
    – user10225
    Apr 25, 2018 at 7:51
  • 3
    CC-BY-SA says "If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original." See Using images with CC-BY-SA license in slides or a thesis. For source code, compiling the CC-BY-SA code for use in a closed source program is a transformation of the CC-BY-SA source code, so at the very least you will need to provide that in order to comply with the ShareAlike requirement.
    – Brandin
    Apr 25, 2018 at 8:03

2 Answers 2


You can include CC-BY-SA source code in proprietary software iff you do not publish that software. The CC-BY-SA requirements only apply once you Share[1] the adapted work. For example, this would allow internal tools, or possibly a server backend where that usage does not constitute a public performance.

[1] as defined in section 1.k in the CC-BY-SA 4.0, compare Distribute and Publicly Perform in sections 1.d and 1.j in the CC-BY-SA 3.0

If you desire to publish software that was adapted from CC-BY-SA source code, you can only do so under the terms of that license. In particular:

  • you must publish your software under that version of the CC-BY-SA or a compatible license,
  • you must provide proper attribution for the original source code,
  • you must not apply additional terms or restrictions, and
  • you must not apply technical restrictions such as DRM.

Note that these requirements may be at odds with the terms and conditions of some app stores.

Absent from the CC-BY-SA is the requirement to publish your source code. You can publish CC-BY-SA software in any format you like, including in compiled form. However, recipients of that software are free to reverse-engineer and decompile it, and to adapt that software. So while the CC-BY-SA is generally similar to the GPL, the CC-BY-SA does not require you to publish your preferred form of making modifications (the source code).

Note that most code on Stack Overflow is licensed under the CC-BY-SA 3.0. This means that such code cannot be copied freely, not even for open-source projects, unless they are licensed under a CC-BY-SA 3.0 compatible license (which, indirectly, includes the GPLv3).

  • In case someone chooses to publish the derived code as source... would it mean the code of the entire project must be published (including the code that does not depend from the derived work)? Or would it be sufficient to publish only the module/class/function that is actually based on the original work? Mar 8, 2019 at 23:45
  • 2
    @Silicomancer This is not entirely clear, but it would not seem sensible to treat the CC-BY-SA as fundamentally different from the GPL in this respect: both apply to the entire creative work, which is generally understood to be the entire program. In the end, what counts as a derivative work (Adapted Work in CC lingo) is for courts to decide. However, the GPL has additional requirements that extend to build scripts and upstream dependencies. If a user of CC-BY-SA covered code wants legal clarity, they should exercise their GPLv3 relicensing option.
    – amon
    Mar 9, 2019 at 12:27

The conditions for CC-BY-SA in the current version 4.0 (but 3.0 is the same) are specified on https://creativecommons.org/licenses/by-sa/4.0/ . They state:

If you [...] build upon the material, you must distribute your contributions under the same license as the original.

The complicated term here is "contribution". If you have a 200,000 lines commercial project and you include a 2,000 line CC-BY-SA library into it, is your big commercial project a contribution to that library? Well, I would say "no", and I go so far to say, that most people, including most lawyers and most judges, would answer "no" to that question.

A contribution is usually something, that people give with the intention to give and to improve a bigger piece of work. Both of that is not true for your library inside your bigger work. Yes, the 2,000 line CC-BY-SA library included in your 200,000 line work would clearly be a contribution to that work, but not the other way round. Your big work will in most cases not be considered a contribution to that library.

If you have a house and then you build a city, you would say, that the house contributed to the city, but you would not say, that the city contributed to the house.

Of course, if in the process of creating your work, you also improve on the library itself, that would usually be considered a contribution to the library. And then, you have to publish the improved library, even, if you use the whole work only for yourself, because you have build upon the library. Unlike LGPL, where you only need to publish source code of improved libraries, once you distribute a work containing that library, CC-BY-SA forces you to publish those works, that you contributed to, once you build anything (useful) out of them.

  • 3
    This is, at best, a very, very risky interpretation. Are you able to cite any actual cases where a court has made a ruling which is in line with your assertions? Apr 18, 2022 at 18:33
  • @PhilipKendall Can you cite a ruling, where a court has decided differently from what I said? I know a few rulings in favour of GPL, but they don't make the mistake of giving a short-hand description of their ruleset, that contradicts their full license.
    – Kai Petzke
    Apr 21, 2022 at 14:29
  • Your interpretation is out of line with the generally accepted consensus within the software community. The burden of proof is on you, not the community. Apr 21, 2022 at 14:31
  • The burden of proof is on the community. As long, as no court has ever ruled in favor of CC-BY-SA, people could as well directly publish it as public domain. Then they know at least, that they give away their rights. I strongly doubt, that the contradictions between the short-hand description of their ruleset and their full legalese will make CC-BY-SA court-proof. Sorry to say that.
    – Kai Petzke
    Apr 22, 2022 at 18:31
  • 1
    I don't know why so many downvotes for this answer. It is logical. Apr 19, 2023 at 15:37

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.