The last block of bitcoin will be generated in the year 2140 and will be block number 6,929,999. After that block is mined, there will be slightly less than 21 million bitcoins in existence, 20,999,999.9769 to be exact.