Cost Basis Calculator
Combine multiple stock purchase lots, fees, and split adjustments, then allocate a partial sale using FIFO or a highest-cost planning comparison.
Realized gain or loss
$3,375Cost basis sold
$3,375Net sale proceeds
$6,750Long-term gain or loss
$3,375Short-term gain or loss
$0Remaining basis
$4,62575 shares remain.
| Lot | Shares used | Basis used | Holding period | Gain/loss |
|---|---|---|---|---|
| lot-1 | 75 | $3,375 | Long-term | $3,375 |
From basis to capital-gains tax
Cost basis determines the gain or loss, but not the tax by itself. Short-term gains are generally taxed at ordinary income rates. Long-term gains use separate 0%, 15%, or 20% brackets and may also face the 3.8% net investment income tax.
Calculate tax on this gainAdjustments this calculator does not automate
Wash-sale adjustments, return of capital, inherited-property step-up, gifted-property dual basis, employee stock compensation, mutual-fund average basis, partnership basis, and cryptocurrency transfers need additional records. Enter their already-adjusted lot cost where appropriate.
Cost basis questions
How do I calculate stock cost basis?
Start with the purchase price of the shares, add purchase commissions or fees, and adjust for stock splits, reinvested dividends, return of capital, wash sales, gifts, or inheritance when applicable.
Does a stock split change total cost basis?
A stock split changes the number of shares and basis per share but generally does not change the total basis. A 2-for-1 split doubles shares and halves basis per share.
What is FIFO cost basis?
FIFO treats the earliest purchased shares as sold first. If you want specific identification, you generally must identify the shares to the broker at the time of sale and receive confirmation.
Are brokerage fees included in basis?
Purchase commissions and fees generally increase basis. Selling expenses generally reduce sale proceeds. Both reduce the realized gain or increase the realized loss.
Sources
Related Calculators
Capital Gains Tax Calculator
LTCG 0/15/20% rates + 3.8% NIIT based on income brackets
Wash-Sale Calculator
Disallowed loss, 30-day rule, basis adjustment tracking
Capital Loss Carryover Calculator
Net your short and long-term gains and losses, apply the $3,000 deduction limit ($1,500 MFS), and see the Schedule D carryforward