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.
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?
How is the tax calculated in this tool?
Does this include state tax or the NIIT?
How can I legally reduce capital gains tax?
Related tools
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 →