What capital gains tax means and when it applies to real estate
Capital gains tax is a tax on the profit you make when you sell a property for more than you paid for it. The profit itself — not the sale price — is what gets taxed. If you bought a house for $300,000 and sold it for $400,000, your capital gain is $100,000, and that $100,000 is the amount subject to tax.
Capital gains tax applies to investment properties, rental properties, and sometimes your primary home. The rules differ depending on which type of property you own and how long you held it. A primary residence has a major exclusion that investment properties do not: you can exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly, provided you meet specific conditions.
The tax rate depends on how long you owned the property. If you held it for one year or less, the gain is taxed as ordinary income at your regular tax rate. If you held it for more than one year, it qualifies as a long-term capital gain and is taxed at a lower rate — either 0%, 15%, or 20%, depending on your total income for the year.
Key Takeaways
- Your capital gain is the sale price minus your adjusted cost basis, which includes the original purchase price plus improvements and minus depreciation claimed on rental properties.
- Primary residences can exclude up to $250,000 (single) or $500,000 (married) of gain if you owned and lived in the home for at least two of the last five years.
- Long-term capital gains (property held over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
- Rental properties and investment real estate do not may have access to for the primary residence exclusion and may be subject to additional depreciation recapture tax at 25%.
- You report capital gains on Schedule D (Form 1040) when you file your federal tax return in the year you sell the property.
How to calculate your adjusted cost basis
Cost basis is your starting point for calculating gain. It is not simply what you paid for the property. Basis includes the purchase price plus certain costs you paid to acquire the property, such as closing costs, title insurance, and recording fees. For most homebuyers, basis is roughly the purchase price plus these transaction costs.
After you own the property, basis increases when you make capital improvements — permanent upgrades that add value or extend the property's life. A new roof, a room addition, or a foundation repair counts as a capital improvement. Routine maintenance does not: painting, fixing a leak, or replacing a broken window does not increase basis because these are repairs, not improvements.
If you own a rental property, basis decreases by the amount of depreciation you claim on your tax return each year. Depreciation is a deduction that assumes the building loses value over time. If you claimed $5,000 in depreciation over five years, your basis drops by $5,000. When you sell, you will owe depreciation recapture tax on that $5,000 at a rate of 25%, separate from capital gains tax.
To find your adjusted cost basis, start with what you paid, add improvements you made, subtract depreciation you claimed, and you have your adjusted basis. Subtract that from your sale price, and the result is your capital gain.
Calculating gain for primary residences and the exclusion
If you are selling your primary home, you may be able to exclude a portion of your gain from tax. The primary residence exclusion allows you to exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly.
To use this exclusion, you must meet three conditions. First, you must have owned the home for at least two of the last five years before the sale. Second, you must have lived in the home as your primary residence for at least two of the last five years. Third, you cannot have used this exclusion on another home within the last two years.
The calculation is straightforward: subtract your adjusted cost basis from the sale price to find your total gain. If the gain is less than $250,000 (or $500,000 if married), you owe no federal capital gains tax on the sale. If the gain exceeds the exclusion amount, you pay tax only on the excess. For example, if you are single and your gain is $350,000, you exclude $250,000 and pay tax on $100,000.
State and local taxes may still apply even if you use the federal exclusion. Some states do not tax capital gains at all; others tax them as ordinary income. Check your state's rules separately.
Calculating gain for investment and rental properties
Investment properties and rental homes do not may have access to for the primary residence exclusion. You pay capital gains tax on the entire gain, minus only the depreciation recapture tax, which is handled separately.
Start with the same calculation: sale price minus adjusted cost basis equals capital gain. Because you likely claimed depreciation deductions while you owned the rental property, your basis is lower than it would be for a primary home. That lower basis means a higher gain and a higher tax bill.
When you sell a rental property, the IRS requires you to "recapture" the depreciation you claimed. You pay tax on that recaptured depreciation at 25%, which is higher than the long-term capital gains rate. If you claimed $50,000 in depreciation over ten years and your total gain is $150,000, you owe 25% tax on the $50,000 depreciation (that is $12,500) and long-term capital gains tax on the remaining $100,000 at 15% or 20%, depending on your income.
The depreciation recapture tax is mandatory for rental properties and applies regardless of how long you held the property. This is one reason rental property sales often result in a larger tax bill than primary home sales.
Understanding short-term versus long-term capital gains rates
The tax rate on your capital gain depends on how long you owned the property. If you held it for one year or less, the entire gain is taxed as short-term capital gain at your ordinary income tax rate. That rate can be as high as 37% for high earners, which is significantly higher than long-term rates.
If you held the property for more than one year, the gain qualifies as a long-term capital gain and is taxed at a preferential rate. The rate is 0%, 15%, or 20% depending on your taxable income for the year. For 2024, the 0% rate applies to single filers with taxable income up to $47,025; the 15% rate applies to income between $47,025 and $518,900; and the 20% rate applies to income over $518,900. These income thresholds change each year.
Because long-term rates are lower, holding a property for just over one year can save you thousands in taxes compared to selling within one year. This is why real estate investors often time sales to cross the one-year ownership threshold.
What documents you need to calculate and report your gain
To calculate your capital gain accurately, gather the following documents before you sell or when you file your tax return.
For the purchase: your original purchase agreement, closing statement (HUD-1 or Closing Disclosure), and any receipts for closing costs you paid, such as title insurance, recording fees, or attorney fees.
For improvements: receipts and invoices for any capital improvements you made, such as a roof replacement, addition, or major renovation. Keep these organized by year and category.
For depreciation (rental properties only): your tax returns for each year you owned the property, showing the depreciation deduction you claimed. Form 4562 (Depreciation and Amortization) will show this.
For the sale: your closing statement from the sale, which shows the sale price and any selling costs (realtor commission, title insurance, transfer taxes) that reduce your proceeds.
You report your capital gain on Schedule D (Form 1040) when you file your federal tax return in the year you sell the property. If you used the primary residence exclusion, you also complete Form 8949 (Sales of Capital Assets) to document the exclusion.
State and local taxes on real estate sales
Federal capital gains tax is only part of the picture. Many states and some cities impose their own taxes on real estate sales or capital gains.
Some states do not tax capital gains at all — Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming have no state capital gains tax. Other states tax capital gains as ordinary income at rates ranging from 3% to 13%. A few states, including California and New York, tax capital gains at the same rate as ordinary income, which can be very high for large gains.
A small number of states have a separate capital gains tax that applies only to investment income, including long-term capital gains. Washington State, for example, taxes long-term capital gains on certain assets at 7%.
Some cities and counties also impose transfer taxes or sales taxes on real estate transactions. These are separate from capital gains tax and are usually paid at closing, but they reduce the net proceeds you receive and can affect your overall tax picture.
Check your state's Department of Revenue website or consult a tax professional to understand what you owe in your state and locality.
Frequently Asked Questions
Can I deduct selling costs like realtor commission from my capital gain?
Yes. Selling costs — realtor commission, title insurance, transfer taxes, and attorney fees — reduce the amount you receive from the sale and therefore reduce your capital gain. These costs are subtracted from the sale price before you calculate your gain. If you sold for $400,000 and paid $24,000 in realtor commission and closing costs, your net proceeds are $376,000, and that is the figure you use to calculate gain.
What if I inherited the property? Does my basis change?
Yes. When you inherit property, your cost basis is "stepped up" to the fair market value of the property on the date of the owner's death, not what the original owner paid. This means if your parent bought a house for $100,000 and it was worth $400,000 when they died, your basis is $400,000. If you sell it shortly after for $400,000, you have no gain and owe no capital gains tax. This is a major tax benefit of inherited property.
Do I owe capital gains tax if I sell at a loss?
No. If you sell for less than your adjusted cost basis, you have a capital loss, not a gain. You do not owe capital gains tax. You can use the loss to offset other capital gains you had that year. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against ordinary income in that year, and carry forward any remaining loss to future years.
What if I rent out my primary home after I move — do I lose the exclusion?
The exclusion is based on when you owned and lived in the home, not what you do with it after you move. If you lived in the home for two of the last five years before the sale, you can use the exclusion even if you rented it out for the last year or two. However, if you claimed depreciation on the property while renting it, you will owe depreciation recapture tax on that amount at 25%.
How do I report capital gains if I sold through a 1031 exchange?
A 1031 exchange allows you to defer capital gains tax by reinvesting the proceeds into another like-kind property. You do not report a gain in the year of the exchange. Instead, your basis in the new property is adjusted to preserve the deferred gain. When you eventually sell the replacement property without doing another 1031 exchange, you report the combined gain from both properties. Consult a tax professional to structure a 1031 exchange correctly.