What capital gains tax means when you sell a house or property
Capital gains tax is the federal tax you owe on the profit you make when you sell real estate. It is not a tax on the sale price itself — it is a tax only on the difference between what you paid for the property and what you sold it for. If you bought a house for $300,000 and sold it for $400,000, your capital gain is $100,000, and that $100,000 is what gets taxed.
The IRS taxes capital gains at different rates depending on how long you owned the property. If you owned it for more than one year, you pay long-term capital gains tax, which is lower. If you owned it for one year or less, you pay short-term capital gains tax, which is taxed as ordinary income at your regular tax bracket rate. Most homeowners may have access to for a special exclusion that lets them avoid tax on up to $250,000 of gain (or $500,000 if married filing jointly), but only if the home was their primary residence for at least two of the last five years.
Key Takeaways
- Capital gain equals the sale price minus your original purchase price plus the cost of major improvements, minus selling expenses like realtor fees.
- Long-term capital gains (property owned over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
- Homeowners can exclude up to $250,000 of gain ($500,000 if married) if the home was their primary residence for at least two of the last five years.
- You report capital gains on Schedule D (Form 1040) and may owe estimated taxes if the gain is large.
- Inherited property gets a "step-up in basis," which usually means you owe no tax on gains that happened before you inherited it.
The three numbers you need: purchase price, sale price, and adjusted basis
To calculate your capital gain, you start with three pieces of information from your closing documents and tax records.
Purchase price is what you originally paid for the property. This comes from your closing statement from the year you bought it. Include the price of the land and building, but not the cost of a home inspection, appraisal, or loan origination fees — those are separate closing costs.
Sale price is what the buyer paid you. This is the contract price, not including any personal property (like appliances or furniture) that you sold separately. If the buyer assumed your mortgage instead of you paying it off, the sale price still includes the full amount owed on that mortgage.
Adjusted basis is your purchase price plus the cost of major improvements you made to the property. Major improvements are permanent upgrades that add value or extend the life of the property — a new roof, a room addition, a new HVAC system, or a deck. Do not include repairs (fixing a broken window, repainting), maintenance (lawn care, cleaning), or improvements that are purely personal (a swimming pool, in most cases). Keep receipts and invoices for any work you claim. Adjusted basis is not the same as what you owe on your mortgage.
How to find your adjusted basis if you do not have the original purchase documents
If you bought the property many years ago and cannot find your closing statement, you have several options to reconstruct the purchase price.
Check your tax records. If you deducted mortgage interest or property taxes in the year you bought the property, your tax return from that year will show the purchase date. The IRS keeps records of filed returns for seven years; you can order a transcript from the IRS website or by calling 800-829-1040.
Contact the title company or attorney who handled your closing. They keep closing statements on file for many years, sometimes indefinitely. You will need to provide the property address and approximate year of purchase.
Search your county assessor's or recorder's office records online. Most counties now post deed records and transfer documents on their websites. Search by property address or your name. The deed will show the purchase price and date.
If you truly cannot find the original price, the IRS allows you to use the fair market value of the property on January 1, 1951, if you owned it before that date. For property bought after 1951, you must use the actual purchase price.
Calculating your gain: the step-by-step formula
Once you have your three numbers, the calculation is straightforward:
- Start with your adjusted basis (purchase price + improvements).
- Add any selling expenses: realtor commissions, title insurance, attorney fees, transfer taxes, and recording fees. These reduce your gain.
- Subtract this total from your sale price.
- The result is your capital gain.
Example: You bought a house for $250,000. You added a $30,000 deck and a $15,000 roof. Your adjusted basis is $295,000. You sold it for $400,000. Your realtor charged 6% commission ($24,000) and closing costs were $3,000. Your selling expenses total $27,000. Your capital gain is $400,000 − $295,000 − $27,000 = $78,000.
If this was your primary residence for at least two of the last five years, you can exclude $250,000 (or $500,000 if married filing jointly). In this example, your taxable gain would be $0 because $78,000 is less than $250,000.
Long-term versus short-term capital gains tax rates
The tax rate on your gain depends on how long you owned the property. Long-term capital gains explore if you owned the property for more than one year. Short-term capital gains explore if you owned it for one year or less.
Long-term capital gains are taxed at 0%, 15%, or 20%, depending on your total taxable income for the year. These rates are lower than ordinary income tax rates. The IRS publishes the income thresholds for each rate every year; they vary by filing status (single, married filing jointly, head of household). For 2024, the 15% rate applies to most middle-income taxpayers, while the 0% rate applies to lower-income taxpayers and the 20% rate applies to high-income taxpayers.
Short-term capital gains are taxed as ordinary income at your regular tax bracket rate, which can be as high as 37%. This is why the length of time you own the property matters significantly.
You may also owe the Net Investment Income Tax of 3.8% on capital gains if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). This is a separate tax on top of the capital gains tax.
The primary residence exclusion: when you owe nothing
If the property you sold was your primary residence, you may not owe any tax at all. The IRS allows you to exclude up to $250,000 of capital gain if you are single, or $500,000 if you are married filing jointly. This exclusion is available once every two years.
To may have access to, 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 the home for 15 years but lived in it for only the last two years, you still may have access to.
If you sold the home due to a change in employment, health, or unforeseen circumstances, you may be able to claim a partial exclusion even if you did not meet the two-year test. The IRS publishes a list of may have access to reasons. You must file Form 8949 to claim this reduced exclusion.
Reporting your capital gain on your tax return
You report the sale of real estate on Schedule D (Capital Gains and Losses), which is part of Form 1040. You will also need Form 8949 (Sales of Capital Assets) to list the details of the sale: the property address, the date you bought it, the date you sold it, your basis, the sale price, and the gain or loss.
If you have a large capital gain, you may owe estimated taxes. The IRS expects you to pay tax on income as you earn it throughout the year. If you sell property in December and owe a large amount, you may need to make an estimated tax payment by January 15 of the following year to avoid a penalty. Form 1040-ES helps you calculate what you owe.
If you used a realtor, they will provide you with a Form 1099-S showing the sale price. You do not need to attach this to your return, but keep it with your records. The IRS receives a copy.
Special situations: inherited property and investment real estate
If you inherited the property, the rules are different. Inherited property receives a "step-up in basis," which means your basis is the fair market value of the property on the date the previous owner died, not what they originally paid for it. If the property appreciated $200,000 while the previous owner held it, you owe no tax on that $200,000 gain when you sell. You only owe tax on any gain that happens after you inherit it.
If the property is investment real estate (a rental property or property you held for business purposes), the exclusion does not explore. You owe tax on the full capital gain, regardless of how long you owned it. However, you may be able to deduct depreciation you claimed on the property in prior years, which reduces your basis and may increase your gain. You also may owe depreciation recapture tax at 25% on the depreciation you deducted.
Frequently Asked Questions
Do I owe capital gains tax if I sell my home at a loss?
No. If you sell your primary residence for less than your adjusted basis, you have a capital loss. You cannot deduct this loss on your personal tax return. However, if the property was investment real estate, you can deduct capital losses up to $3,000 per year against other income, with any excess carried forward to future years.
What if I owned the home with someone else?
If you owned it as joint tenants or tenants in common, each owner reports their share of the gain on their own tax return. If you were married and owned it as tenants by the entirety or community property, you may be able to claim the full $500,000 exclusion on a joint return. Consult a tax professional about your specific ownership structure.
Can I deduct the cost of selling the home from my gain?
Yes. Realtor commissions, title insurance, attorney fees, transfer taxes, and recording fees all reduce your gain. Keep all closing documents. Do not include these in your itemized deductions — they reduce your basis instead.
What happens if I sell the home less than two years after I buy it?
You do not may have access to for the primary residence exclusion. You owe tax on the full gain at short-term capital gains rates (your ordinary income tax rate). If you sold due to a change in employment, health, or an unforeseen circumstance, you may claim a partial exclusion — consult a tax professional about whether your situation qualifies.
Do state taxes explore to capital gains from real estate sales?
Yes. Most states tax capital gains as ordinary income. Some states have no income tax at all. A few states tax capital gains at a different rate than ordinary income. Check your state's tax website or consult a tax professional for your state's rules.