I wrote a code that use a library release under CC BY-SA 4.0 (Attribution-ShareAlike 4.0 International).

As far as I understand, if I cite them and release the source code as well with my code I can charge money for my work. Am I right?

1 Answer 1


You may charge money for your software, though you must distribute your software under CC BY-SA 4.0 terms to anyone who buys it. The Creative Commons Non-Commercial (NC) licenses prohibit commercial use or sale, but CC BY-SA is not an NC license (vs. BY-NC or BY-NC-SA, which are NC licenses).

However, please note that Creative Commons licenses are discouraged for code. I understand that you did not choose the CC BY-SA license on the library, but you may license your work as a whole under the GPLv3, because CC BY-SA 4.0 is one-way compatible into GPLv3:

CC BY-SA 4.0 is one-way compatible with the GNU GPL version 3: this means you may license your modified versions of CC BY-SA 4.0 materials under GNU GPL version 3, but you may not relicense GPL 3 licensed works under CC BY-SA 4.0.

The GPLv3 is a much more suitable license for software, so if you are comfortable doing so, please license your finished product under the GPL and share the source code.

However, note that if you choose to keep the CC BY-SA license, you do not need to distribute the source code of your application. Strictly speaking, in order to comply with the BY-SA terms on the library, you can choose to distribute only the binaries under CC BY-SA 4.0 and choose not to distribute the source code. This is exactly one reason why Creative Commons expressly discourages the use of CC BY-SA (or virtually any Creative Commons license) on software.

  • 1
    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

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.