Capital Gains Tax Calculator
Estimate the capital gains tax on a sale — enter your purchase and sale price, holding period, income, filing status and state to see federal and state tax and your net gain.
Estimate for the 2025 tax year, for general information only — not tax advice. Long-term gains use the federal 0/15/20% brackets stacked on your taxable income; short-term gains use ordinary rates; states are treated as taxing gains as ordinary income. It does not model the 3.8% Net Investment Income Tax, the home-sale exclusion, wash sales, carryover losses or credits. Verify with the IRS or a tax professional.
How capital gains tax is figured
Your capital gain is the sale price minus your cost basis — generally what you paid for the asset plus purchase commissions and, for property, the cost of capital improvements. How that gain is taxed depends entirely on how long you owned the asset before selling. A long-term gain comes from an asset held more than one year and qualifies for the preferential federal rates of 0%, 15% or 20%. A short-term gain comes from an asset held one year or less and is taxed as ordinary income, at the same 10%–37% brackets as your salary. Most states then tax the gain as regular income on top, which is why your state of residence matters. The calculator above runs all of this from your numbers; the sections below explain each piece so you can sanity-check the result.
2025 long-term capital gains tax brackets
Long-term rates are not a flat percentage on the gain. Instead, the IRS sets income breakpoints, and the rate is decided by where your gain stacks on top of your other taxable income. The table below shows the 2025 taxable-income thresholds at which each long-term rate applies, by filing status.
| Filing status | 0% rate | 15% rate | 20% rate |
|---|---|---|---|
| Single | Up to $48,350 | $48,351 – $533,400 | Over $533,400 |
| Married filing jointly | Up to $96,700 | $96,701 – $600,050 | Over $600,050 |
| Married filing separately | Up to $48,350 | $48,351 – $300,000 | Over $300,000 |
| Head of household | Up to $64,750 | $64,751 – $566,700 | Over $566,700 |
Because the gain stacks on your income, a single filer with $40,000 of taxable income and a $20,000 long-term gain fills the remaining 0% room up to $48,350 (about $8,350 of the gain taxed at 0%) and pays 15% on the rest. That stacking is what makes the holding period — and your other income for the year — so important.
2025 short-term capital gains rates
Sell an asset you have held a year or less and the profit is a short-term gain, taxed exactly like wages at the ordinary federal brackets below (2025, single filer shown for reference). There is no preferential rate, which is why crossing the one-year mark can sharply cut the bill.
| Ordinary rate | Single taxable income |
|---|---|
| 10% | Up to $11,925 |
| 12% | $11,926 – $48,475 |
| 22% | $48,476 – $103,350 |
| 24% | $103,351 – $197,300 |
| 32% | $197,301 – $250,525 |
| 35% | $250,526 – $626,350 |
| 37% | Over $626,350 |
The extra 3.8% Net Investment Income Tax
Higher earners owe an additional 3.8% Net Investment Income Tax (NIIT) on capital gains and other investment income once their modified adjusted gross income (MAGI) passes a threshold: $200,000 for single and head-of-household filers, $250,000 for married filing jointly, and $125,000 for married filing separately. The 3.8% applies to the smaller of your net investment income or the amount of MAGI above the threshold — so a long-term gain that would otherwise be taxed at 20% can carry an effective top federal rate of 23.8%. The calculator above gives a simplified estimate and does not add the NIIT, so treat its number as a floor if your income is near or above these levels.
Special rates: collectibles, small-business stock and real estate
A few asset types break the 0/15/20% pattern even when held long-term:
| Asset type | Maximum long-term rate |
|---|---|
| Collectibles (art, coins, metals, antiques) | 28% |
| Section 1202 qualified small-business stock (taxable portion) | 28% |
| Unrecaptured Section 1250 gain (depreciation on real estate) | 25% |
| Most stocks, ETFs, crypto and other property | 0% / 15% / 20% |
For a sold rental or investment property, the depreciation you previously claimed is “recaptured” at up to 25%, while the remaining gain follows the standard long-term rates. If you sell crypto, the IRS treats it as property, so the same one-year rule and 0/15/20% brackets apply.
Cost basis: what you subtract from the sale price
Getting the gain right starts with an accurate cost basis. For stocks and funds, basis is the purchase price plus any commissions. For a home or rental, basis is the purchase price plus closing costs and the cost of capital improvements (a new roof or addition), which raises basis and lowers the taxable gain. Two common adjustments matter: inherited assets generally receive a “step-up” in basis to the fair market value on the date of death, often erasing decades of gain, while gifted assets usually keep the giver’s original basis. Always start from the correct basis before applying any rate.
The home-sale exclusion
Selling your main home is treated more generously than other assets. If you owned and lived in the home for at least two of the last five years, you can exclude up to $250,000 of gain if single or $500,000 if married filing jointly — meaning many primary-residence sales owe no capital gains tax at all. Only the gain above the exclusion is taxable, and the exclusion does not apply to rental or vacation property. This calculator does not model the exclusion, so for a primary-home sale subtract the exclusion from your gain first, then enter the remainder.
A worked example
Suppose a single filer with $60,000 of taxable income (after the standard deduction) sells stock for $30,000 that they bought for $15,000 two years ago.
- Gain: $30,000 − $15,000 = $15,000, long-term (held over a year).
- Federal rate: $60,000 of income already exceeds the $48,350 0% ceiling but is far below $533,400, so the entire $15,000 gain falls in the 15% band.
- Federal tax: $15,000 × 15% = $2,250.
- NIIT: none — MAGI is well under $200,000.
- State tax: in a state taxing gains as ordinary income at, say, 5%, add $15,000 × 5% = $750.
- Total estimate: about $3,000, leaving a net gain near $12,000.
Had the same investor sold after only ten months, the $15,000 would be short-term and taxed at their 22% ordinary rate — roughly $3,300 federal instead of $2,250, a difference of about $1,050 just from the holding period.
How to reduce capital gains tax
Several legitimate moves lower the bill on investment gains:
- Hold past one year so the gain qualifies for the lower long-term rates instead of ordinary rates.
- Harvest losses — sell losing positions to offset gains; up to $3,000 of net loss can also offset ordinary income each year, with the rest carried forward.
- Use tax-advantaged accounts — gains inside a 401(k), IRA or Roth grow tax-deferred or tax-free, so no capital gains tax is due on trades within the account.
- Time the sale for a year when your taxable income is lower, possibly dropping the gain into the 0% or 15% band.
- Gift or donate appreciated assets — donating long-held stock to charity can avoid the gain entirely and provide a deduction.
To plan the wider picture, see the income tax calculator for your ordinary income tax, the stock profit calculator to size a sale before you make it, the 1099 tax calculator for self-employment income, or the dividend calculator for income from holdings you keep.
This calculator is an estimate for the 2025 tax year and is provided for general information only — it is not tax advice and does not replace a CPA or enrolled agent. It does not model the 3.8% Net Investment Income Tax, the home-sale exclusion, the 28%/25% special rates, wash sales, carryover losses, the QBI deduction or state-specific rules. Verify your situation against the IRS or a qualified tax professional. Sources: IRS Topic No. 409 (Capital Gains and Losses), IRS Publication 550 (Investment Income and Expenses) and IRS Publication 523 (Selling Your Home).
Frequently asked questions
What is the Net Investment Income Tax on capital gains?
The Net Investment Income Tax (NIIT) is an extra 3.8% federal tax on investment income, including capital gains, for higher earners. It kicks in once your modified adjusted gross income passes $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). It applies to the smaller of your net investment income or the amount of income above the threshold, so a 20% long-term gain can carry an effective 23.8% top federal rate. This calculator does not add the NIIT, so treat its figure as a floor if your income is near these levels.
Do I pay capital gains tax when I sell my house?
Often not. If the home was your main residence for at least two of the last five years, you can exclude up to $250,000 of gain if single or $500,000 if married filing jointly, and only the gain above that is taxable. Many primary-home sales therefore owe nothing. The exclusion does not apply to rental or vacation properties, where the full gain is taxable and any depreciation taken is recaptured at up to 25%.
How is cryptocurrency taxed when I sell it?
The IRS treats crypto as property, so selling, trading or spending it triggers a capital gain or loss just like a stock. Held one year or less, the gain is short-term and taxed at your ordinary rate; held more than a year, it qualifies for the 0%, 15% or 20% long-term rates. Your basis is what you paid plus fees, and every disposal is a taxable event you report — enter your gain and holding period above for an estimate.
How can I avoid or reduce capital gains tax?
Common, legitimate strategies include holding an asset more than a year so the gain gets the lower long-term rates, harvesting losses to offset gains (up to $3,000 of net loss can also offset ordinary income, with the rest carried forward), trading inside tax-advantaged accounts like a 401(k) or Roth IRA where gains aren't taxed, timing a sale for a lower-income year, and donating appreciated assets to charity to avoid the gain altogether. The right mix depends on your situation, so confirm with a tax professional.
How is capital gains tax calculated?
Your gain is the sale price minus what you paid (your basis). If you held the asset more than a year, it is a long-term gain taxed at 0%, 15% or 20% federally depending on your taxable income; held a year or less, it is short-term and taxed at your ordinary income rate. Most states tax the gain as regular income on top. This calculator does all three from your numbers.
What is the difference between short-term and long-term capital gains?
Long-term gains (assets held more than one year) get preferential federal rates of 0%, 15% or 20%. Short-term gains (held one year or less) are taxed as ordinary income, which is usually higher. Holding past the one-year mark can significantly cut the tax — the calculator lets you compare both.
How much capital gains tax will I pay?
It depends on the size of the gain, how long you held the asset, your other income and your state. For example, a $15,000 long-term gain for a single filer with $60,000 of taxable income is taxed at the 15% federal rate (about $2,250) plus any state tax. Enter your details above for an estimate.
Do I pay state tax on capital gains?
In most states, yes — they tax capital gains as ordinary income at their normal rates. Nine states have no income tax, so they take nothing on gains. Select your state above to include state tax in the estimate.