Calculate your capital gains tax on investments, stocks, and real estate. Estimates federal tax liability for short-term and long-term capital gains.
This is an estimate for federal taxes only. State taxes may apply. Consult a tax professional for personalized advice.
Capital gains tax is a federal tax on the profit you make when selling an asset for more than you paid for it. The "gain" is the difference between your sale price and your cost basis (original purchase price plus certain adjustments). This tax applies to investments like stocks, bonds, mutual funds, real estate, and other capital assets.
The U.S. tax code treats capital gains differently from ordinary income like wages or salary. The tax rate you pay depends on two main factors: how long you held the asset before selling (your holding period) and your total taxable income for the year. Understanding these rules can help you make smarter investment decisions and potentially reduce your tax liability through strategic planning.
Capital gains taxes only apply when you actually sell an asset and "realize" the gain. If your investments increase in value but you don't sell them, you have an "unrealized" gain that isn't taxed until you sell. This is why investors sometimes refer to holding appreciated assets as having "paper gains."
The IRS distinguishes between two types of capital gains based on how long you owned the asset before selling:
If you sell an asset within one year or less of purchasing it, any profit is considered a short-term capital gain. These gains are taxed at your ordinary income tax rate, which can be as high as 37% for the highest earners. The short-term rates for 2025 are:
| Tax Rate | Single | Married Filing Jointly | Head of Household |
|---|---|---|---|
| 10% | Up to $11,925 | Up to $23,850 | Up to $17,000 |
| 12% | $11,926–$48,475 | $23,851–$96,950 | $17,001–$64,850 |
| 22% | $48,476–$103,350 | $96,951–$206,700 | $64,851–$103,350 |
| 24% | $103,351–$197,300 | $206,701–$394,600 | $103,351–$197,300 |
| 32% | $197,301–$250,525 | $394,601–$501,050 | $197,301–$250,500 |
| 35% | $250,526–$626,350 | $501,051–$751,600 | $250,501–$626,350 |
| 37% | Over $626,350 | Over $751,600 | Over $626,350 |
If you hold an asset for more than one year before selling, you qualify for preferential long-term capital gains rates. These rates are significantly lower than ordinary income rates, providing a tax incentive for long-term investing. The 2025 long-term capital gains rates are:
| Tax Rate | Single | Married Filing Jointly | Married Filing Separately | Head of Household |
|---|---|---|---|---|
| 0% | Up to $48,350 | Up to $96,700 | Up to $48,350 | Up to $64,750 |
| 15% | $48,351–$533,400 | $96,701–$600,050 | $48,351–$300,025 | $64,751–$566,700 |
| 20% | Over $533,400 | Over $600,050 | Over $300,025 | Over $566,700 |
The difference between short-term and long-term rates can be substantial. For example, a high earner in the 37% tax bracket would pay only 20% on long-term gains—a 17 percentage point savings. This is why tax advisors often recommend holding investments for at least one year and one day before selling.
The calculation follows a straightforward process:
Where:
Your cost basis isn't always just what you paid for an asset. Several factors can adjust it:
Additions to cost basis:
Reductions to cost basis:
For inherited assets, you typically receive a "stepped-up basis" equal to the fair market value at the time of the decedent's death, which can significantly reduce or eliminate capital gains taxes on appreciated assets.
An important concept is that your capital gains "stack on top" of your ordinary income when determining which tax bracket applies. For example, if you're single with $40,000 in wages and a $20,000 long-term capital gain in 2025:
This stacking effect means that even moderate-income taxpayers can sometimes owe 15% or 20% on some of their capital gains if the gains push their total income into higher brackets.
High-income taxpayers face an additional 3.8% Net Investment Income Tax (NIIT) on top of regular capital gains taxes. This surtax applies when your modified adjusted gross income (MAGI) exceeds these thresholds:
| Filing Status | MAGI Threshold |
|---|---|
| Single | $200,000 |
| Married filing jointly | $250,000 |
| Married filing separately | $125,000 |
| Head of household | $200,000 |
The NIIT applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold. Net investment income includes capital gains, dividends, interest, rental income, and royalties.
For example, if you're single with $220,000 in MAGI including a $50,000 capital gain, the NIIT would apply to $20,000 (the excess over $200,000), adding $760 to your tax bill ($20,000 × 3.8%).
When you sell an asset for less than your cost basis, you have a capital loss. These losses can offset your capital gains:
Tax-loss harvesting is a strategy where you intentionally sell losing investments to realize losses that offset gains. This can reduce your current tax bill while maintaining your investment strategy by purchasing similar (but not "substantially identical") securities.
Be aware of the "wash sale" rule: if you buy substantially identical securities within 30 days before or after selling at a loss, you cannot claim the loss for tax purposes.
Primary residence sales may qualify for an exclusion of up to $250,000 in gains ($500,000 for married couples filing jointly) if you've owned and lived in the home for at least two of the last five years. Investment properties don't qualify for this exclusion.
Rental property sales are subject to depreciation recapture, taxed at a maximum rate of 25% on the portion of the gain attributable to depreciation deductions previously taken.
Long-term gains on collectibles (art, antiques, coins, precious metals) are taxed at a maximum rate of 28%, higher than the standard 20% maximum for other long-term gains.
Stock in certain small businesses held for more than five years may qualify for partial or complete exclusion from capital gains tax under Section 1202, potentially saving significant taxes for entrepreneurs and early investors.
The simplest strategy is holding assets for more than one year to qualify for long-term rates. The difference between paying 37% (short-term) and 20% (long-term) can be substantial.
Investments in 401(k)s, IRAs, and other tax-advantaged accounts grow tax-deferred (traditional) or tax-free (Roth), eliminating capital gains taxes on trades within the account.
Consider selling in years when your other income is lower, such as early retirement or a sabbatical year. This might keep your gains in the 0% or 15% bracket.
Gifting appreciated assets to charity allows you to deduct the fair market value while avoiding capital gains tax entirely. Gifting to family members in lower tax brackets (not children subject to kiddie tax) can also result in lower overall taxes.
Strategically realize losses to offset gains in the same year, reducing your net taxable gains.
For large gains, especially on real estate, an installment sale spreads the gain over multiple years, potentially keeping you in lower tax brackets.
Real estate investors can defer capital gains taxes by exchanging one investment property for another "like-kind" property under Section 1031.
In addition to federal taxes, many states tax capital gains. Treatment varies significantly:
State taxes can add 3% to 13% or more to your total capital gains tax burden, depending on where you live.
Capital gains and losses are reported on your federal tax return using:
Most brokerages provide Form 1099-B with transaction details, making reporting straightforward. However, you're responsible for tracking cost basis, especially for assets purchased before brokerages were required to report basis or for inherited and gifted assets.
This calculator provides estimates for federal capital gains taxes only. It does not account for:
For accurate tax planning and filing, consult with a qualified tax professional who can consider your complete financial situation and applicable tax laws.