When you sell an investment — a stock, an index fund, a rental property, or even cryptocurrency — and make a profit, that profit is called a capital gain. The IRS taxes it. How much you owe depends on how long you held the asset and what your overall income is. Understanding capital gains tax is not optional for anyone who invests. Getting it wrong costs real money; getting it right can save thousands of dollars legally, every single year.
What a capital gain actually is
A capital gain is the difference between what you paid for an asset (your « cost basis ») and what you sold it for:
Capital gain = Sale price − Cost basis
If you bought 10 shares of an S&P 500 index fund at $400 per share ($4,000 total) and sold them at $600 per share ($6,000 total), your capital gain is $2,000. That $2,000 is what gets taxed — not the full $6,000 sale proceeds.
A capital loss occurs when you sell for less than you paid. Losses are not wasted — they can be used to offset gains, which is one of the key tax strategies covered below.
Short-term vs. long-term capital gains
This is the most important distinction in capital gains taxation. The IRS taxes short-term and long-term gains at fundamentally different rates:
- Short-term capital gains: Profits from assets held for one year or less. Taxed as ordinary income — the same rate as your salary or wages.
- Long-term capital gains: Profits from assets held for more than one year. Taxed at preferential lower rates: 0%, 15%, or 20% depending on income.
This single distinction is why long-term buy-and-hold investing is more tax-efficient than frequent trading. An investor who buys an index fund and holds it for years pays significantly less tax on the same profit than a trader who buys and sells the same security within months.
2026 capital gains tax rates
Long-term capital gains rates
| 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 |
| Head of household | Up to $64,750 | $64,751–$566,700 | Over $566,700 |
These thresholds are based on your taxable income — not just your investment income. Your wages, self-employment income, and other income all count. Always verify current thresholds at IRS.gov, as they are adjusted annually for inflation.
Short-term capital gains rates
Short-term gains are taxed at ordinary income tax rates — the same brackets that apply to your wages:
| Taxable income (single filer) | Tax rate |
|---|---|
| Up to $11,925 | 10% |
| $11,926–$48,475 | 12% |
| $48,476–$103,350 | 22% |
| $103,351–$197,300 | 24% |
| $197,301–$250,525 | 32% |
| $250,526–$626,350 | 35% |
| Over $626,350 | 37% |
An investor in the 22% income tax bracket who sells a stock after 8 months pays 22% on the gain. The same investor who waits 4 more months — holding the position past the one-year mark — may pay just 15%. On a $10,000 gain, that’s a $700 difference for simply waiting.
The Net Investment Income Tax (NIIT)
Higher-income investors face an additional 3.8% Medicare surtax called the Net Investment Income Tax, applied on top of regular capital gains tax. It applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds:
- $200,000 for single filers
- $250,000 for married filing jointly
This means high-income investors can effectively pay up to 23.8% on long-term capital gains (20% + 3.8%) — still significantly below the top 37% ordinary income rate, but worth factoring into tax planning.
What triggers a capital gain
Capital gains are only taxed when you realize them — meaning you actually sell the asset. An investment that has doubled in value while you hold it is an unrealized gain and is not taxable until sold. This is a fundamental feature of the tax code that long-term investors use to their advantage.
Common events that trigger capital gains:
- Selling stocks, ETFs, or mutual funds in a taxable brokerage account
- Selling cryptocurrency (the IRS treats crypto as property, not currency)
- Selling real estate (with specific exclusions for primary residences — see below)
- Selling a business or business assets
- Receiving mutual fund distributions (even without selling — mutual funds pass through gains to shareholders)
What does NOT trigger capital gains: Selling within a tax-advantaged account. When you sell investments inside a Roth IRA, Traditional IRA, or 401(k), no capital gains tax applies at the time of sale. This is one of the primary advantages of retirement accounts — you can rebalance, sell appreciated positions, and reinvest without any immediate tax consequence.
Real estate and the primary residence exclusion
Selling your home is a capital gains event — but a significant exclusion applies. If you’ve owned and lived in the home as your primary residence for at least 2 of the last 5 years before the sale, you can exclude:
- Up to $250,000 of gain if filing single
- Up to $500,000 of gain if married filing jointly
For most homeowners, this exclusion covers the entire gain from a home sale tax-free. The exclusion does not apply to investment properties or second homes held as rentals — gains on those are fully taxable, and the depreciation recapture rules add additional complexity for rental property owners.
For a full breakdown of the financial math behind buying vs. renting, see our guide on buying a home.
Legal strategies to reduce capital gains taxes
Tax minimization through capital gains planning is entirely legal and widely practiced. These are the most effective strategies available to individual investors:
1. Hold investments for more than one year
The simplest and most impactful strategy. By holding an appreciated investment past the one-year mark before selling, you shift from short-term (ordinary income) rates to long-term rates — potentially reducing your tax rate on the gain by 10 to 20 percentage points. This aligns naturally with the long-term buy-and-hold approach used in index fund investing.
2. Tax-loss harvesting
When you have investments that have declined in value, selling them at a loss generates a capital loss. Capital losses offset capital gains dollar-for-dollar — if you have $5,000 in gains and $2,000 in losses, you only pay tax on $3,000 in net gains. If losses exceed gains, up to $3,000 of excess losses can be deducted against ordinary income per year, with remaining losses carried forward to future tax years indefinitely.
The key rule to watch: the wash-sale rule prohibits you from buying back substantially identical securities within 30 days before or after the sale for a loss. If you sell an S&P 500 ETF at a loss and buy the same fund back within 30 days, the loss is disallowed. The workaround: sell one S&P 500 fund and immediately buy a different but similar fund (e.g., sell VOO and buy FXAIX) — you maintain your market exposure while still realizing the tax loss.
3. Use tax-advantaged accounts for high-growth assets
Hold your highest-growth investments inside Roth IRAs, Traditional IRAs, and 401(k)s where gains are sheltered from taxes. Keep slower-growing, income-producing assets (bonds, dividend stocks) in taxable accounts where their tax treatment is less disadvantageous. This strategy — called asset location — can meaningfully improve after-tax returns without changing what you own.
4. The 0% long-term capital gains bracket
If your taxable income falls below $48,350 (single) or $96,700 (married), you owe 0% federal tax on long-term capital gains. This creates planning opportunities in certain situations:
- Early retirement years when income is temporarily low
- Years with large deductions that reduce taxable income significantly
- Strategically realizing gains during low-income years to reset your cost basis higher
This is one of the most underused tax planning opportunities available to middle-income investors, particularly those approaching or in early retirement.
5. Qualified Opportunity Zone investments
Investors who reinvest capital gains into designated Qualified Opportunity Zone funds within 180 days of a sale can defer — and potentially partially reduce — those gains. This is a more complex strategy primarily relevant for large capital gains events and investors with higher risk tolerance for alternative investments.
6. Gifting appreciated assets
If you plan to make charitable donations, gifting appreciated securities directly to a charity (rather than selling the stock and donating the cash) allows you to avoid paying capital gains tax on the appreciation entirely, while still deducting the full fair market value. For investors with significantly appreciated positions, this is one of the most tax-efficient forms of charitable giving available.
7. Step-up in basis at death
Assets inherited at death receive a « stepped-up » cost basis — the basis resets to the fair market value on the date of death, erasing all unrealized capital gains accumulated during the original owner’s lifetime. While this is not something to plan around for your own investments, it is relevant for estate planning and helps explain why very long-term holdings in taxable accounts can be passed on with favorable tax treatment.
Capital gains tax on cryptocurrency
The IRS classifies cryptocurrency as property, not currency. Every taxable event involving crypto — selling for dollars, trading one cryptocurrency for another, using crypto to purchase goods or services — potentially triggers a capital gain or loss based on the difference between your cost basis and the fair market value at the time of the transaction.
This makes record-keeping critical for active crypto users. Every transaction has a tax consequence. Software tools like CoinTracker, Koinly, or TurboTax’s crypto module can help aggregate transaction history across exchanges and calculate your net gains and losses for tax reporting.
The same short-term/long-term distinction applies: crypto held more than one year qualifies for long-term capital gains rates. The volatility of cryptocurrency makes tax-loss harvesting opportunities particularly common in this asset class.
How to report capital gains on your tax return
Capital gains are reported on Schedule D of your Form 1040, with individual transactions detailed on Form 8949. Your brokerage will send you a Form 1099-B each January summarizing all taxable transactions from the prior year. Most tax software (TurboTax, H&R Block, FreeTaxUSA) imports this data directly from your brokerage, eliminating most of the manual entry.
Common reporting mistakes to avoid:
- Missing cost basis for older positions: If you bought shares before 2012, your brokerage may not have the original cost basis on file. You are responsible for providing it — check old statements or transaction confirmations.
- Not accounting for reinvested dividends: If your fund automatically reinvests dividends, each reinvestment is a purchase that adds to your cost basis. Not tracking these leads to overpaying taxes when you eventually sell.
- Missing crypto transactions: The IRS has explicitly included a question about cryptocurrency on Form 1040 since 2019. Failing to report crypto gains is not a gray area — it is underreporting taxable income.
Capital gains tax and your investment strategy
The tax efficiency of an investment strategy matters as much as its pre-tax return. Two portfolios with identical pre-tax returns can produce meaningfully different after-tax results depending on how often positions are turned over, whether gains are short-term or long-term, and how effectively losses are harvested.
This is one of the reasons passive index fund investing tends to outperform active management on an after-tax basis even when pre-tax returns are comparable: index funds generate minimal short-term gains and require little selling, while actively managed funds often generate taxable distributions that reduce net returns for investors in taxable accounts.
For most individual investors, the practical tax-optimization framework is straightforward: maximize contributions to tax-advantaged retirement accounts first, hold investments in taxable accounts for at least one year before selling, harvest losses when available, and avoid frequent trading that generates short-term gains. The combined effect of these habits compounds significantly over a 20–30 year investing horizon.
Frequently asked questions
Do I owe capital gains tax if I don’t sell anything?
Generally no — unrealized gains are not taxable. The exception is mutual fund distributions: mutual funds are required to distribute realized capital gains to shareholders at year-end, even if you didn’t sell any shares yourself. This is one reason ETFs are slightly more tax-efficient than mutual funds in taxable accounts — ETFs rarely distribute capital gains.
Does capital gains tax apply to retirement accounts?
No. Selling investments inside a 401(k), Traditional IRA, or Roth IRA does not trigger capital gains tax. With a Traditional IRA or 401(k), withdrawals in retirement are taxed as ordinary income regardless of how the underlying investments performed. With a Roth IRA, qualified withdrawals are completely tax-free — including all capital gains. This is the core advantage of tax-advantaged accounts for long-term investors.
What’s the difference between capital gains tax and income tax?
Income tax applies to wages, salaries, self-employment income, rental income, and short-term capital gains. Long-term capital gains are taxed under a separate, preferential rate schedule specifically designed to encourage long-term investment. The practical result: a dollar of long-term investment profit is taxed at a lower rate than a dollar of earned income for most taxpayers.
Can I deduct investment losses beyond $3,000?
Yes — but only in future years. If your capital losses exceed your capital gains by more than $3,000, the excess loss carries forward indefinitely. In future years, it can offset capital gains dollar-for-dollar, or reduce ordinary income by up to $3,000 per year until the loss is fully used. Track your carryforward losses carefully — they appear on Schedule D of your prior year’s return.
Do I owe state capital gains tax too?
Possibly. Most states tax capital gains as ordinary income at the state level, in addition to federal capital gains tax. Nine states have no income tax at all (Florida, Texas, Nevada, Washington, Wyoming, South Dakota, Alaska, New Hampshire, Tennessee) — residents of these states owe no state-level capital gains tax. California taxes capital gains as ordinary income at rates up to 13.3%, making it one of the highest combined capital gains tax environments in the country.
The bottom line
Capital gains tax is unavoidable for investors who sell appreciated assets in taxable accounts — but it is highly manageable. The single most impactful move most individual investors can make is simply holding investments for more than one year before selling, which can reduce the tax rate on gains by 10 to 22 percentage points compared to short-term treatment.
Beyond that, keeping high-growth investments inside tax-advantaged accounts, harvesting losses systematically, and being strategic about which years to realize large gains can collectively reduce your lifetime tax bill by tens of thousands of dollars. None of these strategies require a tax professional to execute — they require only understanding the rules and applying them consistently.
For a full picture of how taxes fit into your overall financial plan, see our guide on how to file taxes and our breakdown of self-employment taxes if you have freelance or side income to account for.
Disclaimer: This article is for informational purposes only and does not constitute tax or financial advice. Tax rates, brackets, and rules are subject to change by Congress and the IRS. Consult a qualified CPA or tax advisor for guidance specific to your situation.