I have code in a language and want to convert it automatically using a tool to another language. Is it considered a derivative work and should I follow the same license?

Does it matter if it is MIT license or GPL for instance?

  • 1
    For your second question "does it matter if it is MIT license or GPL" -- you would need to add what you want to do afterwards. MIT is permissive, so you can basically do anything (e.g. put it into a closed source product). With GPL you can do a lot, but there are more obligations (delivering the original source code, for example).
    – Brandin
    Sep 6, 2022 at 10:17

2 Answers 2


If you translate a project from one (programming) language to another by pure mechanical means, then you are creating a derivative work, but you are not vesting any (additional) copyright claims in the result.

Some examples of a translation by pure mechanical means are compiling source into binary format or transpiling between source formats. The common characteristic is that the process requires absolutely no creative effort from the person doing it.

This means that you can only do the translation if the license gives you the right to make derivative works and you are not allowed to change the license (as you have no copyright claim in the work, you have no standing to put license terms on it).

  • What are "mechanical means"? it is also a derivative, if you sit in front of your computer, the code of the original project in one window and re-implement it in another. Sep 7, 2022 at 8:17
  • 2
    @planetmaker, "mechanical means" means that the conversion does not take any creativity from the person doing the conversion. Transpiling, as mentioned in one of the comments, would be an example. Compiling source into binary form is another. Sep 7, 2022 at 10:04
  • @planetmaker The situation you describe, typing it out yourself by hand in another language, sounds to me like a mechanical process. It's a bit like translating sentences or a text by hand as part of a language course. That's mechanical but perhaps you'll inevitably add some creative elements as well into your own version. Even so, the result is still a derivative work of the original, though.
    – Brandin
    Sep 7, 2022 at 14:28
  • @Brandin, translating by hand most likely adds enough creativity to not be regarded a 'purely mechanical means' for copyright purposes. Sep 7, 2022 at 17:03

No, you stay bound by the license.

Porting code from one language to another is a derivative in a very similar manner than just taking the code and making modifications to it. As such you are bound by the original license.

It doesn't necessarily mean you need to use the same license, but you need to choose a license which fulfills all obligations put on you by the original license. Thus if the original license is GPL, you most likely want to choose GPL. However if it is a permissive one like MIT, you can virtually choose any, provided you abide by the requirement to display the original copyright.

  • 3
    I guess "No" in paragraph 1 means "No, it does not change the license."
    – Brandin
    Sep 7, 2022 at 9:11

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.