Short answer
- Capital gains tax on real estate is the federal tax that can apply to the profit from selling property. The IRS treats almost everything you own and use for personal or investment purposes as a capital asset, including a home. When you sell a capital asset for more than its adjusted basis, the difference is a capital gain. When you sell for less, the difference is a capital loss. Three facts decide most real estate cases. First, how long you held the property decides whether the gain is short term or long term. Second, the rate that applies to a long term gain depends on your taxable income and filing status. Third, a main home sale may qualify for an exclusion of up to 250,000 dollars of gain, or up to 500,000 dollars on a joint return, if the ownership and use tests are met. This article explains each step in general terms only. It is not personal tax advice, and the figures are stated for the tax year shown, because thresholds change from year to year.
Introduction
A house sale is often the largest single transaction a person ever makes, and that is why the tax result surprises so many sellers. The profit looks obvious: the sale price minus the purchase price. The tax law, however, starts with the amount realized, subtracts the adjusted basis, and then applies further rules about holding period, exclusions, depreciation, and reporting. A seller who skips any step can overstate the gain, miss an exclusion, or report the sale on the wrong form.
This article follows the IRS order of operations: what counts as a capital asset, how to figure the gain, short term and long term treatment, rates, and the main home exclusion. It then covers rental, business, inherited, and gifted property, sales paid over time, reporting, records, and common mistakes. The scope throughout is United States federal tax only.
1. What Counts as a Capital Asset
The IRS states the rule broadly: almost everything you own and use for personal or investment purposes is a capital asset. Its examples include a home, household furnishings, and stocks or bonds held as investments. A main home, a second home, a rental house, vacant land held for investment, and a commercial building can all be capital assets, although different rules then apply to each type.
The main exception is property held for sale to customers in the ordinary course of a trade or business, such as homes built and sold by a developer. That property is generally not a capital asset. A person who flips houses regularly should not assume capital gain treatment applies automatically. Also note that a gain is not cash in hand: tax is figured on the gain as defined by the law, not on the cash left after the mortgage is paid off.
2. How the Gain Is Figured
The IRS formula is short. Gain equals the amount realized minus the adjusted basis. Loss is the same calculation in reverse.
The amount realized is generally what you receive for the property, including cash and any debt on the property that the buyer takes over, minus selling expenses such as commissions and certain closing costs. A sale price alone is not the amount realized, because selling costs reduce it.
The adjusted basis generally starts with cost: what you paid for the property, plus certain purchase costs such as recording fees and transfer taxes that were part of acquiring it. It is then adjusted upward for capital improvements and downward for depreciation claimed or allowable and insurance recoveries. Publication 523 and Publication 551 carry the full lists and worksheets.
The improvement versus repair distinction is where many sellers lose money. An improvement adds value, prolongs the life of the property, or adapts it to a new use, such as adding a room, replacing a roof, or finishing a basement. A repair merely keeps the property in its current operating condition, such as fixing a leaking tap or repainting a room. Repairs generally do not increase basis.
A worked example shows the arithmetic. Suppose a seller bought a house for 300,000 dollars, spent 40,000 dollars on a qualifying addition, paid 20,000 dollars in selling costs, and sold for 450,000 dollars. The amount realized is 430,000 dollars. The adjusted basis is 340,000 dollars. The gain is 90,000 dollars. If the seller had no records for the addition, the basis would be 300,000 dollars and the apparent gain would be 130,000 dollars.
Inherited and gifted property start from different bases; see Section 7. For a purchased property, keep both settlement statements and dated receipts for every improvement. Basis is proved with paper, not memory.
3. Short Term or Long Term
The holding period decides whether a gain is short term or long term, and that decision changes the rate. The IRS rule is that if you hold an asset for more than one year before you dispose of it, the gain or loss is long term. If you hold it for one year or less, it is short term. The holding period is generally counted from the day after you acquired the asset up to and including the day you disposed of it.
The consequence is large. Net short term capital gains are taxed as ordinary income at graduated rates, while net long term capital gains may be taxed at lower preferential rates. A sale that closes a few days either side of the one year line can therefore produce a very different tax result, even when the price is identical.
Netting also matters. Capital gains and losses for the year are combined under the IRS netting rules, subject to the loss limit in Section 9.
4. The Rates That Can Apply
For taxable years beginning in 2025, the IRS states that the tax rate on most net capital gain is no higher than 15 percent for most individuals, with a 0 percent rate at lower taxable incomes and a 20 percent rate at higher taxable incomes. The thresholds below are the 2025 figures from IRS Topic No. 409. They are taxable income thresholds, not gain thresholds, and they are adjusted from year to year. Check the figures for the year of sale before relying on them.
| Filing status | 0 percent rate if taxable income is | 15 percent rate if taxable income is | 20 percent rate above |
|---|---|---|---|
| Single | 48,350 dollars or less | More than 48,350 dollars to 533,400 dollars | 533,400 dollars |
| Married filing separately | 48,350 dollars or less | More than 48,350 dollars to 300,000 dollars | 300,000 dollars |
| Married filing jointly and qualifying surviving spouse | 96,700 dollars or less | More than 96,700 dollars to 600,050 dollars | 600,050 dollars |
| Head of household | 64,750 dollars or less | More than 64,750 dollars to 566,700 dollars | 566,700 dollars |
Two points in that table are often misunderstood. First, the rate depends on total taxable income, not on the gain alone. Wages and other income use up the lower bands first, so a large gain can straddle two rates. Second, a 0 percent rate does not mean the gain is ignored. The gain is still part of taxable income, and it still counts toward thresholds for other taxes, including the additional tax in Section 9.
There are also special maximum rates outside that framework: 28 percent for certain qualified small business stock and collectibles, and, for real estate, a maximum 25 percent rate on the unrecaptured section 1250 gain portion explained in Section 6.
5. The Main Home Exclusion
The most valuable rule for most sellers is the exclusion for the sale of a main home, often called the section 121 exclusion. The IRS states it plainly: if you have a capital gain from the sale of your main home, you may qualify to exclude up to 250,000 dollars of that gain from your income, or up to 500,000 dollars if you file a joint return with your spouse. Publication 523 provides the full rules and worksheets.
Qualification rests on two tests, both measured over the five year period ending on the date of sale. The ownership test is met if you owned the home for at least 24 months, that is two years, out of the last five years. The use test is met if you used the home as your main home for at least 24 months out of the previous five years. The two periods do not have to be the same two years, but both tests must be met within the five year window ending on the sale date. On a joint return, either spouse may meet the ownership test, but both spouses must meet the use test individually.
There is also a frequency limit. In general, you are not eligible if you excluded the gain from another home in the two years before the sale. Publication 523 covers exceptions, including cases involving an employment change, health reasons, or unforeseen circumstances, and a partial exclusion that may apply when the full tests are not met. Those exceptions are fact specific, so check the publication rather than assuming one applies.
Take the seller in Section 2, with a 90,000 dollar gain on a main home, filing singly, who meets both tests and has not used the exclusion in the last two years. The full 90,000 dollars falls within the 250,000 dollar limit, so no capital gains tax is due on that sale. With a 400,000 dollar gain, the same seller would exclude 250,000 dollars and have 150,000 dollars left to be taxed.
Special rules also apply if you are on qualified official extended duty in the Uniformed Services, the Foreign Service, or the intelligence community: you may elect to suspend the five year test period for up to 10 years, subject to the conditions in Topic No. 701. If the home was ever used for business or rental purposes, the depreciation and nonqualified use rules in Section 6 can reduce the excludable amount. If you receive a Form 1099-S, you must report the sale even if the gain is fully excludable, and if you cannot exclude all of the gain, you must also report it, as described in Section 10.
6. Rental, Second, and Business Property
Property that is not a main home does not qualify for the section 121 exclusion. A second home that was never a main home, a rental property, and a commercial building are all taxed on their full gain, subject to the normal rules, unless another provision applies. A property that was once a rental and later became a main home sits in between: the exclusion may apply to part of the gain, but nonqualified use periods and depreciation can reduce it, so work through the Publication 523 worksheets rather than assuming the full exclusion.
Depreciation is the central complication for rental and business property. Depreciation deductions taken during ownership reduce adjusted basis, which increases the gain on sale, and even depreciation that was allowable but not claimed must still reduce basis. The portion of the gain that corresponds to depreciation taken on real property is generally treated as unrecaptured section 1250 gain, taxed at a maximum rate of 25 percent, rather than at the standard long term rates.
An example shows the split. Suppose a rental property was bought for 400,000 dollars, depreciation of 60,000 dollars was taken, selling costs are already reflected in a net amount realized of 500,000 dollars, and the adjusted basis is therefore 340,000 dollars. The total gain is 160,000 dollars. Of that gain, 60,000 dollars is the unrecaptured section 1250 portion, taxed at a maximum of 25 percent, and the remaining 100,000 dollars is taxed at the applicable long term rate.
Losses also differ by property type. A loss on personal use property, including a main home or a second home used only personally, is generally not deductible. A loss on investment or business property may be deductible, subject to netting and the loss limit rules.
7. Inherited and Gifted Property
How you acquired the property changes the starting basis, and therefore changes the gain. For inherited property, the basis is generally the fair market value of the property at the date of the prior owner’s death, subject to special rules for certain situations. That reset is often called a step up in basis, because it wipes out appreciation that built up during the prior owner’s lifetime. A beneficiary who sells soon after inheriting for a price close to that value may therefore have little or no gain.
Gifted property works the opposite way. The recipient generally takes the donor’s adjusted basis, a carryover basis, so appreciation that built up during the donor’s ownership is not wiped out. The IRS guidance on the basis of gifted property states that three figures matter: the donor’s adjusted basis just before the gift, the fair market value at the time of the gift, and any gift tax paid on the gift. If the fair market value at the time of the gift was less than the donor’s adjusted basis, the basis used depends on whether the later sale produces a gain or a loss, and a sale price between the two figures can produce neither a gain nor a loss.
The holding period for inherited and gifted property also has special rules, addressed in Publication 544. The practical point is narrower: do not assume that a remembered purchase price is the basis. For inherited property, get a defensible valuation at the date of death. For gifted property, get the donor’s records.
8. Deferral Routes: Exchanges and Installment Sales
Two provisions let some sellers defer gain rather than pay tax in the year of sale. Neither one erases the gain, and neither one is available to every seller.
The first is the like kind exchange under section 1031. The rule applies only to real property held for productive use in a trade or business or for investment, exchanged solely for real property of like kind to be held for the same purposes. A main home does not qualify, because it is held for personal use. Within investment real estate, like kind is interpreted broadly: different types of investment real estate can qualify as like kind to each other, even if they differ in grade or quality. If the seller receives cash or other nonqualifying property in the exchange, that part, known as boot, is generally taxable. The deferred gain is carried into the replacement property through its basis, so the tax is postponed, not forgiven.
The second is the installment sale. If you sell property under a contract that provides for all or part of the selling price to be paid in a later year, you have made an installment sale, and the gain is generally reported under the installment method unless you elect out. The IRS confirms in Topic No. 701 that even when the installment method defers some gain, the main home exclusion remains available. Installment reporting spreads the gain across the years in which payments are received, which can change the rate in each year, but it carries risks, including buyer default and the fact that depreciation recapture is generally recognized in the year of sale. Check Publication 537 before signing a contract, because the structure of the deal decides whether deferral is available at all.
9. Extra Taxes, Loss Limits, and Estimated Tax
The headline rate is not always the whole federal bill. A seller with a large gain should check three additional items before spending the proceeds.
The first is the net investment income tax. The IRS states that individuals with net investment income may be subject to a 3.8 percent tax on the lesser of their net investment income or the amount by which their modified adjusted gross income exceeds a threshold for their filing status. Thresholds are 200,000 dollars for single and head of household filers, 250,000 dollars for married filing jointly and qualifying widow or widower with a child, and 125,000 dollars for married filing separately. Excluded main home gain is not part of net investment income. Gain that is not excluded, including gain on rental or second property, can be. The tax is reported on Form 8960.
The second is the limit on deductible capital losses. If capital losses exceed capital gains, the excess loss that can be claimed to reduce other income is the lesser of 3,000 dollars, or 1,500 dollars if married filing separately, or the total net loss shown on Schedule D. Any remaining net capital loss is carried forward to later years.
The third is estimated tax. A seller with a taxable capital gain may be required to make estimated tax payments, because capital gains are generally not subject to withholding in the way wages are. Publication 505, Tax Withholding and Estimated Tax, explains the safe harbor rules and the payment schedule. Estimate the tax when the sale closes, not months later when the return is prepared.
10. How a Sale Is Reported
Reporting follows the type of sale. Most sales and other capital transactions are reported on Form 8949, Sales and Other Dispositions of Capital Assets, and then summarized on Schedule D, Capital Gains and Losses. Business property sales, including the depreciation recapture portion, may also involve Form 4797. Follow the IRS instructions for each form rather than guessing from the form titles.
For a main home sale, if you receive a Form 1099-S, you must report the sale even if the gain is excludable. If you cannot exclude all of your gain, you must also report the sale. If neither condition applies, no reporting of the sale is required. Closing agents commonly issue Form 1099-S, so many sellers will have to report a fully excludable sale anyway. Reporting it is not the same as paying tax on it.
Keep the return copy and the supporting records together. The IRS can examine a sale years after it closes, and basis, improvement, and depreciation figures are only as good as the documents behind them.
11. Records to Keep From Purchase to Sale
Every dollar of basis that can be proved is a dollar that is not taxed as gain. Keep the purchase and sale settlement statements, the deed, dated contracts and receipts for every capital improvement, records of any casualty loss or insurance recovery that affected basis, depreciation schedules and tax returns for any rental or business period, a dated log of how the property was used, any Form 1099-S, and any installment agreement. For inherited property, keep a valuation at the date of death. For gifted property, keep the donor’s basis records and the fair market value at the time of the gift. Store the file where it will survive a move and the years between purchase and sale.
12. Mistakes That Most Often Cost Sellers Money
The errors below are avoidable with a short check before closing.
First, using the sale price as the gain. Selling costs reduce the amount realized, and basis is rarely the same as the purchase price.
Second, forgetting improvements. A new roof, an addition, or a new heating system increases basis, but only if it is documented. Repairs do not.
Third, assuming the main home exclusion applies to any home. It applies to a main home that meets the ownership and use tests, within the frequency limit. A second home, a rental, and a recently converted property all need separate analysis.
Fourth, ignoring depreciation on rental property. Depreciation reduces basis whether or not it was claimed, and the unrecaptured section 1250 portion is taxed at up to 25 percent.
Fifth, missing estimated tax. A large gain with no withholding can produce a penalty even when the return itself is correct. Estimate the tax at closing.
Sixth, assuming state tax follows federal tax. Many states tax capital gains, some at ordinary rates, and some have their own exclusions or none at all. Check the rules of the state where the property sits and the state where the seller files.
Frequently Asked Questions
Do I pay capital gains tax every time I sell a house?
Not necessarily. Tax applies to the gain, not to the sale itself. If there is no gain, there is no capital gains tax, although reporting may still be required if a Form 1099-S was issued. If the property is a main home and the tests are met, up to 250,000 dollars of gain, or 500,000 dollars on a joint return, may be excluded.
How long do I have to own a home before the gain is long term?
More than one year. A gain on property held for more than one year is long term, and a gain on property held for one year or less is short term. The holding period is generally counted from the day after acquisition up to and including the day of disposal. For a main home, the two year ownership and use tests are separate from the one year holding period test, and both must be checked.
What is the capital gains tax rate on real estate?
There is no single rate. For long term gains in 2025, the standard federal rates are 0 percent, 15 percent, or 20 percent, depending on taxable income and filing status, with a maximum 25 percent rate on the unrecaptured section 1250 portion of a gain on depreciated real property. Short term gains are taxed as ordinary income. The additional 3.8 percent net investment income tax may also apply above the thresholds in Section 9.
Does the main home exclusion apply to a second home?
No, not as a second home. The exclusion applies to a main home. A second home that was never a main home does not qualify. A property that was a main home for part of its ownership and a rental or second home for another part needs the allocation rules in Publication 523.
Can I avoid capital gains tax by buying another house?
Buying another house does not by itself avoid tax on the sale of the first one. The old rollover rule that deferred gain when a seller bought a replacement home was replaced by the current exclusion system. The modern deferral route for investment property is a like kind exchange under section 1031, which applies to business or investment real property, not to a main home.
Is a loss on selling my home deductible?
Generally no, if the home was personal use property. The IRS states that losses from the sale of personal use property, such as a home or car, are not deductible. A loss on investment or business property may be deductible, subject to netting and to the annual loss limit in Section 9, with the remainder carried forward.
Do I have to report a home sale if I owe no tax on it?
It depends. If you received a Form 1099-S, you must report the sale even if the gain is fully excludable. If you cannot exclude all of the gain, you must also report the sale. If neither condition applies, no reporting is required.
What records matter most when I sell?
The purchase and sale settlement statements, dated records of capital improvements, depreciation schedules for any rental or business use, and a log of how the property was used over time. For inherited property, a valuation at the date of death matters most. For gifted property, the donor’s basis records and the fair market value at the time of the gift matter most. Without those documents, basis is difficult to prove, and the gain is easily overstated.
Sources & references
- Internal Revenue Service, Topic No. 409, Capital Gains and Losses: states that almost everything owned and used for personal or investment purposes is a capital asset, including a home; defines gain as the amount realized minus adjusted basis; states the one year holding period rule; gives the 2025 rate thresholds for 0 percent, 15 percent, and 20 percent; lists the 28 percent and 25 percent special maximum rates; states the 3,000 dollar loss limit; and states that sales are reported on Form 8949 and Schedule D. Opened and read 26 October 2026. https://www.irs.gov/taxtopics/tc409
- Internal Revenue Service, Topic No. 701, Sale of Your Home: states the 250,000 dollar and 500,000 dollar exclusion, the 24 month ownership and use tests over the five year period ending on the sale date, the joint return rules, the two year frequency limit, the reporting rule for Form 1099-S, the suspension of the five year period for qualified official extended duty, and the installment sale rule that the exclusion remains available. Opened and read 26 October 2026. https://www.irs.gov/taxtopics/tc701
- Internal Revenue Service, Publication 523, Selling Your Home: the full rules and worksheets for the main home exclusion, adjusted basis, and reporting, as cited by Topic No. 701 and Topic No. 409. Cited as the IRS reference for the detailed rules summarized in general terms in this article. Publication page referenced 26 October 2026.
- Internal Revenue Service, Publication 551, Basis of Assets, and Topic No. 703, Basis of Assets: the IRS referral for basis where property was received as a gift or inheritance. The IRS frequently asked questions on property basis state the three figures needed for gifted property: the donor's adjusted basis, the fair market value at the time of the gift, and any gift tax paid. Opened and read via IRS frequently asked questions 26 October 2026. https://www.irs.gov/faqs/capital-gains-losses-and-sale-of-home/property-basis-sale-of-home-etc
- Internal Revenue Service, Net Investment Income Tax guidance and Topic No. 559: states the 3.8 percent tax on the lesser of net investment income or modified adjusted gross income above the filing status threshold, with thresholds of 200,000 dollars for single and head of household filers, 250,000 dollars for married filing jointly and qualifying widow or widower with a child, and 125,000 dollars for married filing separately, and states that the tax is reported on Form 8960. Read via IRS newsroom guidance 26 October 2026. https://www.IRS.Gov/newsroom/four-things-to-know-about-net-investment-income-tax
- Internal Revenue Service, guidance on property basis and sale of home: states that depreciation allowable must still reduce basis even if not claimed, that the gain attributable to depreciation may be subject to the 25 percent unrecaptured section 1250 gain rate, and that taxable gain may be subject to the 3.8 percent net investment income tax. Opened and read via IRS frequently asked questions 26 October 2026. https://www.irs.gov/faqs/capital-gains-losses-and-sale-of-home/property-basis-sale-of-home-etc/property-basis-sale-of-home-etc-5