Calculating the capital gains tax on selling farmland is a multi-step job: you find your total gain, split it into pieces that are taxed differently, apply the right rate to each piece, and then add the Net Investment Income Tax if your income is high enough. Land appreciation gets long-term capital gains rates of 0%, 15%, or 20% for 2026. Depreciation you claimed on barns, drainage, or equipment gets pulled out first and taxed at 25% or at ordinary income rates. Conservation deductions can be recaptured on top of that. The blended effective rate on a typical farm sale often lands somewhere between 15% and 28%.
Start With Your Total Gain
Total gain is amount realized minus adjusted basis. Getting each number right is where most of the work sits.
Amount Realized
Amount realized is the gross selling price minus the costs of getting the sale done: real estate commissions, legal fees, survey costs, title insurance, and transfer taxes.1Internal Revenue Service. Publication 523, Selling Your Home – Section: Figuring Gain or Loss Sell a parcel for $1,200,000 and spend $70,000 on commissions and closing costs, and your amount realized is $1,130,000.
Adjusted Basis
Adjusted basis begins with what you originally paid, including settlement costs at purchase like recording fees, transfer taxes, and legal fees.2Internal Revenue Service. Publication 551 (12/2025), Basis of Assets – Section: Cost Basis Add capital improvements that added value or extended useful life: drainage tile, fencing, buildings, irrigation, grading. Then subtract depreciation claimed on farm structures, drainage, and other depreciable improvements. Subtract casualty loss deductions. Subtract soil and water conservation expenses deducted under Section 175. What’s left is your adjusted basis.
For farmland held 30 or 40 years, this reconstruction is often the hardest part of the whole calculation. Dig out the original closing statement, improvement invoices, and every prior tax return showing depreciation schedules before you do anything else.
How You Acquired the Farmland Changes Everything
Purchase, inheritance, and gift each set basis differently, and the differences can move the tax bill by six figures.
Purchased Farmland
If you bought the land, initial basis is the purchase price plus qualifying closing costs, adjusted upward for improvements and downward for depreciation. Straightforward.
Inherited Farmland
Inherited farmland gets a stepped-up basis equal to fair market value on the prior owner’s date of death.3eCFR. 26 CFR 1.1014-1 – Basis of Property Acquired From a Decedent The step-up wipes out the gain that built up during the decedent’s lifetime. If a parent paid $100,000 for the farm in 1975 and it was worth $900,000 at death, your basis is $900,000.
Watch for special use valuation. If the estate elected Section 2032A to value the land at its agricultural use rather than fair market value, that lower figure becomes your stepped-up basis, which makes your eventual gain larger than you might expect. Selling within 10 years of the decedent’s death can also trigger an additional estate tax recapture.4Office of the Law Revision Counsel. 26 USC 2032A – Valuation of Certain Farm Real Property If your family used this election, get professional advice before listing.
Gifted Farmland
Gifted farmland carries over the donor’s adjusted basis. There is no step-up.5Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust If your uncle paid $150,000, put $50,000 into improvements, and gifted you land now worth $700,000, your basis is $200,000 and the taxable gain is $500,000. Gifted farmland is often far more expensive to sell than inherited farmland.
Pull Out Depreciation Recapture Before Anything Else
Land itself isn’t depreciable, but barns, grain bins, equipment sheds, drainage systems, and fencing are. When you sell farmland with depreciated improvements, you can’t apply the long-term capital gains rate to the whole profit. The IRS carves out the depreciation-related gain first and taxes it at higher rates. This is where sellers get the biggest surprise.
Section 1250: Buildings and Structures
Farm buildings and structural improvements are Section 1250 property.6Office of the Law Revision Counsel. 26 USC 1250 – Gain From Dispositions of Certain Depreciable Realty The portion of gain attributable to straight-line depreciation you previously claimed is “unrecaptured Section 1250 gain,” taxed at a maximum federal rate of 25%.7Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed Claim $120,000 of depreciation on a barn over the years, and that $120,000 is taxed at up to 25% before any of the rest of the gain gets the lower capital gains rate.
Section 1245: Equipment and Single-Purpose Structures
Machinery, single-purpose agricultural structures, and equipment are Section 1245 property, and the recapture is harsher: gain up to the total depreciation previously claimed is taxed as ordinary income, not at capital gains rates at all.8Office of the Law Revision Counsel. 26 USC 1245 – Gain From Dispositions of Certain Depreciable Property Only gain above total depreciation gets long-term capital gains treatment.
Section 1252: Conservation Expense Recapture
If you deducted soil and water conservation expenses under Section 175 and sell the farmland within 10 years of acquiring it, a portion of those deductions is recaptured as ordinary income. The percentage steps down with holding period:9Office of the Law Revision Counsel. 26 USC 1252 – Gain From Disposition of Farm Land
- Less than 5 years: 100% recaptured
- 5 to 6 years: 80%
- 6 to 7 years: 60%
- 7 to 8 years: 40%
- 8 to 9 years: 20%
- 10 years or more: 0%
Hold the land for a decade and this rule drops out. Sell sooner, particularly after inheriting land with a fresh stepped-up basis, and it can bite.
If You Lived on the Farm
Many farmers live on the property they’re selling. If the farmstead includes your primary residence, you can exclude up to $250,000 of gain ($500,000 for a married couple filing jointly) on the residential portion, provided you owned and lived in the home for at least two of the five years before the sale.10Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
The exclusion doesn’t cover the whole property. You allocate the sale price and basis between the residential portion and the agricultural portion, and only the gain tied to the dwelling qualifies.11eCFR. 26 CFR 1.121-1 – Exclusion of Gain From Sale or Exchange of a Principal Residence The acreage, barns, and other non-residential structures are taxed normally.
Adjacent vacant land can count as part of the residence if you used it as part of your home, it’s next to the dwelling, and the house itself is sold within two years before or after the land sale. Even then the combined exclusion still caps at $250,000 or $500,000.
Apply the 2026 Long-Term Capital Gains Rates
After removing depreciation recapture and any Section 121 exclusion, the remaining long-term gain is taxed at one of three rates based on your total taxable income. For 2026:12Internal Revenue Service. Rev. Proc. 2025-32
- 0% rate: taxable income up to $49,450 single, $98,900 married filing jointly, $66,200 head of household
- 15% rate: above the 0% ceiling up to $545,500 single, $613,700 married filing jointly, $579,600 head of household
- 20% rate: taxable income above the 15% ceiling
A large farmland sale can push an otherwise moderate-income taxpayer into the 20% bracket for the year. Taxable income includes everything else you earn — wages, rental income, retirement distributions — stacked beneath the capital gain.
The 3.8% Net Investment Income Tax
On top of capital gains rates, an additional 3.8% Net Investment Income Tax applies when modified adjusted gross income exceeds $200,000 single or $250,000 married filing jointly.13Internal Revenue Service. Topic No. 559, Net Investment Income Tax These thresholds are not indexed to inflation and have been fixed since the tax took effect in 2013. The NIIT applies to the lesser of net investment income or the amount by which MAGI exceeds the threshold.14Internal Revenue Service. Questions and Answers on the Net Investment Income Tax
Take a married couple with a $400,000 farmland gain and $100,000 of other income. MAGI of $500,000 exceeds the $250,000 threshold by $250,000. NIIT applies to the smaller of the $400,000 gain or the $250,000 excess: an extra $9,500 in tax.
A Worked Example
A married couple sells farmland they bought 25 years ago for a $600,000 total gain. Of that, $80,000 was depreciation claimed on a barn (Section 1250), $30,000 was depreciation on a grain-handling structure classified as Section 1245 property, and the remaining $490,000 is land appreciation.
- $30,000 taxed as ordinary income (Section 1245 recapture)
- $80,000 taxed at up to 25% (unrecaptured Section 1250 gain)
- $490,000 taxed at 0%, 15%, or 20% based on total taxable income
- 3.8% NIIT layered on if MAGI exceeds $250,000
The blended effective rate can run from roughly 15% to over 28% depending on income, the size of the recapture, and whether the NIIT applies. Run these numbers before listing the property, not after closing.
Ways to Defer or Reduce the Tax
Several tools can shrink or postpone the bill. Each involves trade-offs.
Section 1031 Like-Kind Exchange
Reinvest the proceeds into replacement investment or business-use real property and you can defer the entire capital gains tax.15Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment Personal residences don’t qualify. You must identify replacement properties within 45 days of closing and complete the purchase within 180 days (or by your tax return due date for the year of sale, if earlier). Missing either deadline by a day kills the deferral.
You cannot touch the proceeds during the exchange. A qualified intermediary holds the funds in escrow until they’re used to buy the replacement property.16Internal Revenue Service. Miscellaneous Qualified Intermediary Information Even constructive access to the cash blows up the exchange. Set up the intermediary before closing.
Installment Sales
If you don’t need the full price up front, an installment sale spreads the taxable gain across the years you receive payments. Each payment is split into three parts: return of basis (not taxed), capital gain (taxed at the applicable rate), and interest (taxed as ordinary income). Gain recognized each year is proportional to the ratio of gross profit to total contract price. Spreading payments can keep more of the gain in lower brackets and avoid a single-year spike into the 20% rate plus NIIT.
Section 1062 Farmland Installment Election
For qualified farmland sales after July 4, 2025, a newer provision lets the seller pay the resulting income tax in four equal annual installments with no interest on the deferred amounts. The first installment is due on the original return due date for the year of sale, and the remaining three are due on each subsequent annual filing deadline.17Internal Revenue Service. Instructions for Form 8949
This spreads the payment, not the tax. To qualify, the land must have been used as a farm for substantially all of the 10 years before the sale, the buyer must be an individual actively engaged in farming, and a recorded covenant must restrict the property to agricultural use for at least 10 years after the sale. A late installment accelerates the entire remaining balance.
Conservation Easements
Donating a conservation easement permanently restricts development in exchange for a charitable deduction equal to the difference between fair market value before and after the restriction. Most taxpayers can deduct up to 50% of adjusted gross income in a year. Qualified farmers and ranchers — those earning more than half their gross income from farming — can deduct up to 100% of AGI, and any unused deduction carries forward for up to 15 years.18Internal Revenue Service. Introduction to Conservation Easements – Section: Amount of Deduction Section 170(b)
The easement also reduces your basis by the same fraction of value it takes away, so the eventual capital gain reflects both a lower amount realized and a lower basis. The charitable deduction is often the larger tax benefit.
Section 1033 Involuntary Conversions
If farmland is taken by eminent domain or sold under threat of condemnation, gain can be deferred under Section 1033 by reinvesting the proceeds into like-kind replacement property.19Office of the Law Revision Counsel. 26 USC 1033 – Involuntary Conversions The replacement period generally runs from the earliest date of the condemnation threat through two years after the end of the tax year in which gain is first recognized. Gain is recognized only to the extent proceeds exceed the cost of the replacement property. For condemned farmland, the replacement must be real property held for productive use or investment, which is a broader standard than applies to other involuntary conversions.
Forms You’ll File
Selling business-use farmland typically means at least two IRS forms beyond your standard return.
Form 4797 reports the sale of farm property used in a trade or business. You allocate the sale between land and depreciable improvements by relative fair market value and report each category separately. Part I covers land held more than one year, Part III handles depreciation recapture on Section 1245 and Section 1250 property, and a separate line addresses farmland held less than 10 years with soil or water conservation deductions.20Internal Revenue Service. Instructions for Form 4797 (2025)
Form 8949 and Schedule D report the capital gain after recapture is figured. Form 8949 lists the individual transactions with dates, proceeds, and basis; Schedule D summarizes and feeds the result onto Form 1040.17Internal Revenue Service. Instructions for Form 8949 Installment sales require Form 6252 each year payments are received. Sellers using the Section 1062 farmland installment payment election follow the Form 8949 instructions for that election.
Most farmland sales involve enough complexity across recapture, basis reconstruction, and deferral elections that professional preparation pays for itself. The cost of an accountant is a fraction of the cost of miscalculating recapture or missing a 1031 deadline.