AJ Designer

Gain on Sale Calculator

Gain on sale equals sale price minus adjusted basis

Solution

Share:

Gain on Sale Equation

Gain on sale is the difference between the sale price and the adjusted basis of an asset. A positive result indicates a gain (profit); a negative result indicates a loss. The adjusted basis accounts for original cost, improvements, and depreciation.

GOS = SP - AB

How It Works

Gain on sale is the difference between what you sell an asset for and its adjusted basis. A positive number is a gain (profit); a negative number is a loss. The adjusted basis accounts for the original cost, improvements, and depreciation. For tax purposes, long-term gains (assets held over one year) are taxed at preferential rates of 0%, 15%, or 20%, while short-term gains are taxed as ordinary income.

Example Problem

You sell a rental property for $400,000. The adjusted basis is $310,000 (original $350,000 purchase + $20,000 improvements − $60,000 depreciation).

  1. Identify the sale price: SP = $400,000
  2. Determine the original purchase price: $350,000
  3. Add capital improvements to the purchase price: $350,000 + $20,000 = $370,000
  4. Subtract accumulated depreciation to find adjusted basis: $370,000 − $60,000 = $310,000 (AB)
  5. Apply the gain formula: GOS = SP − AB = $400,000 − $310,000
  6. Result: GOS = $90,000 gain on sale

Of this $90,000 gain, $60,000 would be subject to depreciation recapture (taxed at up to 25%) and the remaining $30,000 taxed at capital gains rates.

When to Use Each Variable

  • Solve for Gain on Salewhen you know the sale price and adjusted basis, e.g., determining profit or loss on a property sale.
  • Solve for Sale Pricewhen you know the desired gain and adjusted basis, e.g., setting a target listing price.
  • Solve for Adjusted Basiswhen you know the sale price and gain, e.g., back-calculating the tax basis from transaction records.

Key Concepts

Gain on sale equals the sale price minus the adjusted basis. The adjusted basis starts with the original purchase price, adds capital improvements, and subtracts accumulated depreciation. For tax purposes, gains are classified as short-term (held one year or less, taxed as ordinary income) or long-term (held over one year, taxed at preferential capital gains rates of 0%, 15%, or 20%).

Applications

  • Real estate investing: determining profit or loss on a property sale for tax reporting
  • Business asset disposal: calculating gain when selling equipment, vehicles, or machinery
  • Tax planning: estimating capital gains liability to decide between selling now or deferring via a 1031 exchange
  • Portfolio management: tracking realized gains across multiple investment properties

Common Mistakes

  • Using the original purchase price instead of the adjusted basis — improvements and depreciation change the basis
  • Ignoring depreciation recapture — the IRS taxes recaptured depreciation at up to 25%, not the lower capital gains rate
  • Confusing gross sale price with net proceeds — closing costs and commissions reduce proceeds but are not part of the gain formula
  • Forgetting to include capital improvements in the adjusted basis — renovations increase the basis and reduce taxable gain

Frequently Asked Questions

How do you calculate the profit from selling a property?

Subtract the adjusted basis from the sale price using GOS = SP − AB. The adjusted basis is your purchase price plus capital improvements minus accumulated depreciation. A positive result is your profit (gain); a negative result is a loss.

Are improvement costs included when calculating gain on sale?

Yes. Capital improvements increase your adjusted basis, which reduces the taxable gain. For example, a $30,000 kitchen renovation added to a $200,000 purchase gives you a $230,000 basis before depreciation. Only improvements that add value or extend the property’s useful life count — routine maintenance does not.

What is depreciation recapture on real estate?

When you sell a depreciated asset for more than its adjusted basis, the IRS “recaptures” the depreciation you claimed. This portion is taxed at up to 25%, not the lower long-term capital gains rate. Recapture applies to the lesser of the total depreciation taken or the gain realized.

Can you avoid capital gains tax on real estate?

A 1031 exchange lets you defer capital gains by reinvesting proceeds into a like-kind property within 180 days. The primary residence exclusion allows up to $250,000 ($500,000 for married couples filing jointly) in tax-free gains if you lived in the home for at least two of the last five years.

What is the difference between short-term and long-term capital gains?

Short-term capital gains apply to assets held one year or less and are taxed as ordinary income at your marginal rate. Long-term capital gains apply to assets held longer than one year and are taxed at preferential rates of 0%, 15%, or 20% depending on your taxable income bracket.

How does adjusted basis differ from original cost?

Original cost is simply what you paid. Adjusted basis starts with the original cost, adds capital improvements (new roof, additions, major systems), and subtracts accumulated depreciation. Closing costs paid at purchase (title insurance, recording fees) can also be added to the basis.

Do closing costs reduce gain on sale?

Selling expenses such as agent commissions, transfer taxes, and title fees reduce your net proceeds but are technically not part of the GOS = SP − AB formula. However, the IRS allows you to subtract selling expenses from the sale price when computing the taxable gain on your return, which effectively reduces the gain.

Reference: IRS Publication 544 — Sales and Other Dispositions of Assets. Internal Revenue Service.

Gain on Sale Formula

Gain on sale measures the profit or loss from disposing of an asset:

GOS = SP − AB

Where:

  • GOS — gain on sale, measured in dollars ($)
  • SP — sale price, the gross amount received from the buyer ($)
  • AB — adjusted basis, calculated as original cost + improvements − depreciation ($)

A positive GOS is a taxable gain; a negative GOS is a deductible loss (subject to IRS limitations). The formula applies to real estate, business equipment, vehicles, stocks, and any capital asset.

Worked Examples

House Flipping

What is the rehab profit on a house flip?

An investor buys a distressed property for $180,000, invests $45,000 in renovations, and sells the finished home for $290,000. What is the gain before closing costs?

  • Adjusted basis: $180,000 + $45,000 = $225,000
  • GOS = $290,000 − $225,000
  • GOS = $65,000 gain

Real-world profit is lower after agent commissions (~5-6%), transfer taxes, and holding costs (insurance, property tax, utilities during rehab).

Commercial Sale

What is the gain on selling an office building?

A company purchased an office building for $1,200,000. Over 10 years, they claimed $350,000 in depreciation and made $80,000 in capital improvements (new HVAC, roof). They sell for $1,400,000. What is the gain?

  • Adjusted basis: $1,200,000 + $80,000 − $350,000 = $930,000
  • GOS = $1,400,000 − $930,000
  • GOS = $470,000 gain

Of this gain, $350,000 is subject to depreciation recapture at up to 25%. The remaining $120,000 is taxed at long-term capital gains rates. Many commercial sellers use a 1031 exchange to defer the tax.

Land Development

How much appreciation has raw land gained?

A developer purchased 5 acres of raw land for $150,000. After holding it for 8 years with no improvements or depreciation, local development drives a sale at $310,000. What is the gain?

  • Adjusted basis: $150,000 (no improvements, no depreciation on raw land)
  • GOS = $310,000 − $150,000
  • GOS = $160,000 gain

Raw land cannot be depreciated, so the adjusted basis equals the purchase price plus any improvement costs (grading, utilities). The entire $160,000 gain is taxed at long-term capital gains rates.

Related Calculators

Related Sites

Reference: IRS Publication 544 — Sales and Other Dispositions of Assets. Internal Revenue Service.