What creates a capital gain
A capital gain usually starts with the amount you realize from the sale, reduced by selling costs such as commissions or certain transaction fees. From that net proceeds figure, you subtract the asset’s cost basis to determine whether you have a gain or a loss.
Cost basis is not always just the original purchase price. Depending on the asset, basis can be adjusted by reinvested amounts, certain improvements, splits, or prior tax adjustments. That is why calculators in this category work best when you already know the basis figure you need to test rather than when you are still trying to reconstruct it from account history.
Net proceeds = Sale price - Selling costs
The sale amount that matters for capital-gains tax is what remains after allowable selling costs are deducted from the gross selling price.
Realized gain (or loss) = Net proceeds - Cost basis
Comparing net proceeds with basis determines whether the transaction produces a gain or a capital loss.