Selling stocks, real estate, or other investments generates capital gains — but the tax rate depends entirely on how long you held the asset. The difference between short-term and long-term rates can be enormous: a $20,000 gain might cost you $4,400 in federal tax if you sell too soon, or as little as $0 if you hold just long enough and your income is below a certain threshold. This is why the holding period is often the single most important tax decision investors make.

Key Takeaways
  • Short-term gains (assets held 1 year or less) are taxed as ordinary income — up to 37% federally.
  • Long-term gains (assets held more than 1 year) are taxed at 0%, 15%, or 20% — a significant discount.
  • The 2026 long-term 0% rate applies to single filers with taxable income up to $48,350.
  • High earners (modified AGI over $200k single / $250k MFJ) owe an additional 3.8% Net Investment Income Tax.
  • Tax-loss harvesting lets you offset gains with losses, reducing your tax bill dollar for dollar.
  • The primary home exclusion shields up to $250,000 (single) or $500,000 (MFJ) of gain from tax entirely.
Advertisement

What Counts as a Capital Gain

A capital gain occurs when you sell a capital asset for more than you paid for it. Capital assets include stocks, ETFs, mutual funds, bonds, real estate (with a notable exception for your primary home), cryptocurrency, collectibles like art and coins, and business assets. Nearly anything of investment value qualifies.

The calculation is straightforward: capital gain = sale price minus cost basis. Your cost basis is what you originally paid for the asset, including brokerage commissions and any fees paid at purchase. If you bought 100 shares of a stock at $45 each plus a $10 commission, your cost basis is $4,510. If you sell for $6,000, your gain is $1,490.

Cost basis can get more complex with inherited assets (which receive a stepped-up basis to fair market value at the date of death), gifted assets (which carry over the donor's basis in most cases), and assets with reinvested dividends (each reinvestment creates a new lot with its own basis and holding period). Your brokerage tracks covered lots purchased after 2011 and should report basis on Form 1099-B, but older positions may require your own records.

Short-Term Capital Gains (Held 1 Year or Less)

If you sell an asset you've owned for one year or less, the gain is classified as short-term and taxed at exactly the same rates as your ordinary wages and salary. There's no preferential rate — the IRS treats it as if you simply earned that amount as income. For 2026, the federal ordinary income brackets are 10%, 12%, 22%, 24%, 32%, 35%, and 37%.

Consider a concrete example: you buy a growth stock in March 2025 and sell it in November 2025 — eight months later — realizing a $10,000 gain. If your other taxable income puts you in the 22% bracket, you owe $2,200 in federal tax on that gain. If you had simply waited until March 2026 (crossing the one-year mark), your tax on the same $10,000 gain would fall to $1,500 at the 15% long-term rate — saving $700 for doing nothing except waiting four months.

The practical takeaway: before selling any appreciated position, check the acquisition date. If you're within weeks of the one-year mark, the tax savings from waiting will almost always outweigh the risk of holding a bit longer, unless there are compelling non-tax reasons to sell immediately.

Long-Term Capital Gains (Held More Than 1 Year)

Assets held for more than one year qualify for preferential long-term capital gains rates, which are significantly lower than ordinary income rates. For 2026, the thresholds are based on your total taxable income — not just the gain itself — which means your ordinary income fills the lower portion of the rate schedule first.

Rate Single Filers — Taxable Income Married Filing Jointly — Taxable Income
0%Up to $48,350Up to $96,700
15%$48,351 – $533,400$96,701 – $600,050
20%Over $533,400Over $600,050

The 0% rate is genuinely one of the most underutilized provisions in the tax code. A single filer with $35,000 in ordinary taxable income can realize up to $13,350 in long-term gains and owe zero federal capital gains tax on those gains (since $35,000 + $13,350 = $48,350, the top of the 0% bracket). Retirees, students, and lower-income workers often qualify but don't realize it.

For the 15% bracket, note the enormous range — it covers most investors well into high-income territory. A single filer would need over half a million dollars in taxable income to reach the 20% rate. For most investors, 15% is the realistic ceiling for federal long-term gains tax.

Important: These thresholds use your total taxable income, including ordinary income, not just your capital gains. If your wages put your taxable income at $40,000 and you realize a $20,000 long-term gain, the first $8,350 of the gain falls in the 0% bracket and the remaining $11,650 falls in the 15% bracket.

The Net Investment Income Tax (NIIT)

High earners face an additional 3.8% surtax on investment income under IRC Section 1411, known as the Net Investment Income Tax. This was introduced as part of the Affordable Care Act and has not been repealed. It applies to the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds the threshold.

The 2026 NIIT thresholds are: $200,000 for single filers and $250,000 for married filing jointly. Unlike the standard income tax brackets, these thresholds are not adjusted for inflation — meaning more taxpayers fall into NIIT territory each year as incomes rise.

Net investment income includes capital gains, dividends, interest, rental income (not from active participation in a real estate business), and passive income. For a high-earning investor in the 20% long-term bracket, the NIIT adds 3.8 points, bringing the effective federal rate on long-term gains to 23.8%. Add state taxes and the combined burden in a high-tax state can exceed 30%.

Tax-Loss Harvesting: Using Losses to Offset Gains

One of the most practical strategies for reducing capital gains tax is tax-loss harvesting — deliberately selling investments that have declined in value to generate a realized loss that offsets your gains. Losses offset gains dollar for dollar, and if your losses exceed your gains in a given year, you can apply up to $3,000 of net losses against ordinary income. Any remaining losses carry forward to future years with no expiration.

The mechanics: if you have $15,000 in realized long-term gains and $7,000 in realized losses from other positions, your net gain is $8,000 — you only owe tax on that $8,000. If the losses exceeded the gains by $4,000, you'd have a $3,000 deduction against ordinary income this year and a $1,000 loss carryforward.

The critical rule to know: the wash sale rule. You cannot repurchase the same security or a "substantially identical" security within 30 days before or after the sale that generated the loss, or the IRS disallows the loss. Selling 100 shares of a stock and buying them back the next day doesn't generate a deductible loss — the wash sale rule eliminates it. The standard workaround is to immediately purchase a similar (but not identical) ETF covering the same sector or index, maintaining market exposure while waiting out the 30-day window.

Advertisement

The Primary Home Exclusion

Selling your home after years of appreciation can generate a large capital gain — but the tax code provides one of its most generous breaks specifically for this situation. Under IRC Section 121, you can exclude up to $250,000 of gain if you're single or $500,000 if you're married filing jointly from the sale of your primary residence, completely tax-free.

To qualify, you must have both owned and lived in the home as your primary residence for at least two of the five years immediately before the sale. The two years don't have to be consecutive — you just need to meet both the ownership and use tests within the five-year lookback window.

If your gain exceeds the exclusion amount, only the portion above the limit is taxable, and it qualifies as a long-term gain as long as you've owned the home for more than a year. For example, a married couple with a $700,000 gain would exclude $500,000 and owe long-term capital gains tax only on the remaining $200,000.

Note: if you used the home as a rental property for part of the lookback period, only the portion of the gain attributable to the time it was your primary residence may qualify for the exclusion. Depreciation recapture on the rental portion is also taxable at ordinary income rates up to 25%, making the calculation more complex for homes that had mixed use.

Qualified Opportunity Zones and Other Strategies

Beyond holding periods and loss harvesting, several additional strategies can legally reduce your capital gains tax burden:

Calculate Your Capital Gains Tax

The interaction between ordinary income, capital gains, the NIIT, and state taxes makes capital gains tax one of the harder calculations to do by hand. The QuickUtil Capital Gains Tax Calculator handles all of it — enter your income, filing status, and gain details to see exactly what you'll owe at both federal and state levels, with a breakdown of short-term versus long-term treatment.

If you want to understand your overall tax picture — including how capital gains layer on top of your ordinary income — the Effective Tax Rate Calculator shows you the blended rate across all your income types. Both tools are free with no signup required and can help you model the "what if I wait one more year" scenario before making a selling decision you might regret come April.