Capital gains tax is the tax you owe when you sell an investment for more than you paid for it. The rate you pay depends on one thing above all else: how long you held the investment before selling. Hold for more than a year and you qualify for long-term capital gains rates, which are substantially lower than ordinary income tax rates. Sell within a year and you pay short-term rates — the same rates as your ordinary income.

Understanding this distinction is foundational to investing. The difference between short-term and long-term rates can exceed 20 percentage points at high income levels, which means a simple holding decision can materially change your after-tax return.

What Is a Capital Gain?

A capital gain is the profit from selling a capital asset — stocks, ETFs, bonds, real estate, cryptocurrency, business interests — for more than you paid for it. The formula is:

Capital gain = Sale price − Cost basis

The cost basis is what you paid for the asset, including commissions. If you bought 100 shares of a stock at $50 per share and sold them at $80, your capital gain is $3,000. That $3,000 is what gets taxed.

A capital loss occurs when you sell for less than your cost basis. Capital losses can offset capital gains, reducing your taxable gain dollar for dollar. If you have more losses than gains, up to $3,000 per year in net capital losses can offset ordinary income (wages, salary), with any remaining loss carried forward to future tax years indefinitely.

Short-Term vs Long-Term Capital Gains

Short-term capital gains apply to assets sold within 12 months or less of purchase. They are taxed as ordinary income — the same rate as your wages and salary. This is not a favorable rate.

Long-term capital gains apply to assets held for more than 12 months (at least one year and one day). They are taxed at preferential rates: 0%, 15%, or 20%, depending on your taxable income.

The 12-month holding period threshold is precise and non-negotiable. Sell on day 365 and you pay short-term rates. Sell on day 366 and you pay long-term rates. On large gains, this can mean a tax difference of thousands of dollars on a single decision.

2026 Capital Gains Tax Rates

Short-Term Capital Gains Tax Rates (Ordinary Income Rates, 2026)

Short-term gains are taxed at your marginal income tax rate. The 2026 federal income tax brackets:

Filing StatusTaxable IncomeTax Rate
SingleUp to $11,92510%
Single$11,925 – $48,47512%
Single$48,475 – $103,35022%
Single$103,350 – $197,30024%
Single$197,300 – $250,52532%
Single$250,525 – $626,35035%
SingleOver $626,35037%
Married Filing JointlyUp to $23,85010%
Married Filing Jointly$23,850 – $96,95012%
Married Filing Jointly$96,950 – $206,70022%
Married Filing Jointly$206,700 – $394,60024%
Married Filing Jointly$394,600 – $501,05032%
Married Filing Jointly$501,050 – $751,60035%
Married Filing JointlyOver $751,60037%

Long-Term Capital Gains Tax Rates (2026)

Filing StatusTaxable IncomeLong-Term Rate
SingleUp to $48,3500%
Single$48,350 – $533,40015%
SingleOver $533,40020%
Married Filing JointlyUp to $96,7000%
Married Filing Jointly$96,700 – $600,05015%
Married Filing JointlyOver $600,05020%

The Net Investment Income Tax (NIIT)

High-income investors also face the 3.8% Net Investment Income Tax on capital gains, dividends, and other investment income. This applies to the lesser of (a) net investment income or (b) the amount by which modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly).

Effective top rate on long-term capital gains: 20% + 3.8% NIIT = 23.8% for the highest earners. Effective top rate on short-term capital gains: 37% + 3.8% NIIT = 40.8% for the highest earners.

The gap at the top bracket: 17 percentage points. On a $100,000 gain, this is $17,000 in additional tax — simply for selling before the 12-month mark rather than waiting.

The Math: Why Holding Period Matters Enormously

Consider an investor in the 24% ordinary income bracket (single, $150,000 taxable income) who has a $50,000 gain in a single stock position:

Scenario A: Sold at 8 months (short-term)

  • Tax rate: 24% (ordinary income)
  • Tax owed: $12,000
  • Net gain kept: $38,000

Scenario B: Sold at 13 months (long-term)

  • Tax rate: 15% (long-term capital gains)
  • Tax owed: $7,500
  • Net gain kept: $42,500

Waiting five additional months saves $4,500 in taxes on this single trade — a 36% reduction in tax liability. The after-tax return on Scenario B is 12.5% higher than Scenario A simply due to holding period timing.

This math is why tax-aware investors build holding periods into their investment process from the start. When you are approaching the 12-month mark on a profitable position, the tax cost of selling early is a real, quantifiable number worth factoring into your decision.

How to Calculate Your Cost Basis

Your cost basis determines the size of your gain or loss. Getting this right matters — an incorrect cost basis can lead to overpaying taxes.

Original cost basis: The price you paid, including commissions. If you paid $25.50 per share for 200 shares plus a $5 commission, your cost basis is $5,105.

Adjusted cost basis: The original cost basis adjusted for corporate events (splits, spinoffs, return-of-capital distributions) and wash sales.

Average cost: For mutual funds (not ETFs), the IRS allows averaging the cost basis across all shares owned. Simple but removes tax optimization flexibility.

FIFO (First In, First Out): If you do not specify which shares you are selling, the IRS defaults to FIFO — you are selling the shares you bought first. This often means selling your oldest (and potentially highest-gain) shares first, maximizing taxable gain. FIFO is the default if you do not specify otherwise.

Specific identification: You choose which exact tax lots (specific purchase batches) to sell. This gives you maximum control to minimize your tax bill. You can choose to sell your highest-cost shares first to minimize current-year gains, or your lowest-cost shares to harvest a loss for tax purposes.

Practical example of specific identification:

You own 300 shares of a stock purchased in three batches:

  • 100 shares at $40 (lot A, purchased 3 years ago)
  • 100 shares at $70 (lot B, purchased 18 months ago)
  • 100 shares at $90 (lot C, purchased 6 months ago)

Current price: $85. You want to sell 100 shares.

Which lotGain/LossHolding PeriodTax Rate
Lot A (cost $40)$45 gainLong-term15% → $6.75 tax
Lot B (cost $70)$15 gainLong-term15% → $2.25 tax
Lot C (cost $90)$5 lossShort-termHarvest loss

Selling lot C harvests a $500 loss at short-term rates. Selling lot B generates the lowest gain at the long-term rate. Selling lot A generates a larger long-term gain. The choice depends on your tax situation for the year.

How to elect specific identification: Before selling, tell your broker which tax lots to sell. You can usually do this in the trading platform (look for “tax lot” or “cost basis” settings when placing the sell order). Keep a record of your election at the time of the trade for your records.

Set your default cost basis method in your broker’s settings. Most brokers default to FIFO or average cost — consider switching to specific identification for maximum flexibility.

The Wash Sale Rule

The wash sale rule is one of the most commonly triggered tax rules among active investors, and it trips up investors who understand it poorly.

The rule: If you sell a security at a loss and purchase the same or a “substantially identical” security within 30 days before or after the sale, you cannot claim the loss on your taxes. The loss is not eliminated — it is added to the cost basis of the new position and deferred until that position is eventually sold.

Why this matters: Tax-loss harvesting (selling losing positions to realize a loss that offsets gains) is a legitimate and valuable tax strategy. But if you immediately buy back the same security, the IRS disallows the loss.

Practical examples:

Allowed: You sell VTI at a loss, immediately buy VOO. These are not substantially identical (different indexes, different holdings). Loss is deductible.

Wash sale triggered: You sell VTI at a loss, immediately buy VTI again. Same security. Loss is disallowed.

Gray area: You sell a mutual fund, buy the ETF version of the same index. The IRS has not issued definitive guidance on all ETF/mutual fund pairs. Most tax professionals consider switching between the Vanguard 500 Index Admiral (VFIAX) and VOO to be substantially identical and a potential wash sale risk.

Also triggers wash sale: You sell a stock in your taxable account at a loss and buy it back in your IRA within the 30-day window. The wash sale rule applies across all accounts you control, including IRAs and spousal accounts.

The 30-day window: It runs 30 calendar days before the sale through 30 calendar days after. Total wash sale window: 61 days.

The deferred loss: The loss is not gone — it is added to the cost basis of the new position. When you eventually sell the replacement security, you will recapture the deferred loss. The wash sale rule defers the loss, not eliminates it.

State Capital Gains Tax

Most states tax capital gains as ordinary income and do not offer the preferential long-term rates that federal law provides. Notable exceptions:

  • No income tax states: Alaska, Florida, Nevada, New Hampshire (interest/dividends only), South Dakota, Tennessee, Texas, Washington, Wyoming — no state capital gains tax
  • Washington State: Has a 7% capital gains tax on gains exceeding $250,000, despite having no general income tax
  • California: Taxes capital gains as ordinary income at rates up to 13.3% — effectively the highest combined capital gains rate in the country for high earners
  • New York: Up to 10.9% on capital gains as ordinary income

For high-income investors in high-tax states, the combined federal + state rate on short-term gains can exceed 50%.

Tax-Loss Harvesting

Tax-loss harvesting is the deliberate realization of investment losses to offset gains and reduce your current-year tax bill. It is one of the most accessible and highest-value tax planning strategies available to investors.

The mechanics: identify positions in your taxable account trading below your cost basis. Sell them to realize the loss. Use the proceeds to buy a similar (but not substantially identical) replacement security to maintain your market exposure. The realized loss offsets gains elsewhere in your portfolio.

When it is most valuable:

  • You have significant realized gains elsewhere in your portfolio
  • You are in a high tax bracket
  • The market has experienced a drawdown, creating paper losses in otherwise good positions

For a complete guide to this strategy, see tax-loss harvesting explained.

Qualified Dividends vs Ordinary Dividends

A quick note on dividends, which follow similar rules:

Qualified dividends are taxed at the same preferential rates as long-term capital gains (0%, 15%, or 20%). To qualify, the dividend must be paid by a U.S. corporation or qualified foreign corporation, and you must hold the stock for more than 60 days during the 121-day window surrounding the ex-dividend date.

Ordinary dividends are taxed as ordinary income. REITs, most money market funds, and some international stocks pay non-qualified (ordinary) dividends.

Most S&P 500 company dividends qualify as qualified dividends. Check box 1b on your Form 1099-DIV to see how your dividends are classified.

Practical Tax Planning Rules

Hold profitable positions for at least one year before selling. The rate difference is too large to ignore in most brackets. If you are near the 12-month mark on a winning position, do the math — the tax savings from waiting a few more weeks or months often exceed any expected price change.

Use tax-advantaged accounts (IRA, 401k) for tax-inefficient holdings. Short-term trading, high-turnover funds, REITs, and bonds are best held in tax-deferred or tax-free accounts where gains are not taxed annually.

Use taxable accounts for buy-and-hold equity positions. Long-term stock appreciation in a taxable account benefits from the preferential long-term rates and deferred taxation (gains are only taxed when realized, not as they accrue).

Track your cost basis carefully. Your broker tracks this, but reconcile it against your records — especially after corporate actions, spinoffs, or dividends reinvested at various prices. Errors in cost basis lead to overpaying or underpaying taxes.

Plan large realizations across calendar years when possible. If you are selling a large position, consider spreading the realization across December and January to distribute the gain across two tax years. This can keep you in a lower bracket in each year.

Do not let the tax tail wag the investment dog. Tax efficiency matters, but it is not worth holding a position that has fundamentally deteriorated or violated your investment thesis simply to defer taxes. A 15% long-term gain rate on a stock you should have sold is still better than watching unrealized gains turn into losses.

Summary Table: Short-Term vs Long-Term

Short-TermLong-Term
Holding period12 months or lessMore than 12 months
Tax rateOrdinary income (10–37%)Preferential (0%, 15%, 20%)
Top federal rate (2026)37%20%
With NIIT (high earners)40.8%23.8%
Applicable accountsTaxable onlyTaxable only
Planning leverHold longer, use tax-adv accountsUse specific ID, harvest losses

The Bottom Line

Capital gains taxes are one of the few investment costs you have meaningful control over. You cannot control market returns, you cannot control expense ratios on most funds more than choosing the cheapest options, but you can control when you sell, which lots you sell, and how you structure your accounts.

The three highest-leverage decisions: hold investments for at least 12 months before selling to qualify for long-term rates, use tax-advantaged accounts for investments that generate lots of taxable events, and use specific identification for cost basis to minimize gains when you do sell.

For investors who actively manage taxable portfolios, the annual discipline of tax-loss harvesting can meaningfully reduce lifetime tax costs. See tax-loss harvesting explained for the full mechanics.