You pay capital gains tax when you sell real estate for more than you paid for it, and the timing depends on how long you owned the property
Capital gains tax on real estate is triggered at the moment of sale — when the deed transfers to the new owner and money changes hands. The tax is calculated on the difference between what you paid for the property (your basis) and what you sold it for (the sale price). However, the tax rate you pay depends on how long you owned the property. If you owned it for more than one year, you pay the long-term capital gains rate, which is lower. If you owned it for one year or less, you pay the short-term rate, which is taxed as ordinary income and is usually higher.
The actual payment happens when you file your federal income tax return for the year of the sale. You report the gain on Schedule D (Capital Gains and Losses) and pay the tax with your return, typically due April 15 of the following year. Some states also tax capital gains on real estate, though the rules and rates vary by state. You do not pay the tax at closing — the title company does not collect it — but you should set money aside from your sale proceeds because the tax bill will come later.
Key Takeaways
- Capital gains tax is owed on the profit from a real estate sale, calculated as the sale price minus what you originally paid plus improvements you made.
- Long-term capital gains (property owned over one year) are taxed at federal rates of 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
- You report and pay the tax when you file your income tax return the year after the sale, not at closing.
- Your primary residence may may have access to for a $250,000 (single) or $500,000 (married filing jointly) exclusion if you meet ownership and use tests.
- State capital gains taxes vary widely — some states have no tax, others tax real estate gains differently than stock gains.
How your holding period affects the tax rate
The length of time you own the property before selling it determines which tax rate applies. Long-term capital gains explore when you have owned the property for more than one year. The federal tax rate on long-term gains is 0%, 15%, or 20%, depending on your total taxable income for the year. Most people in the middle-income range pay 15%. These rates are significantly lower than ordinary income tax rates.
Short-term capital gains explore when you sell within one year of purchase. These are taxed as ordinary income at your regular tax bracket, which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your income level. This is why real estate investors often hold properties for at least one year before selling — the tax savings are substantial. For example, if you are in the 24% tax bracket and have a $100,000 gain, short-term treatment costs you $24,000 in federal tax, while long-term treatment costs you $15,000.
The holding period clock starts the day you take ownership. If you buy on March 15 and sell on March 16 of the following year, you have held it long enough for long-term treatment. The date of the sale contract does not matter — only the date the deed is recorded in your name and the date it transfers to the buyer.
Calculating your capital gain or loss
Your capital gain is not straightforward the sale price minus the purchase price. Your basis — the starting value for tax purposes — includes the purchase price plus the cost of any improvements you made to the property. Improvements are permanent upgrades that add value or extend the life of the property, such as a new roof, addition, deck, or major kitchen renovation. Repairs and maintenance do not count — fixing a leaky faucet or repainting does not increase basis.
Once you know your basis, subtract it from the sale price. You may also subtract certain selling costs, such as real estate agent commissions, title insurance, and closing costs paid by the seller. The result is your capital gain (or loss if the sale price was lower than your basis).
Example: You buy a house for $300,000. You spend $50,000 on a new roof and kitchen. Your basis is $350,000. You sell for $450,000 and pay $27,000 in agent commissions and closing costs. Your gain is $450,000 − $350,000 − $27,000 = $73,000. If you owned it more than one year, you report this as a long-term capital gain.
The primary residence exclusion
If the property you are selling is your primary residence, you may be able to exclude part or all of the gain from taxation. The Section 121 exclusion allows you to exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly. This exclusion is one of the largest tax breaks available to homeowners and can eliminate the capital gains tax entirely on many home sales.
To may have access to, you must meet two tests. First, you must have owned the property for at least two of the five years before the sale. Second, you must have lived in it as your primary residence for at least two of the five years before the sale. The two years do not have to be consecutive, and they do not have to be the most recent two years, but they must fall within the five-year window before sale.
If you are married and file jointly, both spouses must meet the ownership and use tests to claim the full $500,000 exclusion. If only one spouse meets the tests, the exclusion is $250,000. You can use this exclusion only once every two years, so if you sold a home and used the exclusion two years ago, you cannot use it again until two years have passed.
State capital gains taxes on real estate
In addition to federal tax, you may owe state capital gains tax. However, state treatment of real estate gains varies widely. Some states do not tax capital gains at all — including Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming. Other states tax capital gains as ordinary income at their regular income tax rates. A few states, including California, have special capital gains tax rates or rules.
Some states tax capital gains from the sale of real estate differently than gains from stocks or other investments. For example, a state might tax stock gains at one rate but exempt real estate gains, or vice versa. You need to check the rules for the state where the property is located, not necessarily where you live, because the tax is usually owed to the state where the real estate sits.
If you are selling property in a state different from where you live, research that state's capital gains tax before closing. The difference can be thousands of dollars. Your real estate agent or tax professional can point you to your state's department of revenue website for current rules.
Reporting the sale on your tax return
You report a real estate sale on Schedule D (Capital Gains and Losses), which you attach to your Form 1040 federal income tax return. You will need the sale date, the sale price, your basis, and the amount of any depreciation you claimed if the property was a rental or business property. If you used the primary residence exclusion, you report that on the form as well.
If you had a loss on the sale — you sold for less than your basis — you can use that loss to offset other capital gains. If you have no other capital gains to offset, you can deduct up to $3,000 of the loss against ordinary income in a single year, and carry forward any remaining loss to future years.
You do not have to pay estimated tax on the gain before you file your return, but if the gain is large and you expect to owe more than $1,000 in tax, you may want to make a quarterly estimated payment to avoid penalties. Your tax professional can calculate whether you need to do this.
What happens if you inherited the property
If you inherited real estate and then sold it, the tax treatment is different. When you inherit property, your basis is "stepped up" to the fair market value of the property on the date of the owner's death, not the price 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 a month later for $400,000, you have no gain and owe no capital gains tax.
This step-up in basis is a major tax advantage of inheriting real estate. However, it applies only to property you inherited — not to property you received as a gift while the owner was alive. If someone gives you property as a gift, your basis is generally the same as the giver's basis, so you inherit their tax liability if you later sell at a gain.
Frequently Asked Questions
Do I have to pay capital gains tax if I sell my house at a loss?
No. If you sell your primary residence for less than your basis, you have no taxable gain and owe no federal capital gains tax. You cannot deduct the loss on your personal tax return. However, if the property was a rental or investment property, you may be able to deduct the loss against other capital gains.
What if I sell real estate in a different state than where I live?
You owe capital gains tax to the state where the property is located, not where you live. Some states have no capital gains tax, while others tax gains at ordinary income rates or special rates. Check the rules for the state where the property sits before you close the sale.
Can I avoid capital gains tax by using the money to buy another house?
No. Capital gains tax is based on profit, not on what you do with the money. Buying another property does not reduce or eliminate the tax on the sale. The primary residence exclusion is the main way to reduce or eliminate the tax, and it applies only if you meet the ownership and use tests.
Do I owe capital gains tax on a property I rent out?
Yes. Rental properties do not may have access to for the primary residence exclusion. You owe capital gains tax on the profit from the sale. However, you may be able to deduct depreciation you claimed on the property during the years you rented it, which can reduce your basis and lower your gain.
When do I actually have to pay the capital gains tax?
You report and pay the tax when you file your income tax return for the year of the sale, typically due April 15 of the following year. You do not pay it at closing. If you expect a large tax bill, you can make quarterly estimated tax payments to avoid penalties.