How to Calculate Capital Gains Tax When Selling Farmland

Capital gains tax on selling farmland is not a single calculation. Your total gain has to be split into pieces — land appreciation, depreciation recapture on buildings and equipment, and possibly recaptured conservation deductions — because each piece is taxed at a different rate. For 2026, the appreciation on the land itself is taxed at 0%, 15%, or 20% depending on your taxable income, while gain tied to depreciated buildings can hit 25% and gain tied to depreciated equipment is taxed at ordinary income rates. A 3.8% Net Investment Income Tax may sit on top.

Start With Total Gain: Amount Realized Minus Adjusted Basis

Your total capital gain is the amount realized minus your adjusted basis. Both numbers take work.

The amount realized is the gross selling price minus the costs of making the sale happen: 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 getting the deal closed, and your amount realized is $1,130,000.

Your adjusted basis starts with what you originally paid, including settlement costs like recording fees, transfer taxes, and legal fees paid at purchase.2Internal Revenue Service. Publication 551 (12/2025), Basis of Assets – Section: Cost Basis Add capital improvements: new drainage tile, fencing, buildings, irrigation systems, grading. Subtract any depreciation you claimed on farm structures and depreciable improvements, any casualty loss deductions, and any soil or water conservation expenses deducted under Section 175. What remains is your adjusted basis.

For land held 30 or 40 years, pulling these records together is often the hardest part of the whole calculation. Find the original closing statement, improvement invoices, and every prior tax return that shows depreciation before you do anything else.

How You Acquired the Land Changes Your Starting Basis

The method of acquisition can be worth hundreds of thousands of dollars in tax.

Purchased Farmland

If you bought it, your initial basis is the purchase price plus qualifying closing costs, adjusted upward for improvements and downward for depreciation.

Inherited Farmland

Inherited farmland gets a stepped-up basis equal to fair market value on the date of the prior owner’s death.3eCFR. 26 CFR 1.1014-1 – Basis of Property Acquired From a Decedent Decades of appreciation during the decedent’s lifetime disappear from the taxable gain. If your parent bought the farm for $100,000 in 1975 and it was worth $900,000 when they passed, your basis starts at $900,000.

Two complications matter. First, the executor can elect an alternate valuation date six months after death, but only if it decreases both the gross estate and the total estate tax owed.4Office of the Law Revision Counsel. 26 USC 2032 – Alternate Valuation A lower estate value also becomes your lower basis.

Second, if the estate used special use valuation under Section 2032A, the farmland was valued at its agricultural use rather than full market value. That lower valuation is your stepped-up basis, and selling within 10 years of the decedent’s death can trigger an additional estate tax recapture.5Office of the Law Revision Counsel. 26 USC 2032A – Valuation of Certain Farm Real Property Ask a tax professional before you list.

Gifted Farmland

Gifted farmland takes a carryover basis: you inherit the donor’s adjusted basis, not the current market value.6Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust If your uncle bought the farm for $150,000, made $50,000 in improvements, and gifted it to you when it was worth $700,000, your basis is $200,000. Gifted farmland is often far more expensive to sell than inherited farmland.

Carve Out the Depreciation Recapture Before Applying Capital Gains Rates

Land is not depreciable. Barns, grain bins, equipment sheds, drainage systems, and fencing are. When you sell with depreciated improvements, the IRS pulls the depreciation-related gain out first and taxes it at higher rates. This is where most sellers get surprised.

Section 1250: Buildings and Structural Improvements

Buildings and structural improvements are Section 1250 property.7Office of the Law Revision Counsel. 26 USC 1250 – Gain From Dispositions of Certain Depreciable Realty The portion of gain equal to straight-line depreciation you previously claimed is “unrecaptured Section 1250 gain,” taxed at a maximum federal rate of 25%.8Office of the Law Revision Counsel. 26 USC 1 – Tax Imposed Claim $120,000 in barn depreciation over the years, and $120,000 of your gain is taxed at up to 25% before the rest qualifies for lower long-term rates.

Section 1245: Equipment and Single-Purpose Structures

If the sale includes machinery, single-purpose agricultural structures, or equipment, gain up to the total depreciation previously claimed is taxed as ordinary income, not at capital gains rates.9Office of the Law Revision Counsel. 26 USC 1245 – Gain From Dispositions of Certain Depreciable Property Only gain above that amount gets long-term capital gains treatment.

Section 1252: Conservation Expense Recapture

If you deducted soil or water conservation expenses under Section 175 and sell the land within 10 years of acquiring it, some of those deductions are recaptured as ordinary income. The percentage falls off with holding period:10Office 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 10 years or more and this rule falls away entirely. It bites hardest when you sell soon after inheriting land with a fresh stepped-up basis.

If You Lived on the Farm, Part of the Gain May Be Excluded

If the farmstead includes your primary residence, you can exclude up to $250,000 of gain ($500,000 married filing jointly) on the residential portion, provided you owned and lived in the home for at least two of the five years before sale.11Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

The exclusion covers only the dwelling. You allocate the sale price and your basis between the residential and agricultural portions; only the residential-portion gain qualifies.12eCFR. 26 CFR 1.121-1 – Exclusion of Gain From Sale or Exchange of a Principal Residence The farm acreage, barns, and other non-residential structures are taxed under the regular rules. Adjacent vacant land you used as part of your home can qualify if the house itself sells within two years before or after the land, but the combined exclusion still cannot exceed the $250,000 or $500,000 cap.

Apply the 2026 Long-Term Capital Gains Rates

After separating out the recapture components and any Section 121 exclusion, the remaining long-term gain falls into one of three brackets. For 2026:13Internal Revenue Service. Rev. Proc. 2025-32

  • 0% rate: taxable income up to $49,450 (single), $98,900 (married filing jointly), or $66,200 (head of household)
  • 15% rate: taxable income above the 0% ceiling up to $545,500 (single), $613,700 (married filing jointly), or $579,600 (head of household)
  • 20% rate: taxable income above the 15% ceiling

Taxable income stacks: wages, rental income, and retirement distributions all sit beneath the capital gain. A single large farmland sale can easily push a moderate-income seller into the 20% bracket for that year.

The 3.8% Net Investment Income Tax

Sellers with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly) owe an additional 3.8% Net Investment Income Tax.14Internal Revenue Service. Topic No. 559, Net Investment Income Tax These thresholds are not adjusted for inflation and have not changed since 2013. The NIIT applies to the lesser of your net investment income or the amount by which your modified AGI exceeds the threshold.15Internal Revenue Service. Questions and Answers on the Net Investment Income Tax

A Worked Example

A married couple sells farmland they bought 25 years ago for a $600,000 total gain. Of that, $80,000 is depreciation on a barn, $30,000 is depreciation on a grain-handling structure classified as Section 1245 property, and $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% depending on total taxable income
  • 3.8% NIIT if modified AGI exceeds $250,000

The blended effective rate can run from roughly 15% to over 28% depending on the seller’s income, the recapture mix, and whether the NIIT applies. Run these numbers before listing, not after closing.

Ways to Defer or Reduce the Tax

Section 1031 Like-Kind Exchange

A like-kind exchange defers the entire capital gain if you reinvest into replacement investment or business-use real property. Both the property sold and the property bought must be held for productive use or investment.16Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment Personal residences do not qualify.

The deadlines are strict. You must identify potential 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 date by a day kills the deferral. A qualified intermediary must hold the sale proceeds; if you get constructive access to the cash, the exchange fails.17Internal Revenue Service. Miscellaneous Qualified Intermediary Information Set the intermediary up before closing.

Installment Sale

If you don’t need the full price up front, an installment sale spreads the gain across the years you receive payments. Each payment splits into return of basis, capital gain, and interest, with the gain proportion equal to gross profit over total contract price. Spreading payments over several years can keep more of the gain in lower brackets and can avoid the NIIT in some years.

Section 1062: The New Farmland Installment Payment Election

For qualified farmland sales after July 4, 2025, a seller can 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; the remaining three are due on each following annual filing deadline.18Internal Revenue Service. Instructions for Form 8949 The election spreads the payment, not the tax itself.

To qualify, the land must have been used as a farm for substantially all of the 10 years before 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. Miss any installment deadline and the entire remaining balance becomes due at once.

Conservation Easements

Donating a conservation easement permanently restricts development in exchange for a charitable deduction equal to the drop in fair market value the restriction causes. 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, with unused amounts carried forward up to 15 years.19Internal Revenue Service. Introduction to Conservation Easements – Section: Amount of Deduction Section 170(b) The easement also reduces your adjusted basis by the same fraction of value given up, so the charitable deduction is usually the larger benefit.

Section 1033: Involuntary Conversions

When farmland is taken by eminent domain or sold under threat of condemnation, Section 1033 defers gain to the extent you reinvest into replacement property of a like kind. 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 any gain is first recognized.20Office of the Law Revision Counsel. 26 USC 1033 – Involuntary Conversions For condemned farmland, the replacement must be real property held for productive use or investment.

Forms You Will File

Selling farmland used in a business typically involves several IRS forms beyond your standard return.

Form 4797 is the primary form for reporting the sale of business-use farm property. You allocate the sale between land and depreciable improvements based on relative fair market values and report each separately. Part I covers land held more than a year, Part III handles Section 1245 and 1250 depreciation recapture, and a specific line addresses farmland held less than 10 years on which conservation expenses were deducted.21Internal Revenue Service. Instructions for Form 4797 (2025)

Form 8949 and Schedule D report the capital gain once recapture amounts are settled. Form 8949 lists individual transactions; Schedule D summarizes and feeds the final gain onto Form 1040.18Internal Revenue Service. Instructions for Form 8949 An installment sale requires Form 6252 in each year you receive payments. Sellers making the Section 1062 farmland installment payment election follow the Form 8949 instructions for that election.

Between depreciation recapture, basis reconstruction, and the deferral elections, most farmland sales are complex enough that professional preparation pays for itself. The cost of an accountant is small next to the cost of misfiguring recapture or missing a 1031 deadline.