Capital gains tax on real estate depends on how long you owned it and your income level

When you sell a house, land, or rental property for more than you paid for it, the profit is called a capital gain. The federal government taxes this profit. How much you owe depends on two things: whether you held the property for more than one year (which determines your tax rate), and your total income that year (which determines which tax bracket applies to you).

If you owned the property for one year or less, the profit is taxed as ordinary income at your regular tax rate — potentially 10%, 12%, 22%, 24%, 32%, 35%, or 37%, depending on your income. If you owned it for more than one year, it is taxed at the long-term capital gains rate of 0%, 15%, or 20%, which is almost always lower. Most people who sell a home they lived in do not owe federal capital gains tax at all, because of a specific exclusion.

State and local taxes add to the federal amount. Some states tax capital gains as income; others do not. Your total bill depends on where the property is located and where you live when you sell.

Key Takeaways

  • Long-term capital gains (property held over one year) are taxed at 0%, 15%, or 20% federally, depending on your income; short-term gains are taxed as ordinary income at rates up to 37%.
  • If you lived in a house as your primary home for at least two of the last five years, you can exclude up to $250,000 of profit ($500,000 if married filing jointly) from federal tax.
  • State and local taxes vary widely: some states do not tax capital gains, while others tax them as regular income or charge a separate capital gains tax.
  • You report the sale on IRS Form 8949 and Schedule D when you file your tax return; you do not pay tax at the time of sale.

The primary residence exclusion: when you owe nothing

If you sell a house you lived in, you may owe no federal capital gains tax at all. The Section 121 exclusion lets you exclude up to $250,000 of profit if you are single, or $500,000 if you are married filing jointly. To use it, you must have lived in the house as your main home for at least two of the last five years before the sale.

Example: You bought a house for $300,000, lived in it for six years, and sold it for $450,000. Your profit is $150,000. Because $150,000 is less than $250,000, you owe no federal capital gains tax. If you were married and the profit was $550,000, you would owe tax on only $50,000 of the gain.

This exclusion applies once every two years. If you sold a home and used the exclusion, you cannot use it again until two years have passed. You do not have to live in the house continuously — time spent away for work, school, or medical care usually counts as time living there.

Long-term versus short-term capital gains rates

The tax rate on your profit depends on how long you owned the property. If you held it for more than one year, it is a long-term capital gain. If you held it for one year or less, it is a short-term capital gain.

Short-term gains are taxed as ordinary income. In 2024, ordinary income tax rates range from 10% to 37% depending on your total income and filing status. This is the same rate you pay on wages or salary.

Long-term capital gains are taxed at lower rates: 0%, 15%, or 20%. Which rate you pay depends on your income level, not on how much profit you made. For 2024, the 0% rate applies to single filers with income up to about $47,000; the 15% rate applies to income between roughly $47,000 and $518,000; and the 20% rate applies to income above that. These income thresholds change each year and are higher for married filers.

Because long-term rates are lower, timing matters. If you are close to the one-year mark, waiting to sell can save you money — but only if your income stays in the same bracket.

State and local capital gains taxes

Most states tax capital gains as part of ordinary income, using the same rate they apply to wages. A few states do not tax capital gains at all: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming have no state income tax. New Hampshire and Tennessee tax only investment income, not wages.

Some states have introduced separate capital gains taxes in recent years. Washington State, for example, taxes long-term capital gains on stocks and certain other investments at 7%, though real estate sales have been exempt so far. California taxes capital gains as ordinary income at rates up to 13.3%. New York taxes them at rates up to 10.9%.

Local taxes vary by city and county. Some municipalities charge a transfer tax or sales tax when you sell property, which is separate from capital gains tax. Philadelphia, for example, charges a 3% tax on the sale price of real estate. These local taxes are often paid at closing, not when you file your tax return.

How to calculate your capital gain

Your capital gain is the sale price minus your cost basis. Cost basis is usually what you paid for the property, plus the cost of major improvements like a new roof, addition, or foundation repair. It does not include routine maintenance like painting or landscaping.

Example: You bought a house for $200,000. You spent $50,000 on a kitchen renovation and $15,000 on a new roof. Your cost basis is $265,000. You sell the house for $400,000. Your capital gain is $135,000.

If you inherited the property, your cost basis is usually the property's value on the date of death, not what the previous owner paid. This is called a stepped-up basis and can significantly reduce or eliminate capital gains tax on inherited real estate.

Keep receipts and documentation for all improvements. The IRS may ask for proof if you claim a higher basis. Selling costs like real estate agent commissions and closing costs reduce the sale price, which lowers your gain.

Reporting the sale on your tax return

You report the sale using IRS Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses). Form 8949 lists each property you sold, the date you bought it, the date you sold it, your cost basis, and the sale price. Schedule D summarizes your long-term and short-term gains and losses for the year.

You file these forms with your regular tax return (Form 1040) by April 15 of the year after the sale. You do not pay tax at closing — you pay it when you file your return, or you may owe estimated taxes if the gain is large.

If you sold a primary residence and are using the Section 121 exclusion, you still file Form 8949 and Schedule D, but you report the full gain and then subtract the exclusion on Schedule D. The IRS wants to see the calculation.

If you had a loss — you sold for less than your cost basis — you can use that loss to offset other capital gains. If losses exceed gains, you can deduct up to $3,000 of the loss against ordinary income in that year, and carry forward any remaining loss to future years.

Special situations: rental property, investment property, and inherited homes

The primary residence exclusion does not apply to rental property or investment property. If you own a second home, vacation property, or house you rent out, any profit is fully taxable. You cannot exclude any amount, no matter how long you owned it.

If you converted a rental property to your primary home, or vice versa, the exclusion applies only to the years you actually lived there. You must have lived in it for at least two of the last five years, and the two years do not have to be consecutive.

Inherited real estate receives a stepped-up basis, meaning your cost basis is the property's fair market value on the date the previous owner died. If you inherit a house worth $500,000 and sell it a month later for $500,000, you owe no capital gains tax because your basis is $500,000. This applies whether you inherited a primary residence or investment property.

Frequently Asked Questions

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

No. If you sell for less than you paid, you have a capital loss, not a gain. You cannot deduct a loss on the sale of a primary residence. If it was investment or rental property, you can use the loss to offset other capital gains, or deduct up to $3,000 against ordinary income per year.

What if I sell a house I inherited?

Your cost basis is the property's value on the date of death, not what the previous owner paid. If you sell it shortly after inheriting it for roughly the same value, you owe little or no capital gains tax. This stepped-up basis applies to all inherited real estate, primary residence or not.

Do I have to pay capital gains tax at closing?

No. Capital gains tax is paid when you file your income tax return the following year, not at closing. However, if your gain is large, you may owe estimated taxes during the year. Your real estate agent or closing attorney can tell you whether estimated taxes are required.

Can I use the primary residence exclusion more than once?

You can use it once every two years. If you sold a home and used the exclusion, you must wait two years before using it again on another home sale. The two years are measured from the date of the previous sale.

What counts as an improvement for cost basis?

Major structural or system improvements count: a new roof, foundation repair, addition, new HVAC system, or kitchen renovation. Routine maintenance does not: painting, landscaping, or carpet cleaning. Keep receipts for any work you claim as an improvement.