The U.S. tax code doesn’t have a single capital gains tax-free allowance you subtract from your profit. It has several separate mechanisms, and which ones apply depends on what you sold, how long you held it, and how much other income you have. The broadest is the 0% long-term capital gains rate, which in 2026 covers taxable income up to $49,450 for single filers and $98,900 for married couples filing jointly.1Internal Revenue Service. Revenue Procedure 2025-32 On top of that, the home sale exclusion can shield up to $500,000 of profit on your primary residence, the stepped-up basis at death can erase a lifetime of appreciation, and capital losses offset gains dollar for dollar.
The 0% Long-Term Capital Gains Rate
If your total taxable income, including your gains, stays below certain thresholds, you pay zero federal tax on long-term capital gains.2Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed It’s not a fixed dollar exemption. A retiree living on $30,000 a year could sell stock at a sizable profit and owe nothing, while a high earner selling the same stock would owe 15% or 20%.
For 2026, the 0% rate applies to taxable income up to:
- Single filers: $49,450
- Married filing jointly: $98,900
- Head of household: $66,200
- Married filing separately: $49,450
- Estates and trusts: $3,300
These thresholds adjust for inflation each year.1Internal Revenue Service. Revenue Procedure 2025-32
Here’s the part that trips people up. Capital gains stack on top of your ordinary income when the brackets are applied. Say you’re a single filer with $40,000 in wages. You sell stock for a $15,000 long-term gain. Your total taxable income is now $55,000. The first $9,450 of that gain fits inside the 0% bracket, the gap between $40,000 and $49,450. The remaining $5,550 gets taxed at 15%. You don’t get the 0% rate on the whole gain just because your wages alone were below the threshold.
Why the One-Year Holding Period Decides Everything
The 0% bracket only applies to long-term gains, meaning assets held more than one year. The IRS counts from the day after you acquire the asset through the day you sell. If that stretch exceeds twelve months, the gain is long-term. Twelve months or less, and it’s short-term.3Internal Revenue Service. Topic No. 409, Capital Gains and Losses
Short-term gains get no preferential rate at all. They’re taxed as ordinary income, which runs as high as 37%. Selling a winner at eleven months instead of thirteen is one of the more expensive mistakes an investor can make. The difference between a 0% or 15% rate and a 24% or 32% ordinary rate on the same profit is real money.
The Home Sale Exclusion
Selling your home is where most Americans first meet capital gains, and it carries the single largest tax-free allowance in the code. You can exclude up to $250,000 of profit from the sale of your primary residence, or up to $500,000 if you’re married and file jointly.4Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
To qualify, you need to pass two tests:
- Ownership and use: you must have owned and lived in the home as your primary residence for at least two of the five years before the sale. The two years don’t need to be consecutive.
- Frequency: you can’t have claimed this exclusion on another home sale within the previous two years.
For joint filers claiming the full $500,000, either spouse can meet the ownership requirement, but both spouses must meet the use requirement, and neither can have claimed the exclusion in the prior two years.4Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
A surviving spouse gets a special window. If your spouse dies and you sell within two years of the death, you can still claim the full $500,000 exclusion on a single return, provided the ownership and use requirements were met just before the death.
If your gain fits entirely within the $250,000 or $500,000 limit and you qualify for the full exclusion, you generally don’t need to report the sale on your return at all.
Stepped-Up Basis at Death
When someone dies, the cost basis of their assets resets to fair market value on the date of death.5Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent This “step-up in basis” effectively erases the unrealized capital gains that built up during the decedent’s lifetime. If your parent bought stock for $20,000 that was worth $200,000 when they died, you inherit it with a $200,000 basis. Sell it the next week for $200,000 and your taxable gain is zero.
The step-up applies to assets received through inheritance, bequest, or certain trusts where the decedent retained the power to alter or revoke the trust. It doesn’t apply to assets in irrevocable trusts where the decedent gave up control, and it doesn’t apply to income the decedent had earned but not yet received, like distributions from a retirement account.
For families holding appreciated real estate, stock portfolios, or business interests, this single provision can eliminate hundreds of thousands of dollars of potential capital gains tax in one event.
Offsetting Gains With Capital Losses
Capital losses offset capital gains dollar for dollar. Sell one investment at a $10,000 gain and another at a $7,000 loss in the same year, and you pay tax on only $3,000. If your losses exceed your gains, you can deduct up to $3,000 of the remainder against ordinary income each year, or $1,500 if married filing separately.6Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses
Anything beyond that carries forward to future years indefinitely. You don’t lose the excess; it waits until you have gains to offset or until you chip away at it $3,000 at a time.7Office of the Law Revision Counsel. 26 USC 1212 – Capital Loss Carrybacks and Carryovers Someone who took large losses during a market downturn can carry them forward for years, sheltering future gains as the portfolio recovers.
Watch the Wash Sale Rule
Selling a losing position to lock in the loss and then buying back the same security is a common instinct, and the IRS has a rule aimed squarely at it. If you buy a “substantially identical” security within 30 days before or after selling at a loss, the loss is disallowed.8Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities That creates a 61-day window during which you can’t repurchase the same stock, a substantially identical ETF, or options on the same security. The rule reaches across accounts, so buying the same stock in your IRA after selling it at a loss in your brokerage account triggers a wash sale. Whether two securities are substantially identical depends on the facts, but swapping one S&P 500 index fund for a different provider’s total market fund is generally considered safe.
Gains Inside Retirement and Health Accounts
Gains realized inside 401(k)s, traditional IRAs, and Roth IRAs are not subject to capital gains tax when you buy and sell within the account. With a traditional IRA or 401(k), you eventually pay ordinary income tax on withdrawals in retirement, but no capital gains tax applies to the trades themselves. With a Roth IRA, qualified withdrawals come out completely tax-free, gains included. That makes Roth accounts one of the most effective tools for eliminating capital gains tax entirely.
Health savings accounts work the same way. Investments grow tax-free, and withdrawals for qualified medical expenses are never taxed. The trade-off with these accounts is contribution limits and withdrawal restrictions, but the capital gains benefit compounds heavily over decades.
State Taxes Still Apply
Federal rates are only part of the picture. Most states tax capital gains as ordinary income, with rates ranging from under 3% to over 13%. About eight states impose no tax on capital gains, either because they have no income tax or because they specifically exempt investment gains. A handful offer partial exclusions or lower rates for certain gains, particularly on the sale of in-state businesses or agricultural property. Qualifying for the federal 0% rate or the home sale exclusion does not automatically shield you at the state level, so the state you live in when you sell matters.