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, rental property, or land, the IRS taxes the difference between what you paid (your basis) and what you sold it for (the sale price). That difference is your capital gain. The tax rate depends on how long you owned the property and your income level. If you owned it for more than one year, you pay the long-term capital gains rate, which is lower than the short-term rate. If you owned it for one year or less, you pay your ordinary income tax rate instead.

The federal long-term capital gains rates are 0%, 15%, or 20%, depending on your total taxable income for the year. States may also tax capital gains — some states have no capital gains tax at all, while others tax it as ordinary income. You may also owe the Net Investment Income Tax of 3.8% if your modified adjusted gross income exceeds certain thresholds.

Key Takeaways

  • Capital gains tax applies to the profit you make when you sell real estate, not the full sale price.
  • Long-term capital gains (property owned over one year) are taxed at 0%, 15%, or 20% federally, depending on your income bracket.
  • Your basis includes the purchase price plus certain improvements like a new roof or addition, but not routine maintenance.
  • The primary residence exclusion lets you exclude up to $250,000 (or $500,000 if married filing jointly) of gain if you meet the ownership and use tests.
  • State taxes on capital gains vary widely — some states do not tax capital gains at all, while others tax them as regular income.

How your basis and sale price determine the taxable gain

Your basis is what you paid for the property, including the purchase price, closing costs, and title insurance. If you inherited the property, your basis is usually the fair market value on the date of death, not what the previous owner paid — this is called a step-up in basis. If you received the property as a gift, your basis is generally what the giver paid.

Once you have your basis, subtract it from the sale price (minus selling costs like real estate commissions and attorney fees). The result is your capital gain. For example, if you bought a house for $300,000, paid $10,000 in closing costs, made $50,000 in capital improvements, and sold it for $500,000 after paying $20,000 in selling costs, your gain is $500,000 minus $360,000 (basis) minus $20,000 (selling costs) = $120,000.

Capital improvements are upgrades that add value or extend the life of the property — a new roof, a deck, a kitchen renovation, or a new HVAC system. Routine maintenance like painting, repairs, or lawn care does not count. Keep receipts and records of all improvements, because you will need them to prove your basis if the IRS questions your return.

The difference between long-term and short-term capital gains rates

If you owned the property for more than one year before selling, your gain is taxed as a long-term capital gain. The federal rates are 0%, 15%, or 20%, depending on your filing status and total taxable income. These rates are much lower than ordinary income tax rates, which can go as high as 37%.

If you owned the property for one year or less, your gain is taxed as a short-term capital gain and is taxed at your ordinary income tax rate. This is a significant penalty for selling quickly. For example, if you are in the 24% tax bracket and sell a rental property after owning it for six months with a $50,000 gain, you owe $12,000 in federal tax. If you had waited six more months, the same gain might be taxed at 15%, costing only $7,500.

The one-year holding period is measured from the date you took ownership, not the date you signed the contract. If you close on December 15 of one year, the one-year mark is December 15 of the next year.

The primary residence exclusion and who can use it

If you sell your main home, you may be able to exclude part or all of your gain from tax. You can exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly. This exclusion is available once every two years.

To use the exclusion, you must have owned the home and 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. If you owned it for three of the five years and lived in it for two of those three, you may have access to. If you are married filing jointly, only one spouse needs to meet the ownership test, but both must meet the use test.

If you do not meet these tests — for example, you owned a rental property or a vacation home — the exclusion does not explore. If you sold your primary residence less than two years ago and used the exclusion, you cannot use it again until two years have passed since that sale.

State taxes on real estate capital gains

Nine states have no income tax at all: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming. New Hampshire and Tennessee tax only dividend and interest income, not capital gains. If you live in one of these states, you owe no state capital gains tax.

Most other states tax capital gains as ordinary income, meaning your capital gain is added to your other income and taxed at your state income tax rate. A few states have separate capital gains tax rates. California taxes long-term capital gains at the same rate as ordinary income. New York has a separate 8.82% capital gains tax on gains over $1 million. Illinois has a flat 4.95% capital gains tax on all capital gains.

If you move to a different state after selling property, the state where you lived when you sold it is the one that taxes the gain, not your new state. This matters if you sell in a high-tax state and then move to a low-tax or no-tax state.

The Net Investment Income Tax and when it applies

In addition to regular capital gains tax, you may owe the Net Investment Income Tax (NIIT), which is a 3.8% federal tax on investment income. This tax applies if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly).

Real estate capital gains count as investment income for this purpose. If you are single, earn $180,000 in wages, and have a $50,000 capital gain on a rental property, your modified adjusted gross income is $230,000. You owe the 3.8% NIIT on $30,000 of the gain (the amount over $200,000), which is $1,140.

The NIIT does not explore to gains on your primary residence if you use the exclusion and have no remaining taxable gain. It also does not explore to gains on property used in a trade or business, though this exception is narrow and does not cover most rental properties.

Reporting capital gains on your tax return

When you sell real estate, you will receive a Form 1099-S from the title company or real estate agent if the sale price is over $600 (this threshold varies by state and year). You report the sale on Schedule D (Capital Gains and Losses) and then transfer the result to your Form 1040. If you used the primary residence exclusion, you still report the full gain on Schedule D but then subtract the exclusion amount.

If you sold a rental property or investment property, you may also need to recapture depreciation. If you deducted depreciation on the property in prior years, you must add back some or all of that depreciation as income. Depreciation recapture is taxed at 25%, which is higher than the long-term capital gains rate.

Keep all closing documents, receipts for improvements, and records of depreciation deductions. The IRS can audit a real estate sale for up to three years after you file, or longer if they suspect underreporting of income. Having good records makes the process much simpler if questions arise.

Frequently Asked Questions

Do I owe capital gains tax if I sell my house at a loss?

No. If you sell your home for less than your basis, you have a capital loss, not a gain. You cannot deduct a loss on the sale of your primary residence. If you sell a rental property or investment property at a loss, you can use that loss to offset other capital gains, and any remaining loss can offset up to $3,000 of ordinary income per year.

What if I inherited real estate and then sold it?

You receive a step-up in basis to the fair market value on the date of death. If the property was worth $400,000 when the person died and you sold it for $420,000 a year later, your gain is only $20,000, not the full $420,000. This step-up applies whether you inherited a primary residence or a rental property.

Can I defer capital gains tax by doing a 1031 exchange?

A 1031 exchange lets you sell one investment property and buy another similar property without paying capital gains tax on the sale, as long as you follow strict timing and identification rules. You must identify the replacement property within 45 days and close within 180 days. This is a complex transaction — work with a tax professional or may have access to intermediary to make sure you comply.

How do I know if I owe the Net Investment Income Tax?

Calculate your modified adjusted gross income (usually your adjusted gross income plus certain deductions). If it exceeds $200,000 (single) or $250,000 (married filing jointly), you may owe 3.8% on your capital gains. Your tax software or tax professional can calculate this for you when you file.

What if I sold real estate in a state where I no longer live?

The state where you lived when you sold the property is the one that taxes the gain. If you sold a house in New York and moved to Florida, New York taxes the gain, not Florida. Some states require you to file a nonresident return in the state where you sold the property.