Can you sell a GitHub repo?
Yes, if the code is yours. A private repo can be licensed to AI labs, which pay for the code and its git history. Pangea pays $100 per million tokens of source and $40 per million tokens of history. A public repo can't be sold as code, since anyone can copy it, but the product built on it can.
| Your repo | Where it sells | What sets the price |
|---|---|---|
| Private, code you own | A license to AI labs | Its size and git history |
| A plugin, script or game asset | A marketplace that sells copies | Your price, minus their cut |
| An app with users | A site that sells businesses | Its revenue and users |
| Public | Sponsorships, or the app you run on it | Who uses it |
A private repo is priced by its tokens
Pangea pays per token, so the figure follows how much code you wrote and how long you worked on it. A line of code is about ten tokens, so a thousand lines of source come to about $1. History pays on top, and in a repo with a few years of commits it's usually most of the value. Stars, forks and followers don't change the rate.
Type your username on the home page to see a figure for each repo. Private repos are counted in your browser, and source vs history explains the two parts.
AI labs won't take every repo
- A repo that was ever public.
- A fork.
- Code written for an employer or a client.
- Code someone else holds rights to, such as a co-founder with no IP assignment or a contractor who kept copyright.
Buyers publish these rules, for example on Pangea's code licensing page. The license is non-exclusive, so you keep the repo and can license it again.
Copies and whole apps sell on marketplaces
A plugin, script or game asset sells as copies. CodeCanyon takes 50% of your item price. The Unity Asset Store pays you 70% and turns away packages that depend on GPL or LGPL code. Fab, Epic's marketplace, pays you 88%.
An app with users sells as a business, with its code, users and domain. Flippa listings start at $29, with a 10% fee when it sells. Acquire.com and Microns.io charge 6% to 10% when it sells. The price follows revenue, not code.
Dataconto compares the places to sell code, with fees and catches.
Check three things before you sell
- It's yours. Buyers and marketplaces make you promise you hold the rights.
- The history is intact. Squashing or rewriting history removes the part AI labs pay most for.
- Old keys are dead. Rotate any key or password that was ever committed. Pangea scrubs secrets from its copy, but anyone reading the history can see them.
Questions
Can I sell a public GitHub repo?
Not as private code. Anyone can already copy it, and buyers take only code that was never public. You can sell the app or service built on it, or take sponsorships.
Can I sell a repo I forked?
Not as a license to AI labs. The code you forked belongs to someone else.
Can I sell code I wrote at work?
Usually not. Code written for an employer or a client normally belongs to them, even if it sits in your account.
Can I sell AI-written code?
No. Since November 2026 the AI labs don't take it. Code from 2025 on is marked a low likelihood until you explain how it was built, so code people wrote with AI tools helping can still go in with a note.
Do I lose the repo if I license it?
You keep it. The license is non-exclusive: the buyer gets a copy, and you keep the repo, keep shipping it and can license it again.
Does a repo need stars to be worth something?
AI labs price code by its tokens, so stars, forks and followers don't change the rate.
Rates and rules from Pangea's code licensing page, checked November 20, 2026. Marketplace fees from each company's own pages, checked October 28, 2026, listed with links on Dataconto.