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.
- 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 $49,450 ($98,900 married filing jointly).
- High earners (modified AGI over $200k single or head of household / $250k MFJ / $125k MFS) 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.
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 (stocks bought since 2011, mutual funds since 2012) 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 after the one-year anniversary of the purchase in March 2026, 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 $49,450 | Up to $98,900 |
| 15% | $49,451 – $545,500 | $98,901 – $613,700 |
| 20% | Over $545,500 | Over $613,700 |
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 $14,450 in long-term gains and owe zero federal capital gains tax on those gains (since $35,000 + $14,450 = $49,450, the top of the 0% bracket). For head of household filers the 0% bracket runs to $66,200, and the 15% rate to $579,600. 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 $9,450 of the gain falls in the 0% bracket and the remaining $10,550 falls in the 15% bracket, for $1,582.50 of tax.
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 NIIT thresholds are $200,000 for single and head of household filers, $250,000 for married filing jointly, and $125,000 for married filing separately. Unlike the standard income tax brackets, these thresholds are set in the law and 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, and income from businesses you don't actively participate in (rental income from a business you actively run, such as a qualifying real estate professional's, is generally excluded). 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 ($1,500 if married filing separately). 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 loss is disallowed for now (it's added to the cost basis of the replacement shares instead). 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.
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 the home was a rental or second home before it became your main home, the share of the gain from periods of that nonqualified use after 2008 generally can't be excluded (rental use after you move out, within the five-year window, doesn't count against you). 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:
- Simply hold for more than one year: Converting short-term gains to long-term is the highest-leverage move most investors can make. The rate difference between ordinary income (up to 37%) and long-term rates (0–20%) is dramatic.
- Donate appreciated assets to charity: If you donate stock or other appreciated assets held more than one year directly to a qualified charity — rather than selling first and donating cash — you can deduct the full fair market value if you itemize (generally up to 30% of AGI) and never pay capital gains tax on the appreciation. For itemizers, that beats selling and donating the cash.
- Maximize tax-deferred retirement accounts: Gains inside a traditional 401(k) or IRA grow without triggering capital gains tax annually. You pay ordinary income tax at withdrawal, but years of compounding without annual tax drag can significantly outperform a taxable account for long-term holdings.
- Qualified Opportunity Zone investments: Under the original program, gains invested in a Qualified Opportunity Fund are deferred only until December 31, 2026, so new investments now offer little deferral. The One Big Beautiful Bill Act created a permanent version for investments made starting in 2027, generally deferring the invested gain for up to five years, and gains on the new investment can be tax-free if it is held at least ten years. These are complex and carry investment risk.
- Installment sales: If you're selling a business or real estate, structuring the transaction as an installment sale spreads the gain recognition over multiple years, potentially keeping you in lower brackets each year rather than triggering a large single-year tax event.
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.
Sources: IRS Rev. Proc. 2025-32 (2026 capital gains breakpoints); IRS Topic 409, Capital gains and losses; IRS Topic 559, Net investment income tax; IRS Topic 701, Sale of your home; IRS Publication 550 (wash sales).