I have code from a closed-source personal project of which I am the sole author. At work, I have come across situations where the code is useful.

I want to take a significant amount of code from my personal project, and put it in my company's code base. I am fine with them having full use without restriction of this code. However, I don't want them to have a legal right to the personal project from where this code came.

I believe I can publish this code under an MIT (or other) license before I put it in the company's code base and be fine, or even write some comments in a read.me. But I'm moreso wondering what happens if I just directly put the code in there.

If I put code from my personal project into the company's code base, what happens with the ownership of my personal project?

  • This sounds like a question better suited for Law or The Workplace. Commented Feb 3, 2018 at 14:17
  • 1
    "What happens" would be off-topic for The Workplace. However, this feels like an X-Y problem: if what you want is both you and your employer to have some rights to the code, just tell them that and let them sort it out. Commented Feb 3, 2018 at 14:52
  • I am not going to answer, it is a simple legal question. However you can have any licence you want for your personal project: GPL anything. Commented Feb 8, 2018 at 13:32
  • 2
    As the sole author of the work you can share the code under any terms you wish. The more pertinent point will be the way you do it. If you just copy the code into place during work hours then it could fall under your terms of employment as if you had written it at work, so that might give them ownership, which would only apply to the code you give them, not your entire project. I would say it would be easier to release your project as an open source library under MIT and have your work project link to it the same as you would any other third party project.
    – sambler
    Commented Feb 9, 2018 at 15:55
  • Is it code you developed entirely before being employed there? Or code you developed while you worked on there, but on your own time? It can make a big difference (in your assumption that you own it in the first place) depending on where you live and the specifics of your employment agreement and any IP agreements you signed when you started working there. Commented Feb 9, 2018 at 22:56

1 Answer 1


I've come across this situation several times as a consultant. First, goto
and set up an account and register the copyright for your code.
Officially and legally. Now there's no question who owns its copyright.

Now, go to your employer and openly discuss it with him, saying he can have unlimited free use of your code. If he goes for that, then fine. Case closed. If not, say you can re-develop the same algorithm on his dime, clean-room-like, so to speak. And then he'll own the newly developed version's copyright.

Note that you never "owned" the algorithm by registering a copyright, just the particular expression of that algorithm the specific way you've coded it. Somebody else can re-code the same algorithm, even if you invented that algorithm, and they can separately register the copyright for their code version. And that "somebody else" can even be you, yourself. Then the original version would be yours, to gpl or whatever you liked. And the second version would be your employer's proprietary version. Kinda silly. And every time I've come across this kind of situation, the project manager has been happy to accept a verbal "unlimited use license" from me. So I'd guess you're worrying needlessly (but no guarantee:).

If you wanted to own the algorithm, so to speak, you'd have to patent it, which is a way bigger pain in the neck than simply copyrighting your code, which takes maybe fifteen minutes on eco.copyright.gov (and maybe $35USD for online registration).

  • 2
    Registering for copyright is not generally necessary, and is U.S.-specific. Registering has two uses: (1) creating an external record of the copyright, and (2) being able to collect damages in case copyright infringement is litigated. Both of these are of very limited value to the OP. The middle part of your answer – discussing a license to the existing code with the employer – is of course a very good idea.
    – amon
    Commented Feb 10, 2018 at 13:14
  • @amon "not generally necessary" is generally correct, in my experience, but >>it can't hurt<< has always been my philosophy about it. After spending months or longer and maybe thousands of hours developing something, just goto eco.copyright.gov and spend another 15 minutes to copyright it. Just in case. In case of what, I'm not entirely sure. But my advice to everybody, under all circumstances, is to copyright every non-trivial thing you ever write. You'll never regret doing it because there's nothing to regret. But you might someday regret not doing it for some as-yet-unforeseen reason. Commented Feb 11, 2018 at 4:33
  • @JohnForkosh: As soon as you write down/type in the results of your thoughts, it is protected by copyright. Those fifteen minutes are then only to record with a third party when you committed those thoughts to tangible form. Commented Feb 11, 2018 at 19:57
  • @BartvanIngenSchenau In >>principle<< you're more-or-less correct. But in >>practice<<, if the matter comes under dispute, the courts look very favorably on you for demonstrating your intent by registering the copyright before infringement occurs. And, anyway, like I said above, >>it can't hurt<<, which you're not disputing. Commented Feb 12, 2018 at 5:56

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.