This article reflects federal rules as of June 2026 and covers tax years 2025 through 2027. It notes state conformity in general terms. Tax law changes often — confirm current figures with the IRS or your state agency before you file. This article is educational and is not a substitute for advice from a licensed CPA or tax attorney for your specific situation.
Quick Answer
Yes. You can invest stock gains in a Qualified Opportunity Fund (QOF) and defer the tax. You must reinvest the gain (not the full sale price) within 180 days. Hold 10 years, and any new growth in the fund becomes tax-free. New “OZ 2.0” rules start January 1, 2027.
When you sell appreciated stock — say Apple, Tesla, or an S&P 500 index fund — you normally owe capital gains tax that year. The Opportunity Zone program lets you push that tax bill into the future by moving the gain into a special fund that invests in distressed communities, and the immediate consequence of acting is a deferred tax bill instead of a due one. The catch is the clock: you get 180 days, and missing it means you lose the break entirely.
The timing matters more than ever right now. The 2017 program is winding down, while a permanent, redesigned version — created by the One Big Beautiful Bill Act signed July 4, 2025 — turns on January 1, 2027. Through the end of 2022 alone, investors had poured $89 billion in equity into these funds across more than 5,600 neighborhoods, and the choice of when you invest now changes how big your tax break is.
Here is what you will learn:
- 💵 How to reinvest only your stock gain — not the full proceeds — and why that difference saves you money.
- ⏳ The 180-day rule, where the clock starts, and the exact dates for a 2025, 2026, and 2027 sale.
- 🏛️ The full math on deferral, the 10% (or 30% rural) basis step-up, and the 10-year tax-free exit.
- 🗺️ Why OZ 2.0 (starting 2027) may beat the old program — and the “dead zone” you should avoid.
- 🚩 The 7+ costly mistakes that wipe out the benefit, plus the forms (8949, 8997, 8996) you must file.
What an Opportunity Zone Investment Actually Is
An Opportunity Zone is a low-income census tract that a governor nominated and the U.S. Treasury certified for special tax treatment. The program was created in the 2017 Tax Cuts and Jobs Act to push private money into areas that need investment. You do not invest in the “zone” directly. Instead, you invest in a Qualified Opportunity Fund (QOF) — a corporation or partnership that holds at least 90% of its assets in opportunity zone property, such as real estate or operating businesses inside the zone.
The reason this matters for your stock gains is simple. When you sell appreciated stock, you have an eligible gain — a capital gain the IRS would normally tax that year. The opportunity zone rules let you take that eligible gain and “roll” it into a QOF. The consequence of rolling it in is that the tax is deferred, not erased, until a future trigger date. If you do nothing, you simply pay the capital gains tax now at your normal rate.
Three players connect here. You, the investor with the gain. The QOF, which receives your money and certifies itself by filing Form 8996 each year. And the IRS, which tracks your deferral through forms you attach to your return. A common misconception is that you must build or manage a project yourself — you do not. Most investors buy into a professionally managed QOF the same way they buy a private fund. What to do next: confirm the fund is a real, self-certified QOF before you wire money, because investing in a fund that is not a QOF gives you zero tax benefit.
You Reinvest the Gain — Not the Whole Sale
This is the single most important and most misunderstood rule, so it gets its own section. When you do a 1031 real estate exchange, you must reinvest everything. Opportunity Zones are different — and more generous. You only have to reinvest the capital gain portion, not the original cost (your basis) and not the full sale proceeds.
Here is what that means in plain numbers. Say you bought stock for $40,000 years ago and sold it for $100,000. Your gain is $60,000. To get the full opportunity zone benefit, you reinvest only the $60,000 gain. You keep the other $40,000 — your original money back — and spend it however you like. The consequence of this rule is real flexibility: you free up a large chunk of cash while still deferring tax on the entire gain.
You can also invest less than your full gain if you want. If you roll $30,000 of a $60,000 gain into a QOF, you defer tax on $30,000 and pay tax now on the other $30,000. A common misconception is that it is “all or nothing.” It is not — you choose how much of the gain to defer. What to do next: calculate your exact gain (sale price minus cost basis) from your brokerage 1099-B before you invest, so you move the right dollar amount and do not over- or under-fund the QOF.
The 180-Day Clock and Where It Starts
You have 180 days to invest your eligible gain into a QOF, and this deadline is unforgiving. The IRS rule says the first day of the 180-day period is the date the gain would be recognized for federal tax purposes — generally the day your stock trade settles or the gain is realized. Miss day 180, and you lose the deferral completely; there is no extension for forgetting.
For most stock sales, the 180-day window is straightforward: count 180 days from your sale date. So a sale on March 1, 2027 gives you until roughly August 28, 2027 to invest. There is a special rule for gains that flow through a partnership or S corporation (a Schedule K-1): you can choose to start your 180 days at the end of the entity’s tax year instead, which often buys you extra months.
The consequence of the clock is timing pressure, because you must also find a qualifying fund before the deadline. A common misconception is that the clock starts when you decide to invest — it does not; it starts at the gain event. What to do next: the day you sell appreciated stock, mark day 180 on your calendar and begin vetting QOFs immediately, because rushing into a weak fund at day 175 is how investors get hurt.
OZ 1.0 vs. OZ 2.0: Two Programs, Two Timelines
This is where 2025–2027 gets tricky, because two versions of the program overlap. The original program (“OZ 1.0”) came from the 2017 law and is winding down. The OBBBA made the program permanent and created a redesigned “OZ 2.0” that turns on January 1, 2027. The benefits you get depend entirely on when your gain happens and which map of zones is in effect.
Under OZ 1.0, the deferral of your stock gain ends on a fixed date — December 31, 2026 — no matter when you invested. The old 5-year and 7-year basis step-ups have already expired because there is no longer enough time to hold that long before the 2026 trigger. So a 2025 or 2026 investor under the old rules mainly gets the deferral until 2026 plus the 10-year tax-free growth benefit, not a step-up.
OZ 2.0 is cleaner and, for most people, better. Starting in 2027, the new structure gives every investor a rolling 5-year deferral that begins on the date of their investment, plus a 10% basis step-up after holding five years, plus the 10-year tax-free exit. The consequence is no more “timing cliff” — your benefit no longer shrinks just because you invested later. A common misconception is that the old zones automatically carry over; they do not. Governors nominate a new map effective January 1, 2027, and the current map runs through the end of 2028, so the two overlap for two years. What to do next: if your gain is flexible, strongly consider timing it for 2027 to capture the richer, restored benefits.
| OZ 1.0 (2017 law, winding down) | OZ 2.0 (OBBBA, starts Jan. 1, 2027) |
|---|---|
| Deferral ends on a fixed date of Dec. 31, 2026 | Rolling 5-year deferral from your investment date |
| 5- and 7-year step-ups now expired (no time to qualify) | Flat 10% basis step-up after a 5-year hold, restored |
| No special rural tier | 30% step-up for Qualified Rural Opportunity Funds |
| 10-year hold = tax-free growth | 10-year hold = tax-free growth (kept) |
| Temporary program, original 2018 zone map | Permanent program, new zone map every 10 years |
The Three Tax Benefits, In Order
The program stacks three separate benefits, and it helps to see them as steps. Each one rewards a longer hold, and the biggest prize comes last.
Benefit 1 — Deferral of your original gain
When you roll your stock gain into a QOF, you stop the tax clock on that gain. Under OZ 2.0, the deferred gain becomes taxable five years after you invest (or earlier if you sell the QOF before then). The consequence is a time-value win: you keep money that would have gone to the IRS and let it work for five more years. What to do about it: plan for the cash to pay that deferred tax bill in year five, because the bill does eventually come due.
Benefit 2 — Step-up in basis on the deferred gain
Hold the OZ 2.0 investment for five years and you get a 10% step-up in basis on your original gain, meaning you only pay tax on 90% of it. Invest through a Qualified Rural Opportunity Fund and the step-up jumps to 30%, so you are taxed on only 70% of the original gain. The consequence is a permanent reduction — not just a delay — of part of your original tax. What to do about it: if you can find a quality rural fund, the 30% tier is the most valuable step-up in the program.
Benefit 3 — Tax-free growth after 10 years
This is the headline. Hold your QOF investment for at least 10 years, and any appreciation inside the fund is completely free of federal capital gains tax. If you put in $60,000 and it grows to $150,000, the $90,000 of growth is tax-free when you sell. The consequence is potentially enormous savings on the back end. A misconception is that this also erases your original gain — it does not; benefit 1 (the deferred original gain) is still taxed at the 5-year mark. What to do about it: treat OZ as a true 10-year commitment, because exiting early forfeits the best benefit.
Worked Example: $100,000 Stock Sale, Step by Step
Let’s run the full math so you can copy it. Assume Maria sells stock in 2027 for $100,000. She bought it years ago for $40,000, so her eligible gain is $60,000. She is in the 20% federal long-term capital gains bracket plus the 3.8% net investment income tax, for a combined 23.8% rate.
If Maria does nothing: she owes 23.8% on $60,000 = $14,280 in tax for 2027, due with her return.
If Maria rolls the $60,000 gain into a standard QOF (OZ 2.0):
- She keeps her $40,000 of basis as cash. She invests only the $60,000 gain.
- Her 2027 tax bill on that gain drops to $0 — the gain is deferred.
- At year five (2032), the deferral ends. Thanks to the 10% step-up, she is taxed on only $54,000, not $60,000. At 23.8% that is $12,852 — a savings of $1,428 versus paying now, plus five years of deferral.
- She holds 10 years. The fund grows from $60,000 to $150,000. The $90,000 of appreciation is fully tax-free. At 23.8%, that saves her another $21,420.
If Maria uses a Qualified Rural Opportunity Fund: the step-up is 30%, so at year five she is taxed on only $42,000 (70% of $60,000) = $9,996 — a savings of $4,284 on the original gain alone, on top of the same tax-free 10-year growth.
The takeaway from the math: the deferral and step-up are nice, but the 10-year tax-free growth is where the real money is.
Which Situation Applies to You?
The right move depends on your facts, so find yourself below.
- You sold stock in 2025 and your 180 days run into 2026: you can still use OZ 1.0, but your deferral ends fast (Dec. 31, 2026) and there is no step-up left, so the main reason to invest is the 10-year tax-free growth.
- You have a gain in 2026 and can wait: consider whether deferring the sale into 2027 lets you use the richer OZ 2.0 benefits instead.
- Your gain is in 2027 or later: you are squarely in OZ 2.0 — full rolling deferral, 10% (or 30% rural) step-up, and tax-free growth.
- Your gain comes through a partnership/S-corp K-1: you may start your 180 days at the entity’s year-end, giving you extra time.
- You live in a non-conforming state (like California): you defer federal tax but may still owe state tax now (see below).
Federal vs. State: Conformity Is Not Automatic
Everything above is federal law. Your state may or may not follow it, and this trips up many investors. Most states that have an income tax conform to the federal opportunity zone rules, so your state tax follows your federal treatment. But several do not.
The clearest example is California, which does not conform to the federal opportunity zone benefits. A Californian who defers a $60,000 federal gain still owes California state income tax on that gain in the year of sale. The consequence is a surprise state tax bill even while the federal bill is deferred. What to do next: check your own state’s conformity with your state tax agency or CPA before investing, because a non-conforming state can shrink the real value of the deal.
| State conformity status | What it means for your stock gain |
|---|---|
| Conforming state (most states) | State tax follows federal — you defer both |
| Non-conforming (e.g., California) | You defer federal tax but owe state tax now |
| No income tax (e.g., Texas, Florida) | No state tax on the gain either way |
The Forms You Must File
Paperwork is where deferrals get lost, so handle these correctly. To defer the gain, you report it on Form 8949 (which flows to Schedule D) and elect the deferral there in the year of sale. You then file Form 8997 every year you hold the QOF, telling the IRS your beginning and ending investments. The QOF itself files Form 8996 annually to keep its certification.
The consequence of skipping Form 8997 is serious: the IRS can treat your investment as if you sold it, ending your deferral early and triggering the tax you tried to avoid. A common misconception is that you file once and forget it — Form 8997 is an annual requirement for the life of the investment. What to do next: put the annual 8997 filing on your tax checklist, and confirm your QOF sends you a statement each year with the numbers you need. If you also need help reporting the underlying stock sale, see a guide on completing Form 8949 and Schedule D.
Three Common Scenarios
These are the patterns advisors see most often. Each shows the choice and the result.
Scenario 1 — Reinvesting only the gain.
| Your move | The tax result |
|---|---|
| Sell stock for $100K (cost $40K), invest the $60K gain in a QOF | Defer tax on $60K, keep $40K in cash, start the 10-year clock |
Scenario 2 — Reinvesting a partial gain.
| Your move | The tax result |
|---|---|
| Roll $30K of a $60K gain into a QOF, keep the rest | Defer tax on $30K; pay capital gains tax now on the other $30K |
Scenario 3 — Selling the QOF too early.
| Your move | The tax result |
|---|---|
| Sell the QOF at year 6, before the 10-year mark | Original deferred gain already taxed; the fund’s growth is now fully taxable |
Three Named Examples
David, the index-fund seller. David sells an S&P 500 fund in early 2027 for a $120,000 gain. He rolls the full $120,000 into a standard QOF within 180 days, defers his 2027 tax, and gets a 10% step-up at year five. He plans to hold the full decade for tax-free growth.
Priya, the rural investor. Priya has an $80,000 stock gain in 2027. She invests through a Qualified Rural Opportunity Fund and earns the 30% step-up, so when the deferral ends she is taxed on only $56,000. Her bet is the richest step-up tier in the program.
Tom, the early seller. Tom invests a $50,000 gain but sells his QOF at year four because he needs cash. He loses the 5-year step-up and the 10-year tax-free growth, and his deferred gain becomes due. Tom’s case shows why OZ is a long-hold strategy, not a quick trade.
Mistakes to Avoid
- Investing the full proceeds instead of just the gain. You tie up cash you did not need to, with no extra tax benefit.
- Missing the 180-day deadline. Even one day late and the entire deferral is gone — there is no cure.
- Investing in a fund that is not a certified QOF. You get zero tax benefit and may have a tax mess to unwind.
- Forgetting the annual Form 8997. The IRS can end your deferral early and tax the gain you deferred.
- Selling the QOF before 10 years. You forfeit the program’s biggest benefit — tax-free appreciation.
- Assuming your state conforms. A non-conforming state like California can hit you with state tax now.
- Confusing OZ 1.0 and OZ 2.0 timing. Investing under the old rules when waiting for 2027 would have paid more.
- Trying to defer ordinary income. Only capital gains and qualified 1231 gains are eligible — not wages or interest.
Do’s and Don’ts
- Do reinvest only your gain, because keeping your basis as cash costs you nothing in tax benefit.
- Do mark day 180 the moment you sell, because the clock is strict and unforgiving.
- Do file Form 8997 every single year, because the deferral depends on it.
- Do plan for the deferral tax bill in year five, because the original gain still gets taxed then.
- Do treat OZ as a 10-year commitment, because that is when the tax-free benefit unlocks.
- Don’t invest money you may need soon, because early exit destroys the main benefit.
- Don’t skip verifying the QOF’s certification, because an uncertified fund gives no break.
- Don’t ignore your state’s rules, because a non-conforming state changes the math.
- Don’t assume old zones carry into 2027, because a new map takes effect then.
- Don’t rush into a weak fund just to beat the deadline, because the investment risk is real and uncapped.
Pros and Cons
- Pro — Deferral: you keep tax money working for years, improving your returns.
- Pro — Step-up: you permanently reduce part of your original gain (10%, or 30% rural).
- Pro — Tax-free growth: a 10-year hold can eliminate tax on all appreciation.
- Pro — Flexibility: you reinvest only the gain, not the whole sale.
- Pro — Now permanent: OZ 2.0 removes the old sunset and timing cliffs.
- Con — Illiquidity: your money is locked up for a decade to get the best benefit.
- Con — Investment risk: you absorb all the downside; the tax break does not protect your principal.
- Con — Deferral still ends: the original gain is taxed at the 5-year mark regardless.
- Con — State mismatch: non-conforming states can tax you now anyway.
- Con — Complexity: annual filings and fund vetting demand real attention or a professional.
What to Do Next
- Calculate your exact gain from your 1099-B (sale price minus cost basis) so you know the dollar amount to invest.
- Mark day 180 on your calendar from the sale date; for K-1 gains, ask about the year-end start option.
- Vet the QOF and confirm it self-certifies on Form 8996 — and decide standard vs. rural (30% step-up).
- Decide on timing: if your gain is flexible and falls near 2026/2027, weigh waiting for the richer OZ 2.0 rules.
- Check your state’s conformity with your state tax agency before you wire funds.
- File the paperwork: elect deferral on Form 8949/Schedule D this year, then Form 8997 every year after.
- Call a CPA or tax attorney if your gain is large, flows through an entity, or your state does not conform — this is exactly the kind of high-dollar, deadline-driven decision where professional help pays for itself.
FAQs
Can I invest stock gains in an Opportunity Zone?
Yes. You can roll capital gains from selling stock into a Qualified Opportunity Fund within 180 days and defer the federal tax. Only the gain must be reinvested, not the full sale proceeds.
Do I have to reinvest the whole sale amount?
No. Unlike a 1031 exchange, you only reinvest the capital gain. For a $100,000 sale with a $40,000 cost, you reinvest the $60,000 gain and keep the rest.
How long do I have to invest the gain?
180 days from the date the gain is recognized, generally your stock sale date. Partnership or S-corp gains on a K-1 may start the 180 days at the entity’s year-end instead.
When does the deferred tax become due?
At the 5-year mark under OZ 2.0 (or when you sell the QOF, if sooner). Under the old OZ 1.0 rules, all deferrals ended December 31, 2026.
What is the 10-year benefit?
Tax-free growth. Hold the QOF at least 10 years, and any appreciation inside the fund is free of federal capital gains tax when you sell — the program’s biggest advantage.
What is OZ 2.0?
The permanent program created by the 2025 OBBBA, effective January 1, 2027. It restores a rolling 5-year deferral, a 10% basis step-up, and adds a 30% rural step-up.
What is the rural Opportunity Fund benefit?
A 30% step-up. Qualified Rural Opportunity Funds give a 30% basis reduction after five years, versus 10% standard, so you are taxed on only 70% of your original gain.
Can I invest only part of my gain?
Yes. You may defer any portion you choose. If you roll half a $60,000 gain, you defer tax on $30,000 and pay tax now on the other $30,000.
Does my state follow the federal Opportunity Zone rules?
It depends. Most income-tax states conform, but some, such as California, do not. A non-conforming state can tax your deferred gain now, so confirm before you invest.
What forms do I file?
Forms 8949, 8997, and 8996. You elect deferral on Form 8949/Schedule D, file Form 8997 every year you hold the investment, and the fund files Form 8996 to stay certified.
Can I defer ordinary income like wages?
No. Only capital gains and qualified Section 1231 gains are eligible. Wages, interest, and other ordinary income cannot be rolled into a Qualified Opportunity Fund.
Are the old 2018 zones still valid for new investments?
Through 2028 for the old map. A new map of zones takes effect January 1, 2027, and governors must redesignate zones every 10 years going forward, so the maps overlap for two years.
Word count: approximately 3,700 words. This article is educational and not personalized tax advice; consult a licensed professional for your situation.
Related reading
- What Happens to Deferred Gains Invested in QOZs After 2026? (w/Examples) + FAQs
- Can You Set up Your Own Qualified Opportunity Fund? (w/Examples) + FAQs
- How Are Opportunity Zone Investments Taxed When You Sell? (w/ Examples) + FAQs
- How Do You Report an Opportunity Zone Investment? (w/Examples) + FAQs
- How Long Must You Hold an Opportunity Zone Investment? (w/Examples) + FAQs
- How to Set Up a Qualified Opportunity Fund For Maximum Deduction (w/Examples) + FAQs
- 17+ QSBS Benefit Changes From the Big Beautiful Bill (w/Examples)+ FAQs