Skip to content
codelicenses Earn $500+ per repo

What is dual licensing?

Dual licensing is offering the same code under two licences at once, typically a strong copyleft licence for anyone who accepts its conditions and a paid commercial licence for anyone who does not. It works only if the licensor owns every line, which is why dual-licensed projects require contributor licence agreements.

Updated 23 September 2026


Dual licensing sounds like a contradiction until you remember what a licence is. It is permission, granted by the owner. An owner can grant permission on different terms to different people, and there is no rule that says only once.

How it works

You publish the code under a strong copyleft licence, usually GPL or AGPL. Anyone can use it for free, on the condition that derivative works are released under the same terms.

Commercial users often cannot accept that condition. They want to embed the code in a proprietary product, or run it as a service without releasing their own stack. So you offer them a second licence, on commercial terms, for a fee. Same code. Different permission.

The copyleft licence is chosen because it is the one commercial users most want to escape. A permissive licence would give them everything for free and there would be nothing to sell.

Why it needs a CLA

Here is the constraint that most projects discover too late.

The commercial licence can only be granted by whoever holds the rights. If you wrote every line, that is you. The moment you accept an outside contribution, that contributor holds the copyright in their contribution, and they granted it to the world under the copyleft licence, not to you under anything else.

You now cannot offer a commercial licence covering their code, because you do not have the right to.

The fix is a contributor licence agreement: before accepting a contribution, the contributor assigns the copyright to you, or grants you a licence broad enough to relicense. Every serious dual-licensed project has one, and every project that adds one late spends months chasing past contributors, some of whom say no.

Ownership is the whole game. This is the same principle that governs whether you can license code to anyone at all, and it is why who owns the code is the question this site keeps returning to.

┌─ WORTH CHECKING ─────────────────────────────────────────────────────┐
│                                                                      │
│  Private, finished, owned by you: $500+ each to AI labs.             │
│                                                                      │
│  [ See what my repos are worth ]                                     │
│                                                                      │
└──────────────────────────────────────────────────────────────────────┘

Dual licensing versus the neighbours

Open core. A core product is open, add-ons are proprietary. Different code under different licences. Commercially similar, structurally unrelated.

Source-available. One licence, restrictive, with the source visible. BUSL and SSPL are the common ones. No free copyleft option at all. Covered in software license types.

Relicensing. Changing the licence on future versions. A one-time move, not a standing offer, and it does not touch copies already distributed.

Dual licensing is the only one of these where the same code is simultaneously available on two sets of terms.

What it means for contributors

Read the CLA before signing it. You are usually assigning your copyright or granting a licence that lets the project sell your work commercially without paying you. Many contributors are fine with that; some are not; either way it should be a decision rather than a click.

If a project has no CLA and is not dual licensed, your contribution is governed by the project licence and nothing else.

The idea underneath

Strip dual licensing to its core and it is this: an owner keeps the code and grants non-exclusive permission to more than one party, on different terms. The code is never sold. It is licensed, repeatedly.

That is exactly the model behind licensing source code to the labs that train coding models. The owner keeps the code and every right to it. The lab receives a non-exclusive licence to train on it. The same repository can be licensed again to a different lab, and the owner is paid each time. Nothing is published.

Dual licensing is the familiar version of that idea. If it makes sense to you that a company can give code away under the GPL and sell it to Oracle in the same afternoon, then it should make sense that you can keep a private repository and license it to more than one buyer.

The difference is that there is no free half. Nothing is released. Which is what makes it work, since published code has already been collected and has nothing left to license. That is covered in can you license private repositories, and what it comes to is on what AI labs pay for code.

Common questions

Why do dual-licensed projects need a contributor licence agreement?
Because the commercial licence can only be granted by someone who holds the rights. Accept one outside contribution without an assignment or a broad licence back, and that contributor now co-owns part of the code, and you can no longer offer a commercial licence covering it.
Is dual licensing the same as open core?
No. Open core keeps a core open and sells proprietary add-ons: different code under different licences. Dual licensing offers the same code under two licences. They are often confused because both are ways of charging for open source.
Can I dual license a project that already has contributors?
Only with each contributor's agreement, or by rewriting their contributions. Projects that add a CLA late usually have to chase down every past contributor, and some refuse.
Which licence pairs are typical?
A strong copyleft licence, GPL or AGPL, as the free option, paired with a commercial licence. Copyleft is the free licence precisely because it is the one commercial users most want to avoid, which is what makes the paid licence worth paying for.
Is licensing code to AI labs a form of dual licensing?
Structurally it is the same idea: the owner keeps the code and grants non-exclusive licences to more than one party. The difference is that nothing is published. It is dual licensing without the free half.

WORTH CHECKING

Earn $500+ on every repo you never open.

Private, finished, owned by you: $500+ each to AI labs.

Non-exclusive, so you keep the code and are paid again on every re-license.

See what my repos are worth