Skip to the content
FundTaxes

How to report an opportunity zone investment: Form 8949 code Z and Form 8997, line by line

Updated 8 min readBy the FundTaxes team

Reporting an opportunity zone deferralForm 8949 shows the sale with a $400,000 gain, then a second line with code Z and a negative $400,000 adjustment for the QOF deferral; Form 8997 Part II lists the QOF and the deferred gain.Form 8949, Part II (long-term) DescriptionSoldProceedsBasisCodeAdjustmentGain 100 sh XYZ03/14/26$750,000$350,000$400,000QOF deferral: Riverside QOF LLCZ($400,000)($400,000) Form 8997, Part II: gain deferred this year Riverside QOF LLC · EIN 84-1234567 · invested 05/02/26 · short/long-term: long-term Deferred gain $400,000 · attach every year you hold it

In the year you invest, report the sale normally, then add a separate Form 8949 line for the deferral: code Z in column (f) and the deferred gain as a negative adjustment in column (g). Attach Form 8997, listing the QOF and the deferred gain in Part II, and keep filing Form 8997 every year you hold the investment.

Key takeaways

  • The deferral is its own Form 8949 row, in the same part (short-term or long-term) as the gain it defers.
  • Gains reported on Form 4797 (§1231) still get their deferral row on Form 8949.
  • Form 8997 goes with your return every year you own a QOF interest, even in years with no new deferral.
  • Consumer tax software has historically handled code Z unevenly; check the forms before you file.

The year of the gain

  1. Report the sale as you normally would: on Form 8949 for stock, crypto and most capital assets, or on Form 4797 for §1231 property. The full gain appears.
  2. Add a deferral row on Form 8949, in the same part as the gain (Part I short-term, Part II long-term). Enter code Z in column (f) and the amount you invested, up to the gain, as a negative number in column (g). Identify the QOF and the date you invested as the Form 8949 instructions direct.
  3. Carry the totals to Schedule D. The deferral row offsets the gain, so only undeferred gain is taxed.
  4. Attach Form 8997. Part II lists each QOF investment made this year: the fund’s name and EIN, the investment date, and the deferred gain, with whether it is short-term or long-term.

Build your deferral lines

FundTaxes worksheet 9 · Forms 8949 and 8997
1
2
3
4
5
6
7
8Form 8949, sale row—
9Form 8949, deferral row—
10Net gain taxed this year—
11Form 8997, Part II—
12Timing check—

Illustrative layout; follow the current Form 8949 and 8997 instructions for exact column entries. The timing check uses the sale date; K-1 and installment gains can use later start dates.

Every year after

File Form 8997 with your return for every year you hold a QOF interest. Part I shows what you held on January 1, Part III what you disposed of or included during the year, and Part IV what you hold at year end. The fund does not file Form 8997 for you; the K-1 or 1099 it sends you is not enough on its own.

The year the deferral ends

For OZ 1.0 investments that year is 2026: the remaining gain is included on December 31, 2026, reported on Form 8949 and Schedule D and shown in Part III of Form 8997. The 2026 inclusion guide walks through the amount. For OZ 2.0 investments it is five years after you invest, or an earlier sale.

Tax software

Forum threads in the TurboTax and Intuit professional communities show the same problems year after year: code Z not offered for a gain that came from Form 4797, Form 8997 totals not matching, and overrides that block e-filing. Before you file:

  • open the actual Form 8949 and check the code Z row is there, in the right part, with a negative adjustment;
  • check that Schedule D shows the net gain, not the full gain;
  • check Form 8997 is attached and Part II matches your investment;
  • if the software cannot produce the forms, have a preparer who handles QOF returns file it. Find an OZ CPA.

Common mistakes

  • Deferring more than the gain, or deferring gain that is ordinary income (such as §1245 recapture).
  • Investing after the 180th day from the start date you claim.
  • Forgetting Form 8997 in years with no new deferral.
  • Reporting a K-1 gain’s deferral when the partnership already made the deferral election at the entity level.

Frequently asked questions

Report the sale normally, then add a separate row in the same part with code Z in column (f) and the deferred amount as a negative number in column (g). Schedule D then reflects only the undeferred gain.

Code Z is the adjustment code for electing to defer an eligible gain by investing it in a qualified opportunity fund.

Yes, every year you hold an investment in a QOF, whether or not you deferred a new gain that year.

Report the sale on Form 4797 as usual; the deferral itself goes on Form 8949 as a code Z row, and the result flows to Schedule D.

Support has varied by version and year, and forum users have reported problems with code Z and Form 8997. Check the generated forms before filing, or use a preparer who files QOF returns.

General information as of October 10, 2026, not tax, legal or investment advice. Rules change and may not fit your facts; confirm with a qualified adviser before you act.

Reviewed October 10, 2026 against the Internal Revenue Code, Treasury regulations and IRS guidance. Machine-readable version: Markdown.

Run the tests on your own fund

FundTaxes works out the 90% test, each QOZB’s tests and every investor’s inclusion, and fills the Form 8996 and 8997 worksheets. From $49 per fund per month. The Fund plan starts with a 14-day free trial: a card is required and nothing is charged for 14 days. Business compliance is free during launch, with no card.

More guides

All guides