How to Pay 0% Capital Gains Tax: Brackets, Roth Accounts, and Losses

To pay 0% capital gains tax, you keep your taxable income under the long-term capital gains threshold, use a specific exclusion the tax code offers, or shelter the asset inside an account that never taxes gains in the first place. For 2026, the 0% long-term capital gains bracket covers taxable income up to $49,450 for single filers and $98,900 for married couples filing jointly.1Internal Revenue Service. Rev. Proc. 2025-32, Section 4.03 Beyond that bracket, homeowners can exclude up to $250,000 or $500,000 in profit from a home sale, heirs get a stepped-up basis that erases decades of appreciation, and Roth accounts shield gains entirely. Two things can still cost you even when a strategy works federally: a 3.8% investment surtax and your state’s own tax.

The 0% Long-Term Capital Gains Bracket

Long-term capital gains are profits from selling assets you held more than a year, and they’re taxed at lower rates than ordinary income. The lowest rate is zero.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses For 2026, the 0% rate applies to these taxable income levels:

  • Single filers: up to $49,450
  • Married filing jointly: up to $98,900
  • Head of household: up to $66,200
  • Married filing separately: up to $49,450

These are taxable income figures, meaning gross income minus deductions.1Internal Revenue Service. Rev. Proc. 2025-32, Section 4.03 The 2026 standard deduction is $16,100 for single filers and $32,200 for married couples filing jointly.3Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 So a married couple taking the standard deduction could pull in roughly $131,100 in gross income and still stay within the 0% zone. That’s real room for retirees or anyone in a low-earning year.

One trap catches almost everyone the first time. The gain itself counts toward your taxable income. If your wages and other income add up to $40,000 and you sell stock for a $20,000 long-term gain, your taxable income is $60,000 before deductions. Only the portion of the gain that fits inside the 0% bracket escapes tax. The slice that pushes you above the line gets taxed at 15%. Selling appreciated assets in chunks across several tax years, rather than all at once, is the cleanest way to keep everything under the threshold.

Selling a Primary Residence

Selling your home is where the biggest tax-free gains happen for most people. Under Section 121 of the Internal Revenue Code, single homeowners can exclude up to $250,000 in profit, and married couples filing jointly can exclude up to $500,000.4Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence That figure is profit over your original purchase price plus any documented capital improvements, not sale price.

To qualify, you have to pass two tests. You must have owned the home and used it as your primary residence for at least two of the five years before the sale. The two years don’t need to be consecutive; scattered months of occupancy count as long as they total 24 months inside that five-year window.4Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence For a married couple claiming the full $500,000, both spouses must meet the use test, but only one has to meet the ownership test.

Partial Exclusions If You Sell Early

If you sell before hitting two years, you may still get a prorated exclusion when the sale is driven by a job relocation, a health condition, or certain unforeseen circumstances. The prorated amount equals the fraction of the two-year requirement you actually met, applied to the full $250,000 or $500,000 limit.5Internal Revenue Service. Publication 523, Selling Your Home A single filer who owned and lived in a home for 15 months before relocating for work qualifies for 15/24 of the exclusion, or about $156,250.

Homes With Rental or Business Use

If part of your home was used as rental space or a home office, the exclusion still applies to the residential portion. A home office inside your living area doesn’t force you to split the gain, but you have to recapture any depreciation you claimed, and that recaptured amount is taxable regardless of the exclusion. If the business or rental use occupied a physically separate part of the property, like a duplex with a rented-out side, the gain allocable to that separate portion doesn’t qualify at all.5Internal Revenue Service. Publication 523, Selling Your Home

Accounts Where Gains Never Show Up

Some accounts eliminate capital gains tax by design. The gains never touch your return.

Roth IRAs and Roth 401(k) Plans

Roth accounts are funded with after-tax dollars, so the money going in has already been taxed. In return, qualified distributions, including all the investment growth, come out completely tax-free.6Internal Revenue Service. Traditional and Roth IRAs Two conditions apply. You need to be at least 59½ at withdrawal (with limited exceptions for disability or death), and the account must have been open for at least five taxable years, counting from January 1 of the year of your first Roth contribution.7Office of the Law Revision Counsel. 26 USC 408A – Roth IRAs Miss either, and the earnings portion becomes taxable and may carry a 10% early withdrawal penalty.

Health Savings Accounts

HSAs offer a triple tax benefit: contributions are deductible, growth inside the account is untaxed, and withdrawals for qualified medical expenses come out tax-free.8Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans You need a high-deductible health plan to open one. After 65, you can withdraw HSA funds for any purpose and owe ordinary income tax with no penalty, which makes it function like a traditional IRA at that point.

529 College Savings Plans

Contributions aren’t federally deductible, but 529 plan earnings grow tax-free and come out untaxed when used for qualified education expenses like tuition, fees, books, and room and board.9Internal Revenue Service. 529 Plans: Questions and Answers Up to $10,000 per year can also be used tax-free for K-12 tuition. For families holding appreciated assets earmarked for education, a 529 keeps capital gains out of the picture entirely.

Offsetting Winners With Losers

You don’t always need a special account or exclusion to zero out your gain. If some of your investments lost money in the same year others gained, selling the losers cancels out the winners. A $15,000 loss neutralizes a $15,000 gain. If losses exceed gains, you can use up to $3,000 of the excess ($1,500 if married filing separately) to offset ordinary income like wages, and carry any remaining losses forward to future years.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses

The big trap is the wash sale rule. If you sell a stock at a loss and buy a substantially identical investment within 30 days on either side of the sale, the IRS disallows the loss.10Internal Revenue Service. Courseware – Wash Sales The disallowed amount gets added to the basis of the replacement shares, so the loss isn’t permanently gone, but it won’t help you in the current year. If you’re harvesting losses to offset a big gain, wait at least 31 days before repurchasing, or buy something similar but not substantially identical, such as a different fund tracking a different index.

Inherited Assets and the Stepped-Up Basis

This is the most powerful capital gains eraser in the code, and it requires no planning by the heir. When someone dies and passes an asset to an heir, the heir’s cost basis resets to the asset’s fair market value on the date of death.11Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent If a parent bought stock for $5,000 thirty years ago and it’s worth $200,000 at death, your basis becomes $200,000. Sell it the next day for $200,000, and your taxable gain is zero.

The step-up covers stocks, bonds, real estate, and other property held in taxable accounts. It does not apply to assets inside traditional IRAs or 401(k)s, since those distributions are taxed as ordinary income regardless.

Donating Appreciated Assets

Giving stock or other long-term appreciated property directly to a qualified charity lets you skip the capital gains tax you’d owe on a sale. The charity, being tax-exempt, sells the asset without owing tax either. You can claim a deduction for the full fair market value of the donated property, not just your original cost basis, as long as you held the asset more than one year.12Internal Revenue Service. Publication 526 (2025), Charitable Contributions – Capital Gain Property The deduction for appreciated securities is capped at 30% of your adjusted gross income, with unused amounts carrying forward for up to five additional years.

For people who give to multiple organizations, a donor-advised fund makes this easier. You move appreciated stock into the fund, take the immediate deduction, and direct grants to specific charities over time. This works especially well in a year with a large capital gain from another transaction that you want to offset with a same-year charitable deduction.

1031 Like-Kind Exchanges for Real Estate

Investors who sell rental or business real estate can defer capital gains tax indefinitely by reinvesting the proceeds into another investment property through a like-kind exchange. The replacement must also be held for investment or business use. You can’t swap a rental building for a vacation home.13Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment Like-kind exchanges now apply only to real property, not equipment or vehicles.

The timelines are strict. You have 45 days from the sale of the original property to identify potential replacement properties in writing, and the entire exchange must close within 180 days.13Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment A qualified intermediary holds the sale proceeds during the exchange window. If you touch the money directly at any point, the IRS treats the transaction as a taxable sale. Constructive receipt of funds is the most common reason 1031 exchanges fall apart.

Watch for Taxable Boot

Even a properly structured 1031 exchange can generate a partial tax bill if you receive something other than like-kind property. That extra value is called boot. Cash boot is the common version: keeping some sale proceeds instead of reinvesting the full amount. Mortgage boot is subtler. If the debt on your replacement property is lower than the debt on the property you sold, the IRS treats the difference as taxable debt relief. To defer the full gain, reinvest all the net proceeds and take on equal or greater debt on the replacement.

Qualified Opportunity Zones

Qualified Opportunity Zones offer a way to defer, and potentially eliminate, capital gains tax by reinvesting gains into designated low-income communities. You invest the gain itself (not the full sale proceeds) into a Qualified Opportunity Fund within 180 days of the sale that triggered it.14Internal Revenue Service. Opportunity Zones Frequently Asked Questions The 180-day clock starts on the date the gain would otherwise be recognized.

The real payoff comes from holding the QOF investment for at least 10 years. If you do, you can elect to adjust the basis of your QOF investment to its fair market value when you sell, making all appreciation during those 10-plus years permanently tax-free.14Internal Revenue Service. Opportunity Zones Frequently Asked Questions The Opportunity Zone program was recently made permanent under the One, Big, Beautiful Bill Act, though new rules and tract designations are taking effect. Verify current eligibility of specific zones and any updated deadlines before committing funds.

The 3.8% Net Investment Income Tax

Here’s where people get blindsided. Even if your long-term capital gains fall into the 0% bracket, you may still owe a separate 3.8% tax on that same investment income. The Net Investment Income Tax applies when your modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married couples filing jointly.15Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax The tax is 3.8% of the smaller of your net investment income or the amount your MAGI exceeds the threshold.

Those thresholds have never been adjusted for inflation since the tax took effect in 2013, so more taxpayers cross them each year.16Internal Revenue Service. Net Investment Income Tax Net investment income includes capital gains, dividends, interest, rental income, and royalties. Most people using the 0% capital gains bracket will have MAGI well under $200,000, so the NIIT won’t apply. But anyone combining capital gains with rental income, a working spouse’s salary, or other investment income should run the numbers. The 0% bracket and the NIIT threshold are separate calculations, and qualifying for one doesn’t protect you from the other.

State Capital Gains Taxes

Everything above is federal only. Most states tax capital gains as ordinary income, with rates ranging from 0% in states with no income tax to over 13% in the highest-tax states. Some states offer partial exclusions or preferential rates for long-term gains; many don’t distinguish between short-term and long-term holding periods at all. Zeroing out your federal bill does nothing about your state liability. Check your state’s treatment before assuming any of these strategies delivers a truly $0 total bill.

Layering Strategies in a Single Year

These approaches aren’t mutually exclusive, and the biggest tax savings usually come from stacking them. A retiree in a low-income year might sell appreciated stock to stay inside the 0% federal bracket, harvest losses in another position to soak up any gain that spills above the line, and take a qualified Roth distribution for additional spending money that doesn’t add to taxable income. A homeowner selling a primary residence might exclude $500,000 in home gains under Section 121 while donating appreciated stock to charity before year-end to erase gains elsewhere in the portfolio. The key is planning the timing of sales around your annual income, not treating each transaction on its own.