Search the Bitcoin Core source code for a constant that limits supply to 21 million and you will find one. Read the comment above it and you will find something surprising: the developers say plainly that it is not the total money supply.

The famous cap is not enforced by a single number. It falls out of arithmetic: a starting reward, a rule that halves it, and the fact that bitcoin cannot be split forever. Run that math to the end and you do not get 21 million. You get 20,999,999.9769.

And the amount anyone will ever be able to spend is lower still. Here is where every one of those coins comes from, and where a few of them went.

The Constant That Is Not the Cap

Bitcoin Core does contain MAX_MONEY, set to 21,000,000 BTC. But the comment in amount.h calls it "a sanity check," used to reject any single amount that is impossibly large. It adds that the actual supply "currently happens to be less than 21,000,000 BTC for various reasons."

The real supply rule lives in a function called GetBlockSubsidy. It starts at 50 BTC, counts how many 210,000-block intervals have passed, and halves the amount once per interval. (Why the interval is 210,000 blocks and how each cut has played out is covered in The Halving, Explained.) Every node runs this function on every block. A miner who pays itself more than the result plus fees has its block rejected.

Analogy: Imagine pouring water into a glass, but each pour is exactly half the last one. One cup, then half a cup, then a quarter. You can keep pouring for a very long time, but the glass never gets past two cups. Nobody had to put a lid on it. The pattern itself is the lid.

The Math: Where 21 Million Comes From

Each era lasts 210,000 blocks, so the first era issued 210,000 × 50 = 10.5 million BTC. Every era after issues half the one before. Ten and a half million, plus five and a quarter, plus about 2.6, and so on: the series adds up to twice the first term, which is 21 million.

After this halvingApprox. yearTotal issuedShare of final supply
1st (block 210,000)201210,500,000 BTC50%
2nd (block 420,000)201615,750,000 BTC75%
3rd (block 630,000)202018,375,000 BTC87.5%
4th (block 840,000)202419,687,500 BTC93.75%
5th (block 1,050,000)~202820,343,750 BTC96.875%
7th (block 1,470,000)~203620,835,937.5 BTC99.2%
33rd (block 6,930,000)~214020,999,999.9769 BTC100%

These totals follow directly from the code. By that same arithmetic, the 20 millionth bitcoin was issued in block 939,999, mined on March 9, 2026. Fewer than 1 million bitcoin remain to be created, and they will trickle out over the next 114 years or so.

Timeline of Bitcoin supply milestones: the genesis block in January 2009, half of all bitcoin issued by November 2012, the 20 millionth bitcoin in March 2026, over 99 percent issued around 2036, and the final satoshi of subsidy around 2140.
Most of the supply arrived in the first few years. The last 1 percent takes more than a century.

Why the Real Maximum Falls Short

The code does not work in bitcoin. It works in satoshis, where 1 BTC equals 100,000,000 satoshis (the smallest unit, explained in What Is a Satoshi?). Halving is done with a right bit shift, which always rounds down to a whole satoshi.

Early on, rounding changes nothing: 50 BTC halves cleanly to 25, then 12.5, then 6.25. But at the 10th halving, around 2048, the subsidy no longer divides evenly, and every era after that drops a fraction of a satoshi per block. Those fractions add up to 2,310,000 satoshis, or 0.0231 BTC, across the whole schedule. That is why the arithmetic ends at 20,999,999.9769 instead of 21 million.

The Last Bitcoin, Around 2140

The schedule ends quietly. After the 32nd halving, at block 6,720,000, the subsidy is a single satoshi per block, and the last block to pay any subsidy is 6,929,999. At block 6,930,000, the 33rd halving, the shift produces zero. Bitcoin Core also forces the subsidy to zero after 64 halvings to avoid undefined behavior in the code, but the math has hit zero long before then.

At 10 minutes per block, block 6,930,000 lands around the year 2140. The exact date depends on how fast blocks actually arrive over the next century, so treat it as an estimate. After that, miners earn only transaction fees, which the whitepaper anticipated: once a predetermined number of coins have entered circulation, the incentive can transition entirely to fees.

Coins That Exist but Can Never Move

The arithmetic gives the maximum ever issued. A few coins inside that total are permanently unspendable, by accident or design:

  • The genesis block's 50 BTC. Bitcoin Core skips the first block's coinbase transaction when building its record of spendable coins, so those 50 BTC can never be spent.
  • Two duplicated coinbase transactions. In November 2010, blocks 91,842 and 91,880 contained coinbase transactions identical to earlier ones, overwriting them. BIP30, which banned duplicate transactions, grandfathered these two blocks in. The overwritten 100 BTC is gone.
  • Underclaimed rewards. A miner can legally pay itself less than the full subsidy plus fees. Whatever it leaves on the table is never created.

On top of that, an unknown number of coins sit in wallets whose keys are lost. No reliable count exists, and anyone quoting a precise figure is estimating.

Can the Cap Be Changed?

Technically, it is software, so anything can be rewritten. In practice, raising the supply would require the people running nodes to install new rules that their own copies currently reject. Any block paying an extra coin would be invalid to every node that did not upgrade. Who holds that veto is the subject of Nodes vs. Miners, and it is why the schedule has held through every fight in Bitcoin's history.

What This Means for You

  1. The supply curve is public math. You can compute exactly how much bitcoin will exist at any future block height, today, without trusting anyone.
  2. Most of the supply already exists. With about 20.1 million issued by October 2026, new issuance is a small and shrinking flow.
  3. The true maximum is below 21 million. It is 20,999,999.9769 at most, minus coins that are provably unspendable and coins whose keys are lost.
  4. Think in satoshis for small amounts. The units reference shows how BTC, millibitcoin and sats relate.

Twenty-one million is the headline. The code was always a little stingier.