Capital Gains Exceptions That Can Lower Your Tax Bill

Federal tax law contains several exceptions that let you reduce, defer, or entirely avoid capital gains tax on an appreciated asset. The most widely used capital gains tax exceptions are the 0% long-term rate for lower-income filers, the home sale exclusion of up to $250,000 or $500,000, loss offsets, like-kind exchanges of investment real estate, the qualified small business stock exclusion, charitable donations of appreciated property, the stepped-up basis for inherited assets, opportunity fund deferrals, and involuntary conversion rollovers. Each has its own eligibility rules and deadlines, and missing one can turn a tax-free event into a taxable one.

The 0% Long-Term Rate

The simplest exception is one many filers overlook. If your taxable income stays 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), and 20% applies beyond that.1Tax Foundation. 2026 Tax Brackets and Federal Income Tax Rates

Taxable income means income after deductions, not gross income. A married couple with $130,000 in total income but $30,000 in deductions and adjustments could fall within the 0% bracket for their long-term gains. The exception matters most for retirees and people in lower-earning years, who can sometimes sell appreciated stock or mutual fund shares and owe nothing federal on the gain. Short-term gains from assets held one year or less don’t qualify; they’re taxed at ordinary income rates.

The Home Sale Exclusion

Section 121 lets you exclude up to $250,000 of gain from the sale of your main home 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.

Who Qualifies

You must 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 years don’t have to be continuous, and the ownership and use periods don’t have to overlap. Twenty-four months spread across the five-year window counts.3Internal Revenue Service. Topic No. 701, Sale of Your Home

For a joint return, only one spouse needs to meet the ownership test, but both must 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. You also can’t have used the exclusion on another home sale within the past two years.3Internal Revenue Service. Topic No. 701, Sale of Your Home

Selling Early

If you sell before hitting the two-year marks because of a job relocation, a health issue, or certain unforeseen circumstances, you can claim a partial exclusion. The IRS prorates the cap based on the fraction of the requirement you did meet. A single filer who lived in the home for 12 months before a qualifying job change would take 12 divided by 24 times $250,000, or $125,000.4Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

Depreciation Recapture

One trap catches people who convert a former rental into a primary residence. You can live there for two years and legitimately claim the Section 121 exclusion, but any gain tied to depreciation deductions you took (or were entitled to take) after May 6, 1997 is not eligible for exclusion. 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 Recapture gets reported on Form 4797.6Internal Revenue Service. Instructions for Form 4797

Your adjusted basis matters here. It equals the original purchase price plus capital improvements, minus any depreciation claimed. Keeping receipts for renovations over the years of ownership can meaningfully shrink the gain that falls outside the exclusion.

Offsetting Gains With Losses

Capital losses are the most direct offset. When you sell an investment at a loss, that loss first nets against gains of the same type: short-term against short-term, long-term against long-term. Any remaining net loss then offsets 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 carry forward indefinitely. An investor who realizes a $50,000 loss with no gains to offset it deducts $3,000 per year against ordinary income and carries the remainder forward until it’s fully used or absorbed by a future gain.

The wash sale rule prevents you from claiming a loss if you buy substantially identical stock or securities within 30 days before or after the sale. The disallowed loss gets added to the cost basis of the replacement shares instead.8Office of the Law Revision Counsel. 26 US Code 1091 – Loss From Wash Sales of Stock or Securities The loss survives, but not in the year you wanted it.

Like-Kind Exchanges of Investment Real Estate

Section 1031 lets real estate investors swap one investment property for another and defer the entire capital gain. 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.

The “like-kind” definition 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, not that they be the same property type.

The Deadlines

Most exchanges are deferred rather than simultaneous, and two rigid deadlines govern the process. You have 45 days from the sale of the relinquished property to identify potential replacement properties in writing. You have 180 days from that sale, or the due date of your return including extensions if earlier, to close on the replacement.9Internal Revenue Service. Fact Sheet 2008-18, Like-Kind Exchanges Under IRC Section 1031 No extensions, no weekend or holiday adjustments. Missing either deadline ends the deferral.

A qualified intermediary must hold the sale proceeds during the exchange. If you take receipt of the money at any point, the IRS treats you as having received it, and the gain becomes immediately taxable.

Boot

If you receive cash or non-real-estate property in the exchange, that “boot” triggers immediate tax on the gain up to the boot amount. Boot also arises when you replace debt with less debt on the new property. To achieve a fully tax-deferred exchange, the replacement property should be of equal or greater value and carry equal or greater debt.

The deferred gain doesn’t disappear. It’s built into the lower basis of your replacement property, and it comes due when you eventually sell without doing another exchange. 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 offers one of the largest exclusions in the code: potentially 100% of the gain from selling stock in a qualifying small business, tax-free.

Qualification

The stock must be in a domestic C corporation, and you must have acquired it directly from the company through an original issuance, 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 moment 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 businesses are excluded, including law, accounting, consulting, financial services, and other fields whose value depends primarily on employee reputation or skill.

Holding Period and Cap

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 schedule applies: three years qualifies for 50%, four years for 75%, and five years for 100%.

The maximum excludable gain per company is the greater of $10 million or ten times your adjusted basis in the stock. For stock issued after July 4, 2025, the dollar cap increases to $15 million, 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 full $5.5 million gain.

Donating Appreciated Assets

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

The deduction for appreciated long-term capital gain property donated to a public charity is limited to 30% of your adjusted gross income. Any amount above that limit carries forward for up to five additional tax years. The strategy works especially well in a year with a large one-time income spike, since the deduction offsets other income at the same time it eliminates the gain.

One boundary: this treatment applies to 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 resets to the asset’s fair market value on the date the original owner died. The step-up erases the capital gains that accumulated during the decedent’s lifetime.11Office 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 at that price and no capital gains tax is due.12Internal Revenue Service. Gifts and Inheritances

The step-up also automatically satisfies the long-term holding period. Regardless of how long the decedent held the asset or how soon after inheriting you sell, any gain above the stepped-up basis qualifies for the lower long-term rates. In the nine community property states, both halves of community property (not just the decedent’s half) receive a step-up when one spouse dies.11Office of the Law Revision Counsel. 26 US Code 1014 – Basis of Property Acquired From a Decedent

Gifts are treated very differently. When someone gives you an appreciated asset during their lifetime, you take the donor’s original basis, inheriting the entire unrealized gain. For highly appreciated stock, the step-up at death often saves the family far more in capital gains tax than an earlier gift would.

The adjustment works both ways. 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 vanishes. A family member holding a stock with a large unrealized loss and in poor health can sell it before death to preserve the deduction; holding it until death wastes the loss.

Qualified Opportunity Funds and the 2026 Deadline

Qualified Opportunity Funds invest in designated low-income areas called Opportunity Zones. Investors can defer capital gains by reinvesting those gains into a QOF within 180 days of the sale that generated them. The initial basis in the QOF investment starts at zero.13Office of the Law Revision Counsel. 26 US Code 1400Z-2 – Special Rules for Capital Gains Invested in Opportunity Zones

The deferral is time-limited. All deferred gains in QOF investments must be recognized on December 31, 2026, whether or not the investor sells. 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.13Office 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 that date receive a 10% basis increase; seven years brings 15%. Both windows have already closed for new investments.

The larger benefit survives the recognition event. If you hold the QOF investment for at least ten years and then sell, your basis in the QOF investment itself steps up to fair market value at sale. All appreciation the QOF investment generates (as opposed to the original deferred gain) becomes permanently tax-free.

Involuntary Conversions

Section 1033 covers property destroyed, stolen, or seized through eminent domain when the insurance payout or condemnation award exceeds the property’s basis. Rather than paying capital gains tax on forced proceeds, you can defer the gain by reinvesting into replacement property that serves the same functional purpose.

The replacement window is two years after the close of the tax year in which you first realized the gain. For real property taken by condemnation or seizure, the window extends to three years. For a primary residence destroyed in a federally declared disaster, it extends to four years. Reinvest the full proceeds into qualifying replacement property and the gain is entirely deferred. Unlike Section 1031, this deferral covers personal-use property, including your home. The Section 121 home sale exclusion can also apply to a disaster-related gain, meaning you may exclude up to $250,000 or $500,000 before needing Section 1033 to defer the remainder.

The 3.8% Net Investment Income Tax

Even after you’ve minimized your capital gains rate, one additional 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).14Office of the Law Revision Counsel. 26 US Code 1411 – Imposition of Tax These thresholds are not indexed for inflation, so more filers cross them each year.

The NIIT stacks on top of regular capital gains rates. A high-income taxpayer in the 20% long-term bracket could face a combined federal rate of 23.8%. Timing gains across multiple tax years to stay below the thresholds in each year is a common response. The Section 121 home sale exclusion and the QSBS exclusion do reduce the income counted toward the NIIT, since excluded gains aren’t in net investment income to begin with.

Documentation and Penalties

Claiming any of these exceptions depends on documentation you may need to produce years after the fact. The IRS imposes a 20% accuracy-related penalty on any underpayment caused by negligence or a substantial understatement. For individuals, a substantial understatement means reported tax was off by the greater of 10% of the correct tax or $5,000.15Internal Revenue Service. Accuracy-Related Penalty

The failures that cause the most trouble tend to share a pattern: they compound quietly over years and can’t be reconstructed at closing. Failing to track the adjusted basis of a home through improvements and depreciation. Missing a 45-day or 180-day deadline in a 1031 exchange. Losing the records that prove a company met the qualified small business stock requirements throughout the holding period. Keep the paperwork from the year of purchase, and update it whenever anything changes.