What avenues exist for licensing software code to one&#39;s employer while retaining the rights to use it in other projects?
<p>Let's say someone works on personal software projects on their own time while also working for a software company. One day a situation arises such that the source code of one of these personal projects would be very useful within the context of the employee's primary job.</p>
<p>What legal avenues exist for the employee to include the source code in the employer's codebase while also retaining the right to use the source code in future projects of their own?</p>
<p>Let's also say, the employer is based in NY and the employee works from home in MA. And, there's no clause in their job contract that would imply the employer automatically gains the rights to code the employee writes on their own time.</p>
<p>One such avenue would probably be to release the source code as open source under the MIT license, for example. This should work, but presumably will require that the the employer permanently include the MIT license text inside their codebase if the source code needs to be altered to fit their needs.</p>
<p>Are there other ways?</p>

<p>First it must be established that this is not a work for hire. Since the guy is hired to write code for the company, this is non-trivial, but doable. Since the company has no claim to owning the copyright, the employee can treat his employer just like he would treat any other customer: he would license the use of the code, while retaining copyright. Then it just depends on how he wants his software to be used. You can completely give it away, you can use the MIT license if you like that, or one of the CC licenses; GPL; or write your own. You have to decide what you want to allow or prohibit before you can pick a specific license.</p>

<p>I actually did this, some years ago. I was working full-time as a software developer, and had created and published as shareware some file manipulation utilities, not related to the primary business of my then employer. Then a situation arose where the functions of those utilities would be useful to the employer. Since the employer was a sole proprietor, not a large corporation, we came to a simple agreement where the employer licensed the code for $1.00 and I incorporated the code without its interface into the employee's product. From later experience, a corporate employer would probably not have agreed to this, although you never know.</p>

software licensing open-source-software