Taxes · Guide

Capital Gains Tax Explained: Rates, Rules, and How to Minimize It

Capital gains tax applies when you sell an investment for more than you paid. The rate depends on how long you held it and your income. Here's how it works and the legal strategies to reduce it.

·Jun 30, 2026·4 min read
Rate data reviewed recently·Methodology →
0% / 15% / 20%
Long-term capital gains rates
Based on total taxable income, 2026
12 months
Long-term holding threshold
One day short reverts to ordinary income rates
3.8%
Net Investment Income Tax
Applies above $200,000 single / $250,000 married AGI

Bottom line: Sell an investment you held less than one year and pay your ordinary income tax rate. Hold it more than one year and pay 0%, 15%, or 20%, significantly lower for most investors. The single most accessible tax strategy is simply holding investments long enough to qualify for long-term rates.


Capital gains are profits from selling a capital asset (stocks, bonds, real estate, cryptocurrency, collectibles) for more than you paid (your "basis"). The tax owed depends on two things: how long you held the asset and your total taxable income.

Short-Term vs. Long-Term Capital Gains

Short-term: Held 12 months or less. Taxed as ordinary income, the same rates as your salary (10%–37%).

Long-term: Held more than 12 months. Taxed at preferential rates.

2026 long-term capital gains rates (approximate):

0%
Single filer income
Up to ~$47,025
Married filing jointly
Up to ~$94,050
15%
Single filer income
$47,026 – $518,900
Married filing jointly
$94,051 – $583,750
20%
Single filer income
Over $518,900
Married filing jointly
Over $583,750

For most investors, those with total taxable income under $518,900 (single), long-term gains are taxed at 15%. For lower-income investors, the 0% rate means no federal tax on qualifying investment profits.

What Counts as Your Basis

Your basis is what you paid for the investment, including commissions and fees. When you sell, the gain is the selling price minus your basis.

Example: You bought 100 shares at $40 each ($4,000 total) and sell for $65 each ($6,500). Your gain is $2,500. If held more than a year, that $2,500 is a long-term capital gain.

For inherited assets, the basis is "stepped up" to the market value at the date of death, meaning inherited stock with a large unrealized gain may be sold immediately with no capital gains tax at all.

For gifted assets, the recipient generally takes the donor's original basis.

The Net Investment Income Tax (NIIT)

Higher earners pay an additional 3.8% Medicare surtax on net investment income (including capital gains) when modified AGI exceeds $200,000 (single) or $250,000 (married). This pushes the effective top rate on long-term gains to 23.8%.

Key Takeaways
  • The holding period clock starts the day after you purchase an asset and runs through the day you sell. Selling one day too early converts a 15% long-term gain into a 22–32% short-term gain, a costly timing mistake on large positions.
  • Capital gains in tax-advantaged accounts (IRAs, 401(k)s) are not taxed when realized. You only pay tax when you withdraw from a traditional account. Roth accounts have no capital gains tax ever. This is a core reason to keep growth assets inside tax-advantaged accounts.
  • Donating appreciated stock directly to charity avoids capital gains tax entirely: you deduct the full market value and never pay tax on the gain. This is more tax-efficient than selling the stock and donating the cash proceeds.

Legal Strategies to Reduce Capital Gains Tax

Hold assets longer than one year. The most straightforward strategy. A 22% short-term rate dropping to 15% long-term on a $50,000 gain is $3,500 in savings.

Tax-loss harvesting. Sell investments at a loss to offset gains, a strategy covered in more depth in our tax-loss harvesting guide. Net losses can reduce your capital gains dollar-for-dollar; up to $3,000 in excess losses can offset ordinary income annually. Losses beyond $3,000 carry forward to future years.

Use tax-advantaged accounts for high-growth assets. Investments that generate significant gains belong in Roth IRAs or 401(k)s where gains are sheltered from annual taxation.

Time sales across tax years. If you have a large gain to realize, consider splitting the sale across two tax years to keep income below rate thresholds.

0% bracket harvesting. If your income is low enough to qualify for the 0% long-term rate (under ~$47,025 single in 2026), you can sell appreciated assets, realize gains tax-free, and buy them back immediately, resetting your basis higher with no tax cost. This strategy, called "gain harvesting," is the opposite of tax-loss harvesting and works when your income is temporarily low.

Primary residence exclusion. Gain from selling your primary home is excluded from tax up to $250,000 (single) or $500,000 (married), provided you lived in it for at least 2 of the last 5 years.


Capital gains rates and income thresholds adjust annually. Verify current rates at IRS.gov before making investment decisions based on tax considerations.

Frequently Asked Questions

What is the capital gains tax rate for 2026?
Short-term gains (held 12 months or less) are taxed at your ordinary income rate, 10% to 37%. Long-term gains (held more than 12 months) are taxed at 0%, 15%, or 20% depending on your total taxable income, with an additional 3.8% Net Investment Income Tax for higher earners.
How do I avoid capital gains tax legally?
Hold assets more than a year to qualify for long-term rates, use tax-loss harvesting to offset gains, keep high-growth investments in tax-advantaged accounts like a Roth IRA or 401(k), and use the primary residence exclusion when selling a home you have lived in for at least two of the last five years.
Do I pay capital gains tax on my 401(k) or IRA?
No, not while the money stays inside the account. Traditional accounts are taxed as ordinary income when you withdraw; Roth accounts are never taxed on qualified withdrawals, including all the growth.
What is the Net Investment Income Tax?
It is an additional 3.8% Medicare surtax on net investment income, including capital gains, for taxpayers with modified AGI above $200,000 (single) or $250,000 (married filing jointly). It pushes the effective top long-term capital gains rate to 23.8%.
Next step
Find your best money move in 90 seconds.

Answer a few questions about your situation and goals. Money Map points you to the highest-value next step across savings, mortgage, cards, and debt.

Editorial review

What changed since the last update

Reviewed dataRate references, product links, and dated claims were checked against current SwitchWize sources.
Updated contextRelated calculators, Money Map paths, and offer links were refreshed for this article topic.
StandardsReviewed under the SwitchWize editorial policy. See standards →

Was this guide helpful?

Why SwitchWize

SwitchWize was founded on the simple belief that banking should work for people, not the other way around. We break down information barriers with transparent rate comparisons, clear guidance, and simple tools — so every American can decide with confidence.

Read our full ethos