How Capital Gains Tax Works When You Sell Real Estate
Capital gains tax on real estate is the tax you owe on the profit when you sell a property for more than you paid for it
When you sell a house, land, or rental property, the IRS taxes the difference between what you paid (your basis) and what you sold it for (your sale price). That difference is your capital gain. The tax rate depends on how long you owned the property and your income level. Most people pay either 0%, 15%, or 20% on long-term gains — property you held for more than one year. Short-term gains, on property held one year or less, are taxed as ordinary income at your regular tax rate, which can be much higher.
Real estate is treated differently from other investments because you may be able to exclude some or all of the gain from tax if the property was your primary home. This exclusion can save you thousands in taxes, but it has specific rules about how long you lived there and how often you've used it.
Key Takeaways
- Capital gains tax applies to the profit on a real estate sale, calculated as the sale price minus your original purchase price and certain improvements.
- Long-term gains (property held over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed at your ordinary income rate.
- If you sell your primary home, you may exclude up to $250,000 of gain from tax (or $500,000 if married filing jointly) if you meet the ownership and use tests.
- Rental properties and investment real estate do not may have access to for the primary home exclusion and are always subject to capital gains tax.
- Your basis includes the purchase price plus the cost of improvements like a new roof or addition, but not routine maintenance or repairs.
How your basis is calculated and what it includes
Your basis is the starting point for calculating your gain. It is usually the price you paid for the property, plus the cost of any improvements you made. Improvements are permanent upgrades that add value or extend the life of the property — a new roof, an addition, a new HVAC system, or a deck. Routine maintenance and repairs do not count: painting, fixing a leak, or replacing a broken window do not increase your basis.
If you inherited the property, your basis is typically the fair market value on the date of the person's death, not what they paid for it. This is called a step-up in basis and can eliminate or reduce capital gains tax on inherited real estate. If you received the property as a gift, your basis is usually the donor's original basis, which means you inherit their tax liability if the property has appreciated.
Keep records of what you paid for the property and receipts for any improvements. When you sell, you will need to report your basis to calculate your gain accurately.
The difference between long-term and short-term capital gains
How long you owned the property determines which tax rate applies. If you held the property for more than one year before selling, your gain is long-term and taxed at preferential rates: 0%, 15%, or 20% depending on your taxable income and filing status. These rates are lower than ordinary income tax rates, which can reach 37% at the highest bracket.
If you sold within one year of purchase, your gain is short-term and taxed as ordinary income at your regular tax rate. For most people, this is significantly higher than the long-term rate. For example, if you are in the 24% tax bracket and have a short-term gain, you pay 24% tax on that gain. The same gain held for over one year might be taxed at 15%.
The holding period is measured from the date you acquired the property to the date you sold it. The sale date is the date the deed transfers, not the date you signed the contract.
Primary home exclusion: what qualifies and how much you can exclude
If you sell your primary home, you may exclude up to $250,000 of capital gain from tax if you are single, or $500,000 if you are married filing jointly. This exclusion applies only to your main residence — the home where you lived most of the time.
To use this exclusion, you must meet two tests. First, you must have owned the home for at least two of the five years before the sale. Second, you must have lived in the home as your primary residence for at least two of the five years before the sale. These periods do not have to be consecutive, and they do not have to overlap. You can own the home for five years but live in it for only two of those years and still may have access to.
You can use this exclusion only once every two years. If you sold another home and used the exclusion within the past two years, you cannot use it again. If your gain exceeds the exclusion amount, you owe tax on the excess. For example, if you are single and your gain is $400,000, you exclude $250,000 and owe tax on $150,000.
Capital gains tax on rental properties and investment real estate
Rental properties and investment real estate do not may have access to for the primary home exclusion. Any gain on the sale is subject to capital gains tax, and you cannot exclude any portion of it. If you owned the property for more than one year, the gain is taxed at the long-term rate (0%, 15%, or 20%). If you owned it for one year or less, it is taxed as ordinary income.
Rental properties have an additional tax consideration: depreciation recapture. If you deducted depreciation on the property while you rented it out, you must "recapture" that depreciation when you sell. This recaptured amount is taxed at 25%, regardless of how long you owned the property. Depreciation recapture applies only to the building itself, not the land.
For example, if you bought a rental house for $300,000 and deducted $50,000 in depreciation over ten years, your basis is reduced to $250,000. If you sell for $400,000, your gain is $150,000. Of that, $50,000 is recaptured depreciation taxed at 25%, and $100,000 is long-term capital gain taxed at 15% or 20%.
State and local taxes on real estate sales
In addition to federal capital gains tax, many states and some cities tax capital gains on real estate. State tax rates vary widely. Some states have no capital gains tax at all. Others tax capital gains as ordinary income, which can range from 3% to over 13% depending on the state and your income level. A few states have a separate capital gains tax rate.
You will owe state tax based on where the property is located, not where you live. If you sell a rental property in California but live in Texas, you owe California tax on the gain. Check your state's tax rules or consult a tax professional to understand what you owe in your situation.
How to report capital gains on your tax return
You report the sale of real estate on Form 8949, Sales of Capital Assets, and then transfer the totals to Schedule D, Capital Gains and Losses. Schedule D is part of your Form 1040 individual income tax return. You will need to report the date you acquired the property, the date you sold it, your basis, the sale price, and your gain or loss.
If you used the primary home exclusion, you do not report the excluded portion as a gain. You report only the gain that exceeds the exclusion amount. If you have no gain after the exclusion, you do not report the sale on your tax return at all.
If you sold a rental property and have depreciation recapture, that amount is reported separately on Form 4797, Sales of Business Property, which feeds into Schedule D. The process is more complex for investment properties, and many people work with a tax professional to may support accuracy.
Frequently Asked Questions
Do I owe capital gains tax if I sell my home at a loss?
No. Capital losses on personal residences cannot be deducted on your tax return. If you sell your primary home for less than you paid, you straightforward report no gain and owe no tax. You cannot use the loss to offset other income or gains.
What if I lived in the home for only one year instead of two?
You do not may have access to for the primary home exclusion if you do not meet the two-year ownership and use tests. However, the IRS allows exceptions if you sold due to a change in employment, health, or unforeseen circumstances. You may be able to claim a partial exclusion. Consult a tax professional about your specific situation.
Does the cost of selling the home, like realtor fees, reduce my capital gains?
Yes. Selling expenses such as realtor commissions, title insurance, and closing costs reduce your sale price and therefore reduce your capital gain. These are not added to your basis; they are subtracted from the amount you received when calculating the gain.
If I convert my primary home to a rental, do I still get the exclusion?
Only for the years you lived there as your primary home. If you lived in the house for two years and then rented it out for three years before selling, you can exclude gain only on the portion attributable to the two years you lived there. The gain from the rental years is subject to capital gains tax and depreciation recapture.
What is the difference between capital gains tax and property tax?
Property tax is an annual tax on the value of real estate you own, paid to your local government. Capital gains tax is a one-time federal (and sometimes state) tax on the profit when you sell. They are separate taxes and both may explore to you as a homeowner.
This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.