Find the gain or loss on a sale of stocks, funds, crypto or other assets, then estimate the tax with your own short-term and long-term rates. Dates decide the holding period automatically.
Last updated:
Purchase & sale
$
$
Use 1 for a single asset like a property.
$
Commissions, closing costs; they reduce the gain.
Holding period
Holding period
Your tax rates
%
Often your ordinary income rate.
%
US federal: 0%, 15% or 20%.
%
Added to either rate, e.g. 3.8% NIIT.
Enter your values to see the result.
Advertisement
Advertisement
How to use the Capital Gains Calculator
Enter the purchase and sale price per unit and the quantity.
Add total fees such as commissions; they lower the taxable gain.
Enter the dates or pick the holding period directly.
Enter your short-term and long-term tax rates and any extra rate (state tax, surtax).
Calculate to see the gain, the tax estimate, net proceeds and return.
Capital gains formulas
Cost basis = purchase price × quantity + fees
Proceeds = sale price × quantity
Capital gain = proceeds − cost basis
Tax = gain × (short-term or long-term rate + extra rate)
Long-term rates depend on taxable income (IRS Rev. Proc. 2024-40). Short-term gains are taxed as ordinary income.
Rate
Single
Married filing jointly
Head of household
0%
up to $48,350
up to $96,700
up to $64,750
15%
$48,351 – $533,400
$96,701 – $600,050
$64,751 – $566,700
20%
over $533,400
over $600,050
over $566,700
A 3.8% net investment income tax may also apply above $200,000 of modified AGI for single filers ($250,000 married filing jointly). State tax rules vary.
Ways people legally reduce capital gains tax
Hold for more than a year to qualify for long-term rates.
Harvest losses: sell losing positions to offset gains (watch the 30-day wash-sale rule).
Use tax-advantaged accounts where gains are tax-deferred or tax-free.
Track your basis, including reinvested dividends and fees, so you do not overpay.
Frequently asked questions
How is a capital gain calculated?
Capital gain = sale proceeds − cost basis. The cost basis is what you paid plus purchase fees, and selling fees reduce the proceeds. This calculator adds all fees to the basis, which gives the same gain. Buying 200 shares at $50 and selling at $80 with $20 of fees gives $16,000 − $10,020 = $5,980.
What is the difference between short-term and long-term capital gains?
In the US, assets held for one year or less produce short-term gains, taxed at ordinary income rates. Assets held for more than one year produce long-term gains, taxed at lower federal rates of 0%, 15% or 20% depending on taxable income.
When does an asset become long-term?
The holding period starts the day after you buy. You need to hold it for more than one year, so you must sell after the one-year anniversary of the purchase date. Selling exactly on the anniversary is still short-term.
What tax rate should I enter?
Enter the rates that apply to you: for US federal tax, short-term gains use your marginal income tax bracket and long-term gains 0%, 15% or 20%. Add state tax and, for higher incomes, the 3.8% net investment income tax in the extra field. Other countries have different rules, so enter your own rates.
What happens with a capital loss?
There is no tax on a loss. In the US, losses first offset capital gains; up to $3,000 of net loss a year ($1,500 if married filing separately) can offset ordinary income, and the rest carries forward to later years.
Does this handle the home sale exclusion or depreciation recapture?
No. For a primary residence, US sellers may exclude up to $250,000 of gain ($500,000 for married couples) if they meet the ownership and use tests, and rental property may have depreciation recapture. Subtract the exclusion or adjust the rates yourself.
Is this tax advice?
No. It is an estimate based on the rates you enter. Actual tax depends on your total income, deductions, other gains and losses and local law.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.