Cost basis is the original amount you paid for an investment, including fees. It’s used to calculate your gain or loss when you sell.
In most cases, it’s just the purchase price. But it can be adjusted in certain situations, like if you inherited the shares or the stock went through a split.
Your capital gain or loss is the difference between the sale price and your cost basis. That’s what the IRS uses to calculate your taxes.