I'm still unclear about licensing. If I have a project on Github that's licensed under GPL and found pseudocode on a Stack Overflow question, must I now dual license my code on Github and GPL as Creative Commons? The idea conveyed in the pseudocode is good yet simple.

The reason I think this is because Stack Exchange is licensed under Creative Commons Share Alike, which is a viral licensing scheme.


1 Answer 1


I was wondering this same thing not too long ago. I ended up finding that CC-BY-SA 3.0 is one way compatible with CC-BY-SA 4.0, which is one way compatible with GPLv3.

Therefore, you can relicense what you find at StackExchange under GPLv3. This helps immensely in including SE-found code in a GPL project, because you won't be able to dual-license that project back into CC-BY-SA.

EDIT: There's one (small) caveat to this: according to the license text, you can't just relicense it willy nilly, you must adapt it first. See this question for more information (thanks to unor for pointing this out). However, including the source code in a larger project would be classed as adaption, IMO - just don't try to relicense only that source code you've found, verbatim, with nothing else along with it.

EDIT 2: If the code isn't copyrightable at all - i.e. it's an idea; it's not original enough etc. - then do what you like without restrictions! This answer on meta covers the options.

It's also worth noting that some people on StackExchange apply non-viral licenses (such as MIT, or even public domain dedication) to their posts in their profiles, which gives you more freedom for their code too (providing it is their original code).

Others may happily give you permission if you ask them. :)

This should still all be done at your own risk though, because you don't actually know for sure where code posted on StackExchange has originally come from.

  • According to this thread all code posted after Feb 1, 2016 is licensed under the permissive MIT license, so I guess this is a non-issue. Unfortunately the question linked to was made before that. However, can pseudocode be copyrighted? It's my understanding algorithms can't be and pseudocode is a bare representation of the algorithm. Jun 13, 2016 at 9:13
  • @inertiablobby That proposal didn't go ahead due to backlash. The licensing link in the footer of every page on the site is still CC-BY-SA 3.0 :) Re psuedocode being copyrightable... I think it still would be, it's basically a program design. Unless of course it's so short that it's simple enough to have no creativity to it.
    – Tim Malone
    Jun 13, 2016 at 9:16
  • You may only license Adaptations under CC BY-SA 4.0 (and then again GPLv3). See: What counts as adaptation for using code licensed under CC BY-SA 4.0 in software licensed under GPLv3?
    – unor
    Jun 13, 2016 at 15:10
  • Thanks @unor, I've added a clarification to the answer. In the case of this question, including the code in a larger project would class as adaption anyway, but it is important to note the requirement.
    – Tim Malone
    Jun 14, 2016 at 0:28
  • Your answer is correct for code. However, it is wrong for ideas. Ideas cannot be copyrighted. The written code is similar to an expression, and can hence be copyrighted. However, the idea on how to do something cannot - it is not an expression. This is similar to facts - the fact itself is not subject to copyright, but the way it is expressed is copyrightable.
    – Zizouz212
    Jun 14, 2016 at 1:18

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.