Stock Sale Tax Calculator
Work out the tax on a specific stock sale from share count, purchase price, sale price, and holding period.
Your details
Your situation
This calculator runs entirely on your device. Nothing you enter is uploaded, stored, or sold. How this works
Tax on this sale
$3,214
Net $33,836 in your pocket from $37,050 of proceeds
Includes your inputs, the full breakdown, and every row of the table.
Capital gain
$21,425
137.1% return on cost
Federal tax
$3,214
15% long-term rate
Effective tax on the gain
15.00%
Tax if sold short-term
$5,142
You saved $1,928
- Proceeds (250 × $148.20)
- $37,050
- Cost basis (250 × $62.50)
- - $15,625
- Capital gain
- $21,425
- Federal capital gains tax
- $3,214
- Total tax
- $3,214
- Net after tax
- $33,836
What this means
- Long-term treatment requires holding more than one year from the trade date, counting from the day after purchase.
- If you bought in multiple lots, you can choose which lot to sell. Specific identification usually beats the default FIFO method — tell your broker before the trade settles.
How the stock sale tax calculation works
A stock sale produces a capital gain or loss equal to proceeds minus cost basis. Basis is what you paid plus commissions, adjusted for reinvested dividends, stock splits, return-of-capital distributions, and — for equity compensation — the amount already reported as W-2 income.
Lot selection is the most underused tax lever in a brokerage account. If you accumulated shares over years, selling your highest-basis lots realizes the smallest gain. Brokers default to first-in-first-out, which for a long-held winner is exactly the worst choice.
Frequently asked questions
How is cost basis calculated?
Purchase price times shares, plus commissions. Reinvested dividends create new lots with their own basis. Stock splits divide the per-share basis without changing the total.
What if I have a loss?
Losses offset gains of the same character first, then the other character, then up to $3,000 of ordinary income per year. Anything left carries forward. Watch the 30-day wash sale window if you plan to buy back in.
Related calculators
Capital Gains Tax Calculator
Calculate short- and long-term capital gains tax, including the 3.8% net investment income tax and state tax.
TaxRSU Tax Calculator
Estimate withholding at vest, the gap versus your actual tax rate, and capital gains if you hold the shares.
RetirementESPP Calculator
Calculate the discount, guaranteed return, and tax treatment of an employee stock purchase plan with a lookback.
RetirementFederal Income Tax Calculator
Estimate your 2025 federal income tax, effective rate, marginal bracket, and refund or balance due.
TaxSpotted a problem, or want this calculator to do more?Corrections are fixed first, and the most-requested features get built next.Tell us →
Disclaimer. This calculator is provided for general information and educational purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Results are estimates based on the inputs you provide and the assumptions described above. Confirm any figure with a qualified professional before acting on it.