Home / Tools / Capital Gains Tax

Capital gains tax calculator

Estimate the US federal tax on selling stocks or other assets — short-term vs long-term — by income and filing status, plus your net proceeds and effective rate. Free, private, and calculated right in your browser.

2024 brackets · Last updated: 18 June 2026

An estimate, not tax advice

This tool gives a simplified federal estimate for educational purposes only. Results vary enormously by jurisdiction and situation — state taxes, the 3.8% Net Investment Income Tax (NIIT), deductions, and special asset rules can all change the outcome. This is not tax, legal, or financial advice. Consult a licensed CPA or attorney before acting.

$
$
$
Estimated capital gains tax
$0
$0Capital gain
$0Tax owed
$0Net proceeds (after tax)
0%Effective rate on gain
Advertiser · affiliate

Plan the sale before you sell

A licensed CPA or fiduciary advisor can model loss harvesting, holding-period timing and account placement so you keep more of your gain. Investing for the long term? See our halal-investing tools below.

Roth vs Traditional IRA →

How the capital gains tax calculator works

Your capital gain is simply the sale price minus your cost basis (what you originally paid), never below zero:

Gain = max(0, Sale price − Cost basis)

How that gain is taxed depends entirely on how long you held the asset:

Short-term (held one year or less) is taxed as ordinary income. The tool stacks your gain on top of your other taxable income and applies the 2024 federal brackets (10%, 12%, 22%, 24%, 32%, 35%, 37%), then subtracts the tax on your income alone — so only the gain is charged at your true marginal rates.

Long-term (held more than one year) gets the preferential federal rate of 0%, 15% or 20%, set by your taxable income and filing status. For 2024, a single filer pays 0% up to $47,025 of income, 15% up to $518,900, and 20% above that; married-filing-jointly thresholds are $94,050 and $583,750.

The net proceeds are your sale price minus the estimated tax, and the effective rate is tax owed divided by the gain. Remember: many states levy their own capital gains tax, and high earners may also owe the 3.8% Net Investment Income Tax — neither is included here.

Frequently asked questions

What is the difference between short-term and long-term gains?
Short-term (held one year or less) is taxed at your ordinary income rate — the 2024 brackets from 10% to 37%. Long-term (held over a year) gets the lower 0/15/20% federal rate based on your income and filing status.
How is the tax calculated in this tool?
Gain = sale price − cost basis (floored at zero). Short-term gains are stacked on your income and run through the marginal brackets; long-term gains use the 0/15/20% rate for your income and status.
Does this include state tax or the NIIT?
No. This is a simplified federal estimate. Most states tax capital gains too, and high earners may owe the 3.8% Net Investment Income Tax — so your real bill can be higher. Confirm with a CPA.
How can I legally reduce capital gains tax?
Hold assets over a year for lower long-term rates, harvest losses to offset gains, use tax-advantaged accounts (IRA, 401(k)), and time sales in lower-income years. A licensed tax professional can tailor this — the tool is educational only.

Sources & further reading

2024 federal income-tax brackets and long-term capital gains rate thresholds: U.S. Internal Revenue Service (irs.gov), Topic No. 409 "Capital Gains and Losses" and Rev. Proc. 2023-34. Net Investment Income Tax guidance: irs.gov. Read our full disclaimer →

Advertisement