US Tax Tools

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.

01PURCHASE LOTS
Purchase lot 1
Purchase lot 2
02SALE
Proposed or completed sale
03BASIS & GAIN
Estimated basis assigned to this sale: $3,375. Estimated realized gain: $3,375.

Realized gain or loss

$3,375

Cost basis sold

$3,375

Net sale proceeds

$6,750

Long-term gain or loss

$3,375

Short-term gain or loss

$0

Remaining basis

$4,625

75 shares remain.

LotShares usedBasis usedHolding periodGain/loss
lot-175$3,375Long-term$3,375
Share

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 gain

Adjustments 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

Last updated July 27, 2026 Tax year Current federal basis rules

Data sources: IRS Publication 550IRS Topic No. 703

This tool is general information only, not financial advice.

Reviewed by USTax Tools Editorial Desk

Read our methodology →