Selling a stock, mutual fund, cryptocurrency, rental property, or even inherited shares almost always creates a taxable event — and the tax bill you receive depends less on how much you made than on how long you held the asset. This capital gains tax calculator estimates the federal tax you owe on the sale of an investment: it subtracts your cost basis from your sale price, decides whether the gain is short-term or long-term, applies the correct 2025 bracket, and shows your after-tax proceeds.
Move the inputs and the result card updates instantly. If the number surprises you, that is exactly the point — knowing the tax before you sell lets you plan the sale, harvest losses, or wait an extra month to cross the long-term threshold.
How to Use
- Enter the Sale Price — the gross proceeds you received when the trade settled. Do not net out commissions yet; the estimate stays transparent on purpose.
- Enter your Cost Basis — what you paid to acquire the asset, including purchase fees and any reinvested dividends you have already paid tax on. A higher basis lowers the gain, so gather your 1099-B or brokerage statement before guessing.
- Set the Holding Period in months. Owned 12 months or fewer? The gain is short-term and taxed at a flat 22% ordinary bracket in this estimate. Owned longer? It qualifies for the preferential long-term rate.
- Choose your Filing Status — Single or Married Filing Jointly. The two statuses use different 2025 long-term bracket thresholds.
- Enter your Other Taxable Income — your taxable income this year before this gain. Long-term rates are not a flat percentage of the gain; the gain stacks on top of your other income, and the combined total decides which 0%, 15%, or 20% bracket applies.
The result card then shows your capital gain, whether it is short-term or long-term, the rate applied, the estimated tax owed, and the cash you actually keep after tax.
Short-Term vs Long-Term: Why It Matters
The IRS splits capital gains into two buckets, and the difference is dramatic:
- Short-term gains (held 12 months or less) are taxed as ordinary income. This calculator uses the 22% federal bracket as the working marginal rate, which matches the most common middle-income investor profile. If your actual bracket is 24%, 32%, or 35%, your real tax will be somewhat higher.
- Long-term gains (held more than 12 months) get preferential rates of 0%, 15%, or 20%, depending on your total taxable income. For 2025, a single filer pays 0% on long-term gains up to $48,350 of combined income, 15% from there up to $533,400, and 20% above that. Married couples filing jointly get 0% up to $96,700 and 15% up to $600,050.
A quick illustration: sell a stock for a $50,000 profit after holding it eleven months and the 22% rate costs you $11,000. Hold it one month longer and the same profit can drop into the 15% bracket — a bill of $7,500. That single month is worth $3,500 to most people, which is why tax planning around the one-year holding line pays off.
How the Bracket Is Chosen
Unlike the progressive tax tables on your salary, the long-term capital gains rate is determined by where the combined income — your ordinary taxable income plus the gain — lands:
- Combined income at or below the 0% ceiling → the entire gain is taxed at 0%. This is the famous "zero percent bracket" that lets some modest earners sell investments tax-free.
- Combined income between the 0% ceiling and the 15% ceiling → the gain is taxed at 15%, the rate used by most middle- and upper-middle-class investors.
- Combined income above the 15% ceiling → the gain is taxed at 20%, reserved for higher earners.
If your gain is zero or a loss (sale price at or below cost basis), no tax is owed on the sale. Capital losses can also offset other gains and up to $3,000 of ordinary income per year, with excess losses carried forward.
Examples
Example 1 — A long-term stock sale at 15%. You bought shares for $100,000 and sell them for $200,000 after two years, filing Single with $100,000 of other taxable income. The gain is $100,000, the combined income is $200,000 — squarely in the 15% band — so the tax owed is $15,000, and you walk away with $185,000 after federal tax.
Example 2 — A short-term flip at 22%. You bought crypto for $30,000 and sold seven months later for $50,000. The $20,000 gain is short-term: at the 22% bracket the tax owed is $4,400, leaving $45,600 after tax. Notice the same dollar profit costs nearly three times what a long-term holding would have triggered at 15%.
Example 3 — The 0% bracket. A single filer with $20,000 of other taxable income sells shares for a $15,000 long-term gain. Combined income is $35,000, below the $48,350 threshold, so the rate is 0% and the tax owed is $0 — the entire gain is tax-free.
Example 4 — A large real-estate-style gain at 20%. A married couple files jointly, has $400,000 of other taxable income, and sells an asset for a $1,000,000 long-term gain. Combined income of $1,400,000 exceeds the $600,050 ceiling, so the rate is 20% — tax owed $200,000, after-tax proceeds $1,300,000.
FAQ
How is capital gains tax calculated?
Subtract your cost basis (what you paid, including fees and reinvested dividends) from your sale price to get the gain. If you held the asset 12 months or less, the gain is short-term and taxed at your ordinary income bracket — this calculator uses the common 22% rate. If you held it longer, it is long-term and taxed at 0%, 15%, or 20% depending on your total taxable income including the gain.
What is the difference between short-term and long-term capital gains?
Short-term gains come from assets held 12 months or less and are taxed at ordinary income rates, roughly 10%–37% depending on your bracket. Long-term gains come from assets held more than 12 months and enjoy reduced federal rates of 0%, 15%, or 20%. The holding-period threshold is exactly one year from the trade date of purchase to the trade date of sale.
What are the 2025 long-term capital gains brackets?
For 2025, single filers pay 0% on long-term gains up to $48,350 of combined income, 15% from that point to $533,400, and 20% above. Married couples filing jointly pay 0% up to $96,700, 15% up to $600,050, and 20% above. These figures come from IRS Rev. Proc. 2024-40 and are adjusted for inflation each year.
Can I pay 0% capital gains tax?
Yes, if your total taxable income — ordinary income plus the gain — falls inside the 0% bracket ceiling ($48,350 for single filers in 2025, $96,700 for married filing jointly). This is why retirees with low income, students, and people between jobs can sometimes sell appreciated investments completely tax-free.
Does this calculator include state taxes or the 3.8% Net Investment Income Tax?
No. The estimate covers federal capital gains tax only. Most states add their own tax on investment gains (9 states have no state income tax at all), and high earners may also owe the 3.8% Net Investment Income Tax on gains above $200,000 single / $250,000 married. Add those separately when planning.
What happens if I sell at a loss?
If your sale price is at or below your cost basis, you owe no tax on the sale. Capital losses can offset capital gains dollar-for-dollar, plus up to $3,000 of ordinary income per year, and any leftover loss carries forward to future tax years. This is the basis behind tax-loss harvesting.
How do I find my cost basis?
Your brokerage reports cost basis on Form 1099-B and in the transaction history of your account. Remember to include purchase commissions and fees, and for assets like real estate, add improvements that raise your basis. For inherited assets, the basis is usually "stepped up" to the market value on the date of death, which can erase decades of appreciation.
Related Calculators
- Capital Gains Calculator — compute the raw gain, holding period and break-even price on an investment.
- Capital Gains Home Sale Calculator — apply the $250,000 / $500,000 home-sale exclusion before estimating tax.
- Dividend Calculator — estimate the ordinary-income tax on qualified and ordinary dividend income.
- Investment Return Calculator — project annualized total return before and after capital gains tax.
Disclaimer
This capital gains tax calculator is provided for informational purposes only and does not constitute tax, legal, or investment advice. Estimates use 2025 federal long-term capital gains brackets and a flat 22% short-term assumption; they exclude state taxes, the 3.8% Net Investment Income Tax, depreciation recapture, wash-sale rules, and your actual marginal bracket. Your real liability depends on your full tax situation. Always confirm figures with a qualified tax professional before filing or executing a sale. Our Privacy Policy and About pages are linked in the site footer.