Key takeaways
- Report the sale that produced the gain as usual, then add a separate deferral row; do not adjust the sale row's column (g) for the deferral.
- On the deferral row, enter only the fund's EIN in column (a), the investment date in column (b), leave columns (c) through (e) blank, enter code Z in column (f) and the gain as a negative number in column (g).
- Use Part I with box C or I for short-term gain, or Part II with box F or L for long-term gain, and attach the Form 8949 with code Z first.
- Section 1231 gains take a negative entry on Form 4797 line 2, then two Form 8949 rows: code O for the Form 4797 amount and code Z for the deferral.
- File Form 8997 with a timely return, including extensions, every year you hold the investment; if you already filed, elect on an amended return.
How do you elect Opportunity Zone deferral on Form 8949?
You report the gain as usual and then add one more row that takes the deferred amount back out. The Instructions for Form 8949 say to report the eligible gain on the form and in the manner otherwise instructed, and not to make any adjustment for the deferral in column (g) of that row.1 The deferral goes on its own row, with code Z in column (f) and the deferred gain as a negative number in column (g).1
This guide uses the Instructions for Form 8949 for tax year 2025 and Form 8997 for tax year 2025, the versions the IRS listed as current on November 29, 2026.1,2,9 A gain invested on or after January 1, 2027 is reported on a 2027 or later return, and the IRS may change the forms before then. Check the instructions for your tax year before you file.
Fig. 1Where the election and the annual statement go
- Sale row on Form 8949Gain reported as usualAdd a row
- ElectionDeferral row on Form 8949Code Z, negative amountTotals carry over
- Schedule DTotals from Form 8949Attach to the return
- Every yearForm 8997Part II in the first year
Schedule D points back to these forms. Its instructions say to report the eligible gain as you normally would and to see the Form 8949 instructions for how to report the deferral.3 Two shortcuts are closed when you defer a gain. You cannot report that sale directly on Schedule D under Exception 1, and you cannot list fund investments on an attached summary statement under Exception 2.1
Which tax year's return do you make the election on?
You make the election on the return for the tax year in which the gain would otherwise be taxed. That is usually the year of the sale. The regulations say a valid election must follow the time, form and manner set out in IRS forms and instructions, which today means Form 8949 and Form 8997.5 The investment itself must fall inside the 180-day period that begins on the day the gain would be recognized.5
The investment can be made in the next calendar year and still belong to the earlier year's return. A gain from a sale in December is elected on that year's return, even if the money reaches the fund in March. The instructions do not ask you to trace the cash to the sale. They require only that the investment occurred within the 180-day period beginning on the date the deferred gain was realized.1
Gains passed through a partnership, S corporation, estate or trust follow the same pattern. You elect on your own Form 8949 for the year your share of the gain is reported to you, using whichever 180-day start date you chose.5 The partner's start date options are explained in partnership and K-1 gains, and the general count is in the 180-day rule.
If you realized both short-term and long-term gains during the 180 days, you choose how much of each to defer by putting the deferral row in Part I or Part II. The deferred gain keeps its character and is later taxed as the same kind of gain.1
How do you fill in the code Z row, column by column?
Each fund investment gets its own row. The instructions say to use a separate row for each investment in a different fund, or in the same fund on a different date.1 Gains of the same character from different sales, invested on the same date in the same fund, can share one row.1
| Column | What to enter | What the instructions say |
|---|---|---|
| Part and box | Part I with box C or box I (short-term), or Part II with box F or box L (long-term) | Boxes I and L are the boxes used for digital asset transactions1 |
| (a) Description | The fund's employer identification number (EIN) only | Enter only the EIN of the QOF into which you invested1 |
| (b) Date acquired | The date you invested in the fund | Enter the date you invested in the QOF1 |
| (c), (d), (e) | Nothing | Leave columns (c), (d), and (e) blank1 |
| (f) Code | Z | Code Z: you are electing to postpone all or part of your gain for investments in QOFs1 |
| (g) Adjustment | The deferred gain as a negative number, in parentheses | Amount of the deferred gain as a negative number1 |
| (h) Gain or loss | The same negative number | Column (h) is figured on each row from columns (d), (e) and (g)1 |
If you attach more than one Form 8949, the instructions say to attach the one that lists code Z first.1 Get the fund's EIN and the exact investment date from the fund in writing.
How do you report section 1231 gains and partnership gains?
Section 1231 gains start on Form 4797, so they take an extra step. Section 1231 gain is gain on business property held more than one year, such as a rental building or equipment. The Form 4797 instructions say to report the sale as usual, including any depreciation recapture, and then report the deferred amount on line 2 on the line below the sale.4 In column (a) you write "QOF investment to Form 8949", and in column (g) you enter the deferred amount as a negative number.4
The Form 8949 instructions then call for two rows in Part II:1
- 1.First row: write "QOF INVESTMENT FROM FORM 4797" in column (a), leave columns (b) through (e) blank, enter code O in column (f), and enter the Form 4797 amount as a positive number in column (g).
- 2.Second row: enter the fund's EIN in column (a) and the investment date in column (b), leave columns (c) through (e) blank, enter code Z in column (f), and enter the deferred gain as a negative number in column (g).
Only the section 1231 gain above any amount treated as ordinary income under sections 1245 and 1250 can be deferred.4 See section 1231 gains and Opportunity Zones.
A partner who defers a share of partnership gain uses the ordinary code Z row. The gain shown on the K-1 is reported where the K-1 instructions send it, and the deferral row then removes it. On Form 8997, a deferral of section 1231 gain carries special gain code B in column (d), and a deferral of section 1256 gain carries code A.2
What goes on Form 8997, and when?
Form 8997 is the investor's yearly statement of fund investments, and you file it every year you hold one. Its instructions say an eligible taxpayer holding a fund investment at any point during the year must file it with a timely filed return, including extensions.2 The Form 8949 instructions add that you file it for each year you hold the investment and for the year you dispose of it.1
| Part | What it reports | When you use it |
|---|---|---|
| Part I | Fund investments held at the start of the year | Every year after the first2 |
| Part II | Gains deferred this year by investing in a fund | The year of the election2 |
| Part III | Inclusion events, such as a sale, gift or distribution | The year an event happens2 |
| Part IV | Fund investments held at year-end | Every year you hold an investment2 |
Each row asks for the fund's EIN, the date acquired, a description such as "25% interest", a special gain code if one applies, and the deferred gain split between short-term and long-term columns.2 Only the qualifying investment is listed. The instructions say other non-qualifying investments in the same fund are not reported on Form 8997.2
A foreign taxpayer must also check Yes to irrevocably waive any treaty benefit that would exempt the deferred gain when it is later taxed; without the waiver, it cannot elect deferral.2 The fund's side of the reporting is in Form 8996 and Form 8997 explained, and the IRS keeps the current form on its Form 8997 page.9
Can you elect deferral after you have filed your return?
Yes, by filing an amended return. The IRS answers this question directly: an individual or a married couple uses Form 1040-X and attaches Form 8949.7 This comes up most with late-year sales.
Two approaches are common for a sale in the second half of the year:
- Extend the return. Form 4868 gives an individual until October 15 to file, which often covers the whole 180 days.11 Form 8997 counts as timely if it is filed with the extended return.2 The extension is only for filing, so any tax you owe is still due by the April filing date.11
- File on time and amend. Report the gain as taxable, pay the tax, invest within the 180 days, then file Form 1040-X with the Form 8949 deferral row to claim the refund.7
The election cannot fix an investment made outside the 180 days. The statute defers gain only up to the amount invested during the 180-day period beginning on the date of the sale.6 It also bars a new election on a sale if an earlier election on that sale is still in effect.6
Worked example: the rows for a $1 million stock gain
In this illustrative example, an investor sells public stock on May 10, 2027 for $1,500,000 with a $500,000 basis, a $1,000,000 long-term gain. The broker reports the basis to the IRS on Form 1099-B. The investor puts $1,000,000 into a fund on September 1, 2027, day 115 of 180. The table assumes the 2027 forms keep the layout of the 2025 instructions.
| Form and row | Entries | How it is worked out |
|---|---|---|
| 2027 Form 8949, Part II, box D: the sale | (c) 05/10/2027, (d) $1,500,000, (e) $500,000, (h) $1,000,000 | Reported as usual; no deferral adjustment in column (g) |
| 2027 Form 8949, Part II, box F: the deferral | (a) fund's EIN, (b) 09/01/2027, (f) Z, (g) ($1,000,000), (h) ($1,000,000) | Long-term gain, so Part II; columns (c) to (e) blank |
| 2027 Schedule D, long-term total from this sale | $0 | $1,000,000 + ($1,000,000) |
| 2027 Form 8997, Parts II and IV | Fund's EIN, 09/01/2027, interest acquired, $1,000,000 long-term | No special gain code, because the gain is from stock |
| 2028 to 2031 Form 8997, Parts I and IV | The same investment and $1,000,000 | Start-of-year and year-end holdings |
| Federal tax deferred for 2027 | $238,000 | $1,000,000 × 23.8% (20% plus 3.8%), no state tax |
Fig. 2Filings for one fund investment, year by year
Sep 1, 2027
Invest $1,000,000
Day 115 of 180
2027 return
Form 8949 code Z + Form 8997
Parts II and IV
2028 to 2031
Form 8997 each year
Parts I and IV
Sep 1, 2032
Fifth anniversary
$900,000 taxed for 2032
2037 or later
Ten-year sale
Basis set to fair market value
At the fifth anniversary, $900,000 is taxed: the $1,000,000 deferred minus the 10% basis increase.8 How the 2032 forms will show that amount is not yet in any published instructions. Under the 2025 instructions, deferred gain taxed on a sale goes on Form 8949 with code Y in column (f) and in Part III of Form 8997.1,2 A sale is one of the inclusion events listed in the regulations.10 Run other amounts in the Opportunity Zone tax calculator.
What are the most common Form 8949 mistakes?
Most mistakes leave the deferral row incomplete or put the deferral in the wrong place.
- Netting the deferral into the sale row's column (g) instead of using a separate row.1
- Writing the fund's name, or a description, in column (a) instead of only its EIN.1
- Entering the date of the sale in column (b) instead of the date of the investment.1
- Putting the deferral row in Part I when the gain was long-term, which changes its character.1
- Reporting the deferred sale directly on Schedule D under Exception 1, which is not allowed for that sale.1
- Skipping Form 8997 in later years. It is required every year the investment is held, not just the first.1,2
- Listing the non-qualifying part of a mixed investment on Form 8997.2
Keep the fund's written confirmation of your investment date and EIN with each year's Form 8997, because the dates must match across returns. See how the five-year deferral works and how to invest in an Opportunity Zone fund.
Common questions
How do I report an Opportunity Zone investment on Form 8949?
Add a separate row for the deferral. Enter the fund's EIN in column (a), the investment date in column (b), code Z in column (f) and the deferred gain as a negative number in column (g), leaving columns (c) to (e) blank. Report the original sale on its own row as usual.
What is code Z on Form 8949?
Code Z is the column (f) code for electing to postpone all or part of a gain by investing in a Qualified Opportunity Fund. Code Y is the code used when previously deferred gain is later reported as taxable.
Do I file Form 8997 every year?
Yes, for every year you hold a fund investment at any point, and for the year you dispose of it. It must go with a timely filed return, including extensions.
Can I make the Opportunity Zone election on an amended return?
Yes. The IRS says an individual or married couple files Form 1040-X and attaches Form 8949. The investment itself must still have been made within the 180-day period.
Where do I report a section 1231 gain I am deferring?
Start on Form 4797 line 2 with a negative entry labeled as a fund investment, then use two rows in Part II of Form 8949. The first row uses code O and a positive amount; the second uses the fund's EIN, code Z and a negative amount.
Sources
Every numbered note in this guide links to the source below.
- 1.Internal Revenue Service, “Instructions for Form 8949 (2025),” 2025. irs.gov
- 2.Internal Revenue Service, “Form 8997 (2025), Initial and Annual Statement of Qualified Opportunity Fund (QOF) Investments, with instructions,” 2025. irs.gov
- 3.Internal Revenue Service, “Instructions for Schedule D (Form 1040) (2025),” 2025. irs.gov
- 4.Internal Revenue Service, “Instructions for Form 4797 (2025),” 2025. irs.gov
- 5.Legal Information Institute, Cornell Law School, “26 CFR § 1.1400Z2(a)-1: Deferring tax on capital gains by investing in opportunity zones,” n.d. law.cornell.edu
- 6.Legal Information Institute, Cornell Law School, “26 U.S. Code § 1400Z-2: Special rules for capital gains invested in opportunity zones,” n.d. law.cornell.edu
- 7.Internal Revenue Service, “Opportunity zones frequently asked questions,” n.d. irs.gov
- 8.U.S. Government Publishing Office (govinfo), “Public Law 119-21, 139 Stat. 72 (July 4, 2025), section 70421: Permanent renewal and enhancement of opportunity zones,” 2025. govinfo.gov
- 9.Internal Revenue Service, “About Form 8997, Initial and Annual Statement of Qualified Opportunity Fund (QOF) Investments,” n.d. irs.gov
- 10.Legal Information Institute, Cornell Law School, “26 CFR § 1.1400Z2(b)-1: Inclusion of gains that have been deferred under section 1400Z-2(a),” n.d. law.cornell.edu
- 11.Internal Revenue Service, “Get an extension to file your tax return,” n.d. irs.gov
Terms in this guide
OZ Data Centers and its affiliates may sponsor, manage and invest in the Opportunity Zone funds and data center projects described here, and have a financial interest in them. This information is for general purposes only. It is not an offer to sell, or a solicitation of an offer to buy, any security, and it is not investment, tax or legal advice. Any offering will be made only through a fund's confidential offering documents, to investors who qualify (generally accredited investors), where permitted by law. Investments in private funds and data center projects are speculative and illiquid and involve a high degree of risk, including the possible loss of the entire investment. They are suitable only for investors who can bear that risk and hold the investment for ten years or longer. Opportunity Zone tax benefits are not guaranteed. They depend on each investor's circumstances, on the fund and its businesses continuing to meet the requirements of the law, and on rules that can change. Statements about future projects, timing or results are forward-looking and may not occur. Consult your own tax, legal and financial advisers.
Continue reading
← Previous: What Happens If You Sell an Opportunity Zone Investment Before 5 or 10 Years?·All 114 guides