Capital Gains Exceptions That Can Lower Your Tax Bill

Federal tax law contains several capital gains tax exceptions that can reduce, defer, or completely eliminate the tax on investment profits. The main ones are the 0% long-term rate for lower-income filers, the home sale exclusion of up to $250,000 (or $500,000 for married couples), offsetting gains with capital losses, like-kind exchanges of investment real estate under Section 1031, the qualified small business stock exclusion under Section 1202, charitable donations of appreciated assets, the stepped-up basis for inherited property, Qualified Opportunity Fund deferrals, and the involuntary conversion rules under Section 1033. Each has its own eligibility test and its own deadlines, and the deadlines are unforgiving.

The 0% Long-Term Rate for Lower Incomes

If your taxable income falls below certain thresholds, the federal rate on long-term capital gains is zero. For 2026, the 0% rate applies to taxable income up to $49,450 for single filers, $98,900 for married couples filing jointly, and $66,200 for heads of household. The 15% rate covers income above those levels up to $545,500 (single) or $613,700 (joint). The 20% rate kicks in beyond that.1Tax Foundation. 2026 Tax Brackets and Federal Income Tax Rates

This matters most for retirees and anyone in a lower-earning year. A retiree living primarily on Social Security may be able to sell appreciated stock or mutual fund shares and owe nothing on the gain. “Taxable income” here means income after deductions, not gross income, so a married couple with $130,000 in total income but $30,000 in deductions and other adjustments could land inside the 0% bracket for their long-term gains.

Short-term gains don’t qualify. Anything held one year or less is taxed at ordinary income rates regardless of your bracket.

Selling Your Primary Home

The home sale exclusion under Section 121 is the most commonly claimed capital gains break. Sell your main home at a profit, and you can exclude up to $250,000 of the gain from federal tax as a single filer or up to $500,000 as a married couple filing jointly.2Internal Revenue Service. Publication 523, Selling Your Home For most homeowners, that wipes out the entire gain.

The Two-Year Tests

To qualify, you have to pass two tests during the five-year period ending on the sale date. The ownership test requires that you owned the home for at least two of those five years. The use test requires that you lived in it as your primary residence for at least two of those five years. The two sets of two years don’t have to be the same, and the time doesn’t have to be continuous: 24 months spread across the five-year window is enough.3Internal Revenue Service. Topic No. 701, Sale of Your Home

For married couples filing jointly, only one spouse needs to meet the ownership test, but both must independently meet the use test to claim the full $500,000.2Internal Revenue Service. Publication 523, Selling Your Home Unmarried co-owners who each meet both tests can each claim up to $250,000 on their own returns. You also can’t have claimed the exclusion on another home sale within the past two years.3Internal Revenue Service. Topic No. 701, Sale of Your Home

A Partial Exclusion When Life Forces a Move

If you sell before meeting the two-year ownership or use requirement because of a job relocation, health problem, or certain unforeseen circumstances, you can still claim a partial exclusion. The IRS prorates it based on the fraction of the two-year requirement you did meet. Live in the home for 12 months before a qualifying job change forces a move, and you’d divide 12 by 24 and multiply by $250,000, giving a reduced exclusion of $125,000.4Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

The Depreciation Recapture Trap

Converting a former rental into a primary residence catches people off guard. You can legitimately live in the property for two years and claim the Section 121 exclusion, but any gain tied to depreciation deductions you took (or were entitled to take) after May 6, 1997, cannot be excluded. That portion is taxed at a maximum rate of 25%.2Internal Revenue Service. Publication 523, Selling Your Home5Internal Revenue Service. Topic No. 409, Capital Gains and Losses This recapture is reported on Form 4797.6Internal Revenue Service. Instructions for Form 4797

Your gain is calculated by subtracting the property’s adjusted basis from the net sales price. Adjusted basis is the original purchase price plus capital improvements, minus any depreciation claimed. Receipts for renovations and improvements can meaningfully shrink the gain that falls outside the exclusion, so keep them.

Offsetting Gains With Losses

Capital losses are the most direct way to reduce capital gains tax. When you sell an investment at a loss, that loss first nets against gains of the same type: short-term losses cancel short-term gains, long-term against long-term. Any remaining net losses then offset gains of the other type. If total losses exceed total gains for the year, you can deduct up to $3,000 of the excess against ordinary income ($1,500 if married filing separately).7Office of the Law Revision Counsel. 26 US Code 1211 – Limitation on Capital Losses

Unused losses beyond that $3,000 limit carry forward indefinitely. An investor who realizes a $50,000 loss with no gains to offset it would deduct $3,000 a year and carry the balance forward until it’s fully used, which is useful in a later year when a large gain comes in.

Watch the wash sale rule. If you buy substantially identical stock or securities within 30 days before or after the sale, the loss is disallowed in that year. The IRS treats the 61-day window as a single position, and the disallowed loss gets added to the cost basis of the replacement shares.8Office of the Law Revision Counsel. 26 US Code 1091 – Loss From Wash Sales of Stock or Securities The loss isn’t gone, but you can’t use it when you wanted to.

Deferring Real Estate Gains Under Section 1031

Section 1031 lets real estate investors swap one investment property for another and defer the entire capital gain. The rationale: your money stayed invested in real estate, you just changed which property you hold. Since the Tax Cuts and Jobs Act of 2017, this deferral applies only to real property used in a business or held for investment. Personal property, artwork, and equipment no longer qualify.

“Like-kind” is broad for real estate. You can exchange an apartment building for vacant land, a warehouse for a strip mall, or a farm for an office building. What matters is that both properties are held for investment or business use.

The 45- and 180-Day Deadlines

Most exchanges aren’t simultaneous. In a deferred exchange, two rigid deadlines run from the date you sell the relinquished property. You have 45 days to identify potential replacement properties in writing. You have 180 days to close on the replacement, or until your tax return’s due date including extensions, whichever comes first.9Internal Revenue Service. Fact Sheet 2008-18, Like-Kind Exchanges Under IRC Section 1031 No extensions. No exceptions for weekends or holidays. Miss either, and the deferral is gone.

A qualified intermediary must hold the sale proceeds during the exchange. If you touch the money, even briefly, the IRS treats you as having received it and the gain becomes immediately taxable.

Boot and Partial Taxability

If you receive cash or other non-real-estate property during the exchange, that amount is called “boot” and triggers immediate tax on the gain, up to the boot amount. Boot also arises when you reduce your mortgage debt without replacing it with equal or greater debt on the new property. For a fully tax-deferred exchange, the replacement property must be of equal or greater value and carry equal or greater debt.

The gain doesn’t disappear. It’s baked into the lower basis of the replacement property, and when you eventually sell without doing another exchange, the accumulated deferred gain comes due. Investors who keep exchanging can defer gains for decades, and if they hold the final property until death, the stepped-up basis can eliminate the deferred gain entirely.

Qualified Small Business Stock

Section 1202 is one of the most generous breaks in the code: a potential 100% exclusion of gain from selling stock in a qualifying small business. For early investors in startups, this can mean millions of dollars of tax-free profit.

What Qualifies

The stock must be in a domestic C corporation, and you must have acquired it directly from the company, through original issuance at founding, a later funding round, or as compensation for services. Stock purchased from another shareholder on the secondary market doesn’t qualify.

The company’s size matters at the time your stock is issued. For stock issued before July 5, 2025, the corporation’s gross assets cannot have exceeded $50 million immediately after the issuance. For stock issued after July 4, 2025, that threshold rises to $75 million, with inflation adjustments beginning in 2027.

The corporation must use at least 80% of its assets in one or more active qualified businesses during substantially all of your holding period. Certain service-oriented fields are excluded, including law, accounting, consulting, and financial services, where the primary value comes from the reputation or skill of employees. The exclusion is designed to channel investment toward product- and technology-focused companies.

Holding Period and Caps

You must hold the stock for more than five years to claim the full 100% exclusion. For stock acquired after July 4, 2025, a tiered system applies: three years gets a 50% exclusion, four years gets 75%, and five years gets the full 100%.

The maximum excludable gain is the greater of $10 million or ten times your adjusted basis in the stock, applied per company. For stock issued after July 4, 2025, the dollar cap rises to $15 million, also indexed for inflation starting in 2027. An investor who put $500,000 into a qualifying startup and sold for $6 million after five years would exclude the entire $5.5 million gain. For stock acquired after September 27, 2010, the five-year exclusion percentage is 100%, meaning the qualifying gain is entirely free of federal income tax.

Rolling Into New QSBS Before Five Years

Sell qualifying stock after holding it for more than six months but before the five-year mark, and Section 1045 lets you defer the gain by reinvesting the proceeds into new qualified small business stock within 60 days.10Office of the Law Revision Counsel. 26 US Code 1045 – Rollover of Gain From Qualified Small Business Stock to Another Qualified Small Business Stock The five-year clock restarts, but you can exit one company and reinvest in another without an immediate tax hit.

Donating Appreciated Assets to Charity

Donating appreciated investments directly to a qualified charity sidesteps capital gains tax entirely and generates a charitable deduction. If you’ve held stock, mutual fund shares, or other capital assets for more than one year and donate them instead of selling, neither you nor the charity pays capital gains tax on the appreciation. You then deduct the asset’s full fair market value on your tax return, assuming you itemize.11Internal Revenue Service. Charitable Contribution Deductions

The deduction for appreciated long-term capital gain property given to a public charity is limited to 30% of your adjusted gross income. Anything above that limit carries forward for up to five additional years. This works especially well when you’re facing a large one-time gain: donating appreciated shares you’ve held for years eliminates the capital gains tax on those shares and creates a deduction that offsets other income.

This strategy only works for assets held longer than one year. Donate short-term gain property and your deduction is limited to your cost basis, not fair market value.

Stepped-Up Basis for Inherited Assets

When you inherit an asset, your cost basis is reset to the asset’s fair market value on the date the original owner died. This step-up effectively erases all the capital gains that accumulated during the decedent’s lifetime.12Office of the Law Revision Counsel. 26 US Code 1014 – Basis of Property Acquired From a Decedent If your parent bought stock for $20,000 decades ago and it was worth $500,000 at death, your basis becomes $500,000. Sell it the next day for that amount, and you owe zero capital gains tax.13Internal Revenue Service. Gifts and Inheritances

The step-up automatically satisfies the long-term holding period requirement. However long the decedent held the asset or however soon you sell after inheriting, any gain above the stepped-up basis qualifies for the lower long-term rates.

Gifts Are Treated Differently

Lifetime gifts don’t get this treatment. When someone gives you an appreciated asset while alive, you take over the donor’s original basis, often called a “carryover basis,” which means you inherit the entire unrealized gain. A parent weighing whether to gift or bequeath highly appreciated stock should understand that the step-up at death could save the family far more in capital gains taxes than any benefit from gifting earlier.

Community Property States

In community property states, both halves of community property receive a step-up when one spouse dies, not just the decedent’s half.12Office of the Law Revision Counsel. 26 US Code 1014 – Basis of Property Acquired From a Decedent In common law property states, only the decedent’s share steps up. This “double step-up” can be a meaningful planning advantage for married couples in the nine community property states.

The Step-Down Problem

The basis adjustment runs in both directions. If an inherited asset has declined in value, the heir’s basis steps down to the lower fair market value at death, and the loss that occurred during the decedent’s lifetime vanishes. If a family member holds a stock with a large unrealized loss and is in poor health, selling before death preserves the capital loss deduction. Holding until death wastes it permanently.

Qualified Opportunity Funds

Qualified Opportunity Funds invest in designated low-income areas called Opportunity Zones. Since 2018, investors have been able to defer capital gains by reinvesting those gains into a QOF within 180 days of the sale that generated the gain. The investor’s initial basis in the QOF investment starts at zero.14Office of the Law Revision Counsel. 26 US Code 1400Z-2 – Special Rules for Capital Gains Invested in Opportunity Zones

The December 31, 2026 Recognition Date

All deferred gains in QOF investments must be recognized on December 31, 2026, whether or not the investor sells. The tax is calculated on the difference between the investor’s adjusted basis and the lesser of the original deferred gain or the investment’s fair market value on that date.14Office of the Law Revision Counsel. 26 US Code 1400Z-2 – Special Rules for Capital Gains Invested in Opportunity Zones

Investors who held their QOF investment for at least five years before December 31, 2026 (meaning they invested before 2022) receive a 10% reduction in the deferred gain through a basis increase. Those who held for seven years (invested before the end of 2019) receive a total 15% reduction. These windows have already closed for new investments.14Office of the Law Revision Counsel. 26 US Code 1400Z-2 – Special Rules for Capital Gains Invested in Opportunity Zones

The Ten-Year Exclusion

The most powerful QOF benefit survives the 2026 recognition event. Hold your QOF investment for at least ten years and sell, and your basis in the QOF investment is stepped up to fair market value at the time of sale. All appreciation generated by the QOF investment, as opposed to the original deferred gain, is permanently tax-free. For investors who entered QOFs in 2018 or 2019, this ten-year window begins opening in 2028 and 2029.

Involuntary Conversions

Section 1033 provides relief when property is destroyed, stolen, or seized through eminent domain and the insurance payout or condemnation award exceeds the property’s basis. Instead of paying capital gains tax on what amounts to forced proceeds, you can defer the gain by reinvesting the money into replacement property that serves the same functional purpose as what you lost.

The replacement window is two years after the close of the tax year in which you first realized the gain. For real property taken through condemnation or seizure, the window extends to three years. Reinvest the full amount of the proceeds into qualifying replacement property and the gain is entirely deferred. Unlike Section 1031, this deferral also applies to personal-use property, including your home.

For a primary residence destroyed in a federally declared disaster, the replacement period extends to four years. The Section 121 home sale exclusion can also apply to the gain, so disaster victims may be able to exclude up to $250,000 or $500,000 before needing the Section 1033 deferral on anything left over.

The 3.8% Net Investment Income Tax

Even after you’ve minimized your capital gains rate, one more tax can apply. The net investment income tax adds a 3.8% surcharge on capital gains, dividends, rental income, and other investment income for taxpayers whose modified adjusted gross income exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately).15Office of the Law Revision Counsel. 26 US Code 1411 – Imposition of Tax These thresholds aren’t adjusted for inflation, so more taxpayers hit them each year.

The NIIT stacks on top of regular capital gains rates, meaning a high-income taxpayer in the 20% long-term bracket could face a combined federal rate of 23.8%. Planning around it often involves timing the recognition of gains across multiple years to stay below the thresholds. The Section 121 home sale exclusion and the QSBS exclusion do reduce the income that counts toward the NIIT calculation, since excluded gains aren’t included in net investment income.

Documentation and Penalties

Claiming these exceptions requires careful documentation and accurate reporting. The IRS imposes a 20% accuracy-related penalty on any underpayment caused by negligence or a substantial understatement of tax. For individuals, a substantial understatement means your reported tax was off by the greater of 10% of the correct tax or $5,000.16Internal Revenue Service. Accuracy-Related Penalty

The mistakes that most often create problems: failing to track the adjusted basis of a home through years of improvements and depreciation, missing the 45- or 180-day deadlines in a 1031 exchange, and losing documentation that proves a company met the qualified small business stock requirements throughout the holding period. These aren’t errors you discover at tax time. They compound quietly over years of ownership, and by the time you sell, it’s too late to reconstruct what you didn’t record.