
What Is Capital Gains Tax?
Capital gains tax is a federal tax on the profit you make when you sell an asset for more than you paid for it. The asset can be stocks, bonds, mutual funds, real estate, cryptocurrency, collectibles, or any other property. The tax only applies when you realize the gain by actually selling -- unrealized gains on paper are not taxed until you sell. The amount of tax you owe depends on two critical factors: how long you held the asset before selling and your total taxable income for the year.
Understanding capital gains tax is essential for any investor because it directly affects your net return. A stock that doubles in value looks impressive on paper, but your actual profit depends heavily on whether you pay the short-term rate of up to 37% or the long-term rate of 0% to 20%. The difference can amount to thousands of dollars on a single transaction. Use the calculator above to see exactly how much you would owe on a specific sale, and read on to learn the strategies that experienced investors use to minimize their tax burden legally.
Short-Term vs Long-Term Capital Gains
The IRS divides capital gains into two categories based on holding period. Short-term capital gains apply to assets held for one year or less. These gains are taxed at your ordinary income tax rate, which ranges from 10% to 37% depending on your total taxable income and filing status. For a high earner in the 37% bracket, selling a stock after 11 months means losing more than a third of the profit to taxes.
Long-term capital gains apply to assets held for more than one year. These gains receive preferential tax treatment with three rate tiers: 0%, 15%, or 20%. For 2026, single filers with taxable income up to $48,350 pay 0% on long-term gains. Income between $48,350 and $533,400 is taxed at 15%, and income above $533,400 is taxed at 20%. Married couples filing jointly get roughly double these thresholds. This preferential treatment creates a powerful incentive to hold investments for at least one year and one day before selling.
The difference between short-term and long-term rates can be dramatic. Consider an investor in the 32% ordinary income bracket who sells stock for a $50,000 profit. Selling after 11 months triggers a $16,000 short-term tax bill. Waiting just two more months to cross the one-year threshold drops the rate to 15%, reducing the tax to $7,500 -- a savings of $8,500 simply by being patient. You can use our Income Tax Calculator to determine your current ordinary income tax bracket and see how it compares to the long-term capital gains rate.
2026 Capital Gains Tax Brackets
| Tax Rate | Single | Married Filing Jointly | Head of Household |
|---|---|---|---|
| 0% | Up to $48,350 | Up to $96,700 | Up to $64,750 |
| 15% | $48,351 - $533,400 | $96,701 - $600,050 | $64,751 - $566,700 |
| 20% | Over $533,400 | Over $600,050 | Over $566,700 |
These thresholds are based on your total taxable income, not just the capital gain itself. Your wages, salary, business income, and other earnings stack underneath the gain to determine which bracket applies. An investor earning $40,000 in salary who realizes a $20,000 long-term gain has a total taxable income of $60,000. The first $8,350 of the gain ($48,350 - $40,000) falls in the 0% bracket, and the remaining $11,650 is taxed at 15%. This stacking effect is why the calculator asks for your annual income -- it directly affects the rate you pay on the gain.
The Net Investment Income Tax (NIIT)
High earners face an additional 3.8% Net Investment Income Tax on top of the regular capital gains rate. The NIIT applies to the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds $200,000 for single filers or $250,000 for married filing jointly. This effectively raises the maximum long-term capital gains rate from 20% to 23.8%.
For example, a single filer with $180,000 in salary and a $50,000 long-term capital gain has a MAGI of $230,000. The NIIT applies to the lesser of the $50,000 investment income or the $30,000 excess over the $200,000 threshold. So the NIIT is 3.8% of $30,000 = $1,140, added on top of the regular capital gains tax. Track your total investment returns using our Investment Return Calculator to see how the NIIT and capital gains taxes affect your real after-tax performance.
Case Study: Marcus Sells His Tech Stock Portfolio
Marcus, a 34-year-old software engineer in Seattle, earns $120,000 in annual salary. Three years ago, he invested $25,000 in a diversified tech stock portfolio. The portfolio has grown to $58,000, giving him a paper gain of $33,000. Marcus is considering selling to fund a down payment on his first home. He files as single.
Since Marcus held the stocks for more than one year, the $33,000 gain qualifies for long-term capital gains rates. His $120,000 salary places him well above the 0% threshold of $48,350, so the entire gain is taxed at 15%. His capital gains tax is $33,000 x 15% = $4,950. His MAGI is $120,000 + $33,000 = $153,000, which is below the $200,000 NIIT threshold, so no NIIT applies. Marcus nets $58,000 - $4,950 = $53,050 after tax.
If Marcus had sold after only 10 months, the same $33,000 gain would be taxed at his ordinary income rate. With $120,000 in salary, his marginal bracket is 24%, making the short-term tax $33,000 x 24% = $7,920. That is $2,970 more in taxes -- nearly $3,000 lost simply because he did not wait two more months. The difference would have been even larger if Marcus had been in the 32% bracket.
Marcus decides to sell and uses the $53,050 proceeds as part of his home down payment. He uses our ROI Calculator to compare his after-tax stock market return against the expected appreciation on the home, helping him confirm that redirecting the funds into real estate is the right move for his financial plan.
Tax Scenarios: How Income Level Affects Your Rate
| Annual Income | $20K Gain (Short-Term) | $20K Gain (Long-Term) | Tax Savings |
|---|---|---|---|
| $30,000 | $2,714 | $252 | $2,462 |
| $60,000 | $3,828 | $3,000 | $828 |
| $100,000 | $4,800 | $3,000 | $1,800 |
| $200,000 | $6,400 | $3,000 | $3,400 |
| $500,000 | $7,400 | $3,000 | $4,400 |
The table above shows how the same $20,000 capital gain is taxed differently depending on your income level and holding period. At every income level, long-term treatment produces a lower tax bill. The savings are most dramatic for lower-income investors who qualify for the 0% rate and for high earners where the spread between their ordinary income bracket and the 15% or 20% long-term rate is widest. Filing status also matters: married couples filing jointly enjoy wider 0% and 15% brackets, often cutting the tax bill in half compared to a single filer at the same income.
Strategies to Minimize Capital Gains Tax
- Hold for more than one year. The single most effective strategy is simply waiting. Long-term rates of 0% to 20% are significantly lower than short-term rates of 10% to 37%. Before selling any investment, check how long you have held it. If you are close to the one-year mark, the tax savings of waiting almost always outweigh any potential price decline risk.
- Harvest tax losses. Sell losing investments to offset gains dollar for dollar. If you have $30,000 in gains and $10,000 in losses, you only pay tax on the net $20,000 gain. If losses exceed gains, you can deduct up to $3,000 per year against ordinary income and carry remaining losses forward indefinitely. This strategy works year-round, not just at year-end.
- Use the 0% bracket strategically. If your income falls near the 0% threshold ($48,350 for single filers in 2026), you can sell appreciated assets tax-free up to that limit. Retirees and gap-year professionals often take advantage of low-income years to realize gains at 0%. This is called tax-gain harvesting -- the opposite of tax-loss harvesting.
- Maximize retirement account contributions. Pre-tax contributions to a 401(k) or traditional IRA reduce your taxable income, potentially keeping your capital gains in a lower bracket. Reducing your ordinary income by $10,000 through retirement contributions could shift $10,000 of gains from the 15% bracket to the 0% bracket. Check our Capital Gains Tax Guide for a deeper look at bracket management techniques.
- Consider the primary residence exclusion. If you sell your primary home, you can exclude up to $250,000 in gains ($500,000 for married couples) from tax, provided you lived in the home for at least two of the last five years. This is one of the most valuable tax breaks available to homeowners.
- Gift or donate appreciated assets. Donating appreciated stock to a qualified charity lets you deduct the full fair market value without paying capital gains tax on the appreciation. Gifting to a family member in a lower tax bracket can also shift the tax burden. Dividend-paying stocks are especially good candidates; learn more in our Dividend Investing Guide.
Capital Gains on Different Asset Types
Stocks and ETFs: Standard capital gains rules apply. Cost basis is the purchase price plus brokerage commissions. If you bought shares at different times, you can choose specific lot identification to sell the highest-cost shares first, minimizing the taxable gain. Most brokerages default to FIFO (first in, first out), which may not be optimal.
Real estate: The gain equals the sale price minus the adjusted basis, which is the purchase price plus improvement costs minus accumulated depreciation (for rental property). The primary residence exclusion can eliminate up to $250,000 ($500,000 for couples) in gains. Rental property owners may face depreciation recapture taxed at 25% on the portion attributable to prior depreciation deductions, in addition to capital gains tax on the remaining profit.
Cryptocurrency: The IRS treats crypto as property, subject to the same capital gains rules as stocks. Every trade, including swapping one crypto for another, is a taxable event. The cost basis is the fair market value at the time you acquired the crypto. Record-keeping is critical because exchanges may not track basis across wallets or platforms.
Collectibles: Art, antiques, precious metals, and coins are taxed at a flat 28% rate for long-term gains, which is higher than the standard 20% maximum. Short-term gains on collectibles are still taxed at ordinary income rates.
FAQ
What is the difference between short-term and long-term capital gains? Short-term capital gains apply to assets held for one year or less and are taxed at your ordinary income tax rate, ranging from 10% to 37%. Long-term capital gains apply to assets held for more than one year and qualify for preferential rates of 0%, 15%, or 20%. The holding period is measured from the day after purchase to the day of sale.
How do I calculate my capital gain? Subtract your cost basis (purchase price plus fees and improvements) from the sale price. If the result is positive, you have a capital gain. If negative, you have a capital loss. The calculator above handles this automatically and applies the correct tax rate based on your income and filing status.
Can capital losses offset capital gains? Yes. Capital losses directly offset capital gains of the same type (short-term losses offset short-term gains first, then long-term gains). If total losses exceed total gains, you can deduct up to $3,000 per year against ordinary income. Unused losses carry forward to future years with no expiration.
Is there a 0% capital gains tax rate? Yes. For 2026, single filers with taxable income up to $48,350 and married filing jointly up to $96,700 pay 0% on long-term capital gains. This threshold applies to your total taxable income including the gain, so partial gains may qualify for 0% even if your total income pushes some of the gain into the 15% bracket.
Does selling my home trigger capital gains tax? Possibly, but the primary residence exclusion lets you exclude up to $250,000 in gains ($500,000 for married couples filing jointly) if you owned and lived in the home for at least two of the last five years. Only gains exceeding the exclusion amount are taxable.