The short answer
No exchange is available: section 1031 has applied only to real property since 2018, and stock never qualified even before that. The tool that does take a securities gain is a qualified opportunity fund. You invest an amount equal to the gain, not the whole sale, within 180 days of the trade date; the gain comes off this year's return and, for investments made after December 31, 2026, comes back into income at the earlier of a sale of the fund interest or five years, reduced by a 10% basis step-up. Hold the fund ten years and its own appreciation is excluded. The rest of your proceeds stay in your brokerage account, and you report the deferral with a code on Form 8949 and an annual Form 8997.
At a glance
| 1031 and securities | Section 1031 reaches only real property; Form 8824 instructions list stock and partnership interests as never qualifying |
|---|---|
| What a fund accepts | Any gain treated as capital gain from a sale to an unrelated person, including stock and crypto |
| Clock | 180 days from the day the gain would be recognized; for a stock trade, the trade date |
| Amount | Only the gain is invested; the investment cannot exceed the gain you elect to defer |
| Post-2026 inclusion | Earlier of a sale or other inclusion event, or five years from the investment date |
| Step-up | 10% of the deferred gain at five years; 30% in a qualified rural opportunity fund |
| Ten-year hold | Basis becomes fair market value at sale, measured no later than the 30th anniversary |
| Forms | Form 8949 row with code Z and a negative adjustment; Form 8997 every year you hold the fund |
The exchange door is closed to securities, and it was never open to stock
Section 1031(a)(1) defers gain only on an exchange of real property held for business or investment for like-kind real property. The Form 8824 instructions spell out what is excluded: stock, bonds, notes, other securities, partnership interests and trust certificates, and they confirm that since 2018 like-kind treatment applies only to real property.
Cryptocurrency fails for the same reason. The IRS's virtual currency FAQs treat virtual currency as property and tax a sale of coins held as a capital asset as capital gain or loss, but property that is not real property cannot be exchanged. Whether you can 1031 stocks, crypto, gold or personal property covers the older personal property rules in more detail.
So the question for a stock or crypto seller is not which exchange to use. It is whether to pay the tax this year or move the gain into a qualified opportunity fund, and the two answers are the rest of this page.
A qualified opportunity fund takes the gain alone, from any capital asset, within 180 days
Section 1400Z-2(a) lets a taxpayer elect to exclude from gross income gain from the sale to, or exchange with, an unrelated person of any property, to the extent an amount equal to that gain is invested in a qualified opportunity fund during the 180-day period beginning on the date of the sale. Reg. section 1.1400Z2(a)-1 defines eligible gain as gain treated as capital gain for federal income tax purposes, which covers long-term and short-term gains on stock and on coins held for investment, and it starts the 180 days on the day the gain would be recognized, the trade date for a regular-way stock sale.
Only the gain goes in. The regulation says the qualifying investment cannot exceed the eligible gain being deferred, and the IRS's opportunity zone FAQs confirm you may defer the part of the gain you invest and keep the rest of your proceeds. On a $900,000 stock sale with a $300,000 gain, $300,000 is the number, and the other $600,000 is yours to spend or reinvest. Whether you invest the gain or the whole price walks through the arithmetic.
The fund must be a corporation or partnership holding at least 90% of its assets in qualified opportunity zone property under section 1400Z-2(d). You invest cash, or property if you prefer, though the FAQs limit the deferral on contributed property to its basis, so a seller who contributes appreciated coins directly rather than selling first should expect a smaller deferral.
What changed for money invested after December 31, 2026
Public Law 119-21, enacted July 4, 2025, rewrote the deferral in section 70421. For amounts invested after December 31, 2026, section 1400Z-2(b)(1) includes the deferred gain in income in the year containing the earlier of a sale or exchange of the fund interest, or the date five years after the investment was made. Hold the interest five years and section 1400Z-2(b)(2)(B) raises its basis by 10% of the deferred gain, 30% in a qualified rural opportunity fund, so 90% or 70% of the original gain is taxed at year five.
Money invested on or before December 31, 2026 keeps the old rule, under which the deferred gain is included for the year that contains that date. IRS Notice 2026-40 section 4.02 confirms that a gain realized in 2026 whose 180-day window reaches into 2027 can be invested on or after January 1, 2027 and get the five-year treatment. The QOF deferral length for 2026 versus 2027 compares the two calendars.
The ten-year rule survived. Under section 1400Z-2(c), an interest held at least ten years can elect a basis equal to fair market value on sale, so the fund's own appreciation escapes tax; the amended text measures that value no later than the thirtieth anniversary of the investment. Inclusion events that pull the date forward include gifts and distributions above basis, while a transfer at death is not one.
Hypothetical: $500,000 of combined stock and crypto gain sold in February 2027
Round, hypothetical numbers. On February 10, 2027 you sell stock for a $300,000 long-term gain and coins for a $200,000 long-term gain, $500,000 in all, with other income that already puts you in the 20% bracket and over the 3.8% surtax threshold.
Pay: roughly $119,000 of federal tax on the 2027 return, 20% plus 3.8% on $500,000, and the money is free.
Defer: by August 9, 2027, day 180, you invest $500,000 in a qualified opportunity fund and keep every other dollar. The $500,000 comes off the 2027 return by a code Z row on Form 8949. In February 2032, year five, 90% of it, $450,000, is taxed at the rates then in force, and the tax is paid from your own cash because the fund is not required to distribute anything. If the interest is still held in 2037 and sold at a profit, the profit is excluded.
The deferral is worth the use of about $119,000 for five years less the tax on the step-up that is never paid; against that sits ten years in an illiquid development fund that can lose value. Ask your CPA to run both columns at your state's rate as well, since not every state follows the federal deferral.
How the deferral is reported, and what happens if you stop filing the form
The Form 8949 instructions tell you to report the sale as usual, then add a separate row showing the fund's employer identification number in column (a), code Z in column (f) and the deferred gain as a negative number in column (g). Digital asset sales themselves go in the newer boxes, G through L, rather than boxes C and F, with the asset's name or symbol in column (a).
Form 8997 is then attached to every return for as long as you hold the fund interest, reporting the investments and deferred gains held at the start and end of the year, new deferrals and dispositions. The opportunity zone FAQs add that if the deferral ends early, for instance because the fund liquidates, the gain is reported on Form 8949 and the change shown on Form 8997.
The 180 days are counted from the trade date, not from settlement and not from the day a brokerage statement arrives. For gains that reach you through a partnership, the start date rules differ and are covered in what date starts the 180-day window.
The structure this situation calls for, and what to check before wiring
The replacement structure for a securities gain is an opportunity zone fund, not a trust and not a building, because an exchange is unavailable and the fund is built to take gain alone. Our opportunity zone fund page describes how we place investors into funds that accept stock, collectible and business-sale gains and that require only the gain portion to be reinvested.
A fund interest is a private, illiquid investment in development projects with a five-year tax date and a ten-year horizon. There is no public market, the fund may not distribute enough to cover the year-five tax, and principal can be lost. QOF due diligence lists what to read in the offering documents before the 180th day, and whether your state recognizes the deferral is the other half of the calculation.
Related questions
Can short-term stock or crypto gains go into a fund?
Yes. Eligible gain is any gain treated as capital gain for federal purposes, and the regulation does not require a long-term holding period. Have your CPA confirm how the character is tracked when the gain is later included.
Can I use a loss from one sale to shrink the gain I must invest?
The election is made gain by gain, and the regulation does not net losses against eligible gain in deciding how much may be deferred; coordinate the year's losses with your CPA before choosing the amount.
Does the fund have to be in a zone near me?
No. A qualified opportunity fund can hold property in any designated zone, and the designations change on January 1, 2027 under the 2025 act.
What if I invest more than my gain?
The excess is a non-qualifying investment: it is not deferred, does not get the step-up and is not excluded at ten years. Keep the two amounts separate in the fund's records.
Can I move the gain into a DST or a direct property instead?
Only by buying with after-tax cash. A trust interest or building bought with stock proceeds is a purchase, not an exchange, and the gain is taxed in the year of the sale.
Sources
Checked against these publications on October 8, 2026. Rules and figures change; confirm the current version with your CPA or attorney before you act. This page is general information, not tax or legal advice.
- 26 U.S.C. section 1031, Exchange of real property held for productive use or investment
- IRS, Instructions for Form 8824, Like-Kind Exchanges
- IRS, Frequently asked questions on virtual currency transactions
- 26 U.S.C. section 1400Z-2, Special rules for capital gains invested in opportunity zones (as amended by Public Law 119-21)
- Treas. Reg. section 1.1400Z2(a)-1, Deferring tax on capital gains by investing in opportunity zones
- Treas. Reg. section 1.1400Z2(b)-1, Inclusion of gains that have been deferred
- Public Law 119-21 (July 4, 2025), section 70421, Permanent renewal and enhancement of opportunity zones
- IRS, Notice 2026-40, Transitional guidance on qualified opportunity zones
- IRS, Opportunity zones frequently asked questions
- IRS, Instructions for Form 8949, Sales and Other Dispositions of Capital Assets
- IRS, About Form 8997, Initial and Annual Statement of Qualified Opportunity Fund Investments
- 26 U.S.C. section 1411, Imposition of tax on net investment income
