Investing in stocks can be lucrative, but when you do make money, you must pay taxes on the profits. Therefore, it is important to calculate the cost basis of any stock you sell. Knowing how much you paid for the stock originally is essential, because that total cost basis allows you to accurately compute your capital gain or your loss on the stock.
Find a copy of the purchase confirmation you received when you bought the stock. Add the brokerage commission to the price of the stock to determine the full purchase price.
Review any statements you received indicating dividend payments. Add those dividend payments to the cost basis you calculated in the first step. You already paid taxes on these dividends, so you need to include them when you calculate your cost basis.
Check the confirmation you received when you sold your stock. Subtract the brokerage commission you paid when you sold the stock from the proceeds from the sale.
Subtract the original cost basis of the stock you sold from the proceeds of the sale you calculated in step 3. If the proceeds are more than the cost basis, you have a capital gain, and if the stocks are held within a taxable account, you need to pay taxes on that gain. If you have a capital loss, you can write off part of that loss on your taxes.