Who owns the code you wrote for a client?
Whoever the contract says, and in the absence of a contract the answer varies by jurisdiction. In the US and UK a freelancer who signs nothing generally retains copyright while the client gets an implied licence to use the work. An assignment clause or a work made for hire clause moves ownership to the client. Employment is the exception: what employees write for their employer usually belongs to the employer by default.
This is the question that decides whether anything else on this site applies to you, and most developers have never actually checked the answer for their own work.
This page is not legal advice. It will tell you what to look for and what the terms mean. It cannot tell you what your specific contract does, because that depends on its wording and on where you signed it.
The default, if nothing was signed
Copyright arises automatically in the person who wrote the work. It does not transfer because someone paid for it.
So a freelancer who wrote code, invoiced for it, and signed nothing generally still holds the copyright. The client, having commissioned and paid for the work, typically gets an implied licence to use it for the purpose it was obviously made for. They can run it. What they usually cannot do, absent agreement, is claim the copyright itself.
That is the general shape in both the US and the UK. It is also the least certain position to be in, because the scope of an implied licence is exactly the thing people end up arguing about.
Employment is different. Code written by an employee in the course of their employment generally belongs to the employer by default, no clause required.
who wrote it, and what was signed? │ ├── employee, in the course of employment ──► employer owns │ ├── contractor + assignment clause ─────────► client owns │ ├── contractor + work made for hire ────────► client owns, usually │ ├── contractor + services agreement, │ no IP clause ─────────────────────────► you own, they licence │ └── contractor, nothing signed ─────────────► defaults apply, low certainty
The clauses that change it
Go and find the agreement. You are looking for four things.
Assignment. Wording like “Contractor hereby assigns to Client all right, title and interest”. This is the one that actually moves copyright. It is usually effective and usually total.
Work made for hire. In the US this refers to a specific statutory category, and commissioned software frequently does not fall within it. That is why well-drafted agreements say work made for hire and, if that fails, assignment. If yours says only work made for hire, the position may be less settled than the client assumes. In the UK the term has no equivalent statutory meaning and assignment is the operative mechanism.
Licence back. Wording letting you continue to use what you assigned, sometimes limited to general skills, tools, and know-how. If you have this, you may retain usable rights even after a full assignment. Read its scope closely, because it is often narrower than it first appears.
Pre-existing and background IP. Carve-outs for your own libraries and tooling that predate the engagement. Frequently the only part of a delivered project that remains cleanly yours.
┌─ WORTH CHECKING ─────────────────────────────────────────────────────┐ │ │ │ Private, finished, owned by you, and doing nothing. │ │ │ │ [ See what your repos are worth ] │ │ │ └──────────────────────────────────────────────────────────────────────┘
Reading an agreement you have already signed
A practical order of operations.
Search the document for “assign”, “ownership”, “title”, “work made for hire”, “licence”, “license”, and “intellectual property”. Those seven terms will find almost every relevant clause.
Establish what was assigned. All deliverables, or only specific ones? Some agreements assign only the final delivered application and leave tooling, scripts, and infrastructure code untouched.
Establish when it was assigned. Some assignments are conditional on full payment. If a client never paid the final invoice, ownership may never have moved. This happens more often than people realise.
Check for a survival clause, and check whether any licence back survives termination.
If you cannot find the agreement at all, treat that as the answer for licensing purposes. The warranty you would be giving is uncapped, and “I am fairly sure it was fine” is not a basis for it.
Where this leaves most people
Better than they expect, once they separate the piles.
Client work under a full assignment is out. That is often the largest pile by volume and there is nothing to be done about it.
But almost everyone also has: their own products, internal tools built to run their own business, R and D that never shipped, prototypes, and engagements governed by a plain services agreement with no intellectual property clause at all. That last category is more common in small and informal engagements than people assume.
The work is separating the piles honestly, once. It does not need repeating.
The rule worth holding
If you cannot say without hedging that you own a repository or hold the right to license it, it does not go in. Not because the rules are punitive, but because the warranty attached to submitting it is real, uncapped, and relied on by buyers.
Certainty is cheap here and optimism is expensive.
What to read next
- Work for hire versus license, the difference in detail
- IP clauses in software contracts, what to negotiate next time
- What disqualifies a repo, the full eligibility filter
Common questions
- If I was paid for the work, does the client own it?
- Payment alone does not transfer copyright. Ownership moves by written assignment, by a valid work made for hire arrangement, or by employment. A client who paid an invoice and signed nothing else has generally bought the use of the work, not the copyright in it.
- What if there was no contract at all?
- Then you are relying on default rules and on what a court would infer from conduct, which is the worst position for certainty. A freelancer usually retains copyright with the client holding an implied licence, but the scope of that licence is exactly what gets argued about.
- Does a work made for hire clause always work?
- Not automatically. In the US the statutory category is narrow and commissioned software often does not fall inside it, which is why careful agreements pair the clause with an outright assignment as a fallback. In the UK the concept does not exist in the same form and assignment is the mechanism.
- Can I reuse code from a client project on another project?
- If you assigned the copyright, not without permission or a licence back. This is the most common accidental breach in freelance software work, and the reason a licence-back clause is worth asking for.
- What about code I wrote as an employee?
- It generally belongs to your employer if it was written in the course of your employment. Side projects on your own time and equipment are a separate and frequently disputed question governed by your employment agreement.