I'm developing a tool that generates code from some various data. The tool itself will be licensed with the MIT license, which strikes a good balance for me in terms of allowing the freedom to use and modify it, while still holding the copyright.

OK, but what is the legal status of the code generated by the tool? Who holds the copyright for code generated by a tool? Do I need to give users of the tool a license for the generated code, or do they already have that by virtue of it being generated by them?

What is different about this code generation system (which may be relevant) is that the source information about the code generation is provided by the system itself. The user doesn't feed source data in; the source data is bundled along with it. They simply have the means to transform it in various ways (filtering out parts of the data they don't want, etc). Obviously they could edit the bundled data. Does that affect anything about this?

  • IANAL but it seems to me that the status of the source data is clearly relevant. If you use a FOSS compiler to compile your code (source data) into a binary, there are no restrictions on the binary. Or a FOSS JavaScript minimizer, the output JavaScript is yours. Or if you use a FOSS spreadsheet to analyse your own data, the output analysis is yours.
    – MarkJ
    Oct 27, 2012 at 18:02

2 Answers 2


The Free Software Foundation addresses this in their FAQ

Is there some way that I can GPL the output people get from use of my program? For example, if my program is used to develop hardware designs, can I require that these designs must be free?

In general this is legally impossible; copyright law does not give you any say in the use of the output people make from their data using your program. If the user uses your program to enter or convert his own data, the copyright on the output belongs to him, not you. More generally, when a program translates its input into some other form, the copyright status of the output inherits that of the input it was generated from.

So the only way you have a say in the use of the output is if substantial parts of the output are copied (more or less) from text in your program. For instance, part of the output of Bison (see above) would be covered by the GNU GPL, if we had not made an exception in this specific case.

You could artificially make a program copy certain text into its output even if there is no technical reason to do so. But if that copied text serves no practical purpose, the user could simply delete that text from the output and use only the rest. Then he would not have to obey the conditions on redistribution of the copied text.

I believe this applies to any Copyrighted work not just GPLed code. The output is not typically a derived work unless it includes substantial parts of the copyrighted work.

That said if the source data is under the MIT license and is included verbatim in the output then the output may be covered by the MIT license as a derivative work, but if the source data is transformed in substantial ways then the output would probably not be covered as a derivative work.

  • That raises an interesting point: I have no idea what the source data is licensed under. The source data itself is just a transform of the publicly available OpenGL specification files. There is no licensing information on these files, so I'm not even sure whether I can license them under the MIT. Oct 27, 2012 at 18:07
  • Facts cannot be copyrighted, similarly APIs cannot by copyrighted (the specific implementation may be copyrighted though). My guess is that those spec files are copyrighted but the facts embodied in them are not. That said, unless you have a reason not to, I would explicitly exempt the output from your source code's license, and if you do want the output covered by your license you probably need to talk to the OpenGL people.
    – Craig
    Oct 27, 2012 at 18:46
  • OK, so what is the ownership of the output code in that situation? Does it belong to the OpenGL ARB/Khronos, who publishes the spec files? Oct 27, 2012 at 20:17
  • Legally, I have no idea. My guess is the output is not covered by the source code license. From a practical standpoint, until money is involved it is likely that no one will care. And once money is involved, make sure it is enough to pay a lawyer to answer these questions.
    – Craig
    Oct 28, 2012 at 1:26

I don't know too much about your tool, but it sounds similar to what the "bake" utility in CakePHP framework does. The CakePHP bake command similarly builds an entire working application using some non-code input from the user.

This is the CakePHP license:

CakePHP is licensed under the MIT license. This means that you are free to modify, distribute and republish the source code on the condition that the copyright notices are left intact. You are also free to incorporate CakePHP into any Commercial or closed source application.

IANAL, but I think that the license that applies to CakePHP could possibly apply to your tool as well.

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.