The basic formula: sale price minus what you paid, minus costs
Capital gain is the difference between what you sold your property for and what you paid for it, minus certain expenses. The IRS taxes that gain at either a short-term rate (if you owned it under a year) or a long-term rate (if you owned it a year or longer). Long-term rates are lower — currently 0%, 15%, or 20% depending on your total income that year — which is why holding property matters.
To find your gain, you need three numbers: the sale price, your original purchase price (called your basis), and the cost of improvements you made while you owned it. Subtract basis and improvements from sale price. That result is your capital gain.
The actual tax you owe depends on your income bracket and filing status, not just the gain itself. A $100,000 gain means different tax amounts for different people.
Key Takeaways
- Capital gain equals sale price minus your original purchase price, minus the cost of permanent improvements you made to the property.
- Long-term capital gains (property owned over one year) are taxed at 0%, 15%, or 20% depending on your total income; short-term gains use your ordinary income tax rate, which is higher.
- Your basis includes the purchase price plus closing costs, property taxes you paid, and the cost of major repairs or renovations that added value.
- You report capital gains on Schedule D (Form 1040) when you file your federal tax return, and most states tax capital gains as income.
- If you lived in the home as your primary residence for at least two of the last five years, you may exclude up to $250,000 (single) or $500,000 (married filing jointly) of the gain from tax.
What counts as your basis and what does not
Your basis is what you paid for the property, plus certain costs tied to buying it. Start with the purchase price. Add closing costs you paid: title insurance, recording fees, attorney fees, and transfer taxes. Add any points you paid to get a mortgage. These are all part of basis because they were costs to acquire the property.
Do not include costs that are just maintenance or repair. Painting, replacing a roof that was already there, fixing a foundation crack, or replacing a broken window do not raise basis. They keep the property in its current condition but do not add value.
Do include the cost of permanent improvements that add value or extend the life of the property: a new roof (not repair), a new HVAC system, an addition, a deck, a pool, new plumbing or electrical systems, or a kitchen renovation. Keep receipts and invoices for any work you claim. The IRS may ask for proof.
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 and can significantly reduce your gain.
How to handle the sale price and selling costs
Your sale price is the amount the buyer pays you, not including any costs you pay to sell. Subtract the costs of selling from the sale price to get your net proceeds. Selling costs include real estate agent commissions (typically 5–6%), title insurance for the buyer, attorney fees, and transfer taxes or recording fees you pay at closing.
These selling costs reduce your gain dollar-for-dollar. If you sold for $400,000 and paid $24,000 in agent commission and closing costs, your net sale price is $376,000. That $24,000 comes off the top before you calculate gain.
Do not confuse selling costs with basis. Basis is what you paid to acquire the property. Selling costs are what you paid to get rid of it. Both reduce your gain, but they are separate line items in the calculation.
The difference between short-term and long-term capital gains
If you owned the property for one year or less before selling, the gain is short-term. Short-term gains are taxed as ordinary income at your regular tax bracket rate, which ranges from 10% to 37% depending on your income and filing status. This is the same rate you pay on wages or salary.
If you owned the property for more than one year, the gain is long-term. Long-term gains have preferential rates: 0%, 15%, or 20%. Which rate applies depends on your total taxable income for the year, not the size of the gain. The IRS publishes income thresholds each year. For 2024, the 15% rate applies to most people; the 0% rate applies to lower-income filers; and the 20% rate applies to high-income filers.
The holding period is measured from the date you acquired the property to the date you sold it. If you bought on June 15, 2022, and sold on June 16, 2023, you own it more than one year and may have access to for long-term rates.
The primary residence exclusion and who qualifies
If the property was your primary residence, you may exclude part or all of your gain from tax. You can exclude up to $250,000 of gain if you are single, or up to $500,000 if you are married filing jointly. This exclusion applies only once every two years.
To may have access to, you must have owned the home and lived in it as your main home for at least two of the last five years before the sale. The two years do not have to be consecutive. If you owned it for five years but lived there for only one year, you do not may have access to. If you owned it for two years and lived there for two years, you do may have access to.
If your gain is less than the exclusion amount, you owe no federal tax on the gain. If your gain is $300,000 and you are single, you exclude $250,000 and owe tax on $50,000. If your gain is $400,000 and you are married filing jointly, you exclude $500,000 and owe no tax (the exclusion is larger than the gain).
This exclusion does not apply if you are not a U.S. citizen or resident alien, or if you used the exclusion on a different property within the last two years.
Reporting the gain on your tax return
You report capital gains on Schedule D (Form 1040), which you file with your federal tax return. List the property, the date you bought it, the date you sold it, your basis, the sale price, and the gain or loss. If you have a long-term gain, it goes in Part II of Schedule D. If you have a short-term gain, it goes in Part I.
The IRS receives a copy of the settlement statement (HUD-1 or Closing Disclosure) from the title company, so they know you sold the property. If you do not report the gain, the IRS will likely send you a notice asking why.
Most states tax capital gains as income, so you will also report the gain on your state tax return. A few states (like Washington and California) have separate capital gains taxes on top of income tax. Check your state's rules.
If you have a capital loss (the sale price was less than your basis), you can use it 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: inherited property, divorce, and rental homes
If you inherited the property, your basis is the fair market value on the date the previous owner died, not what they paid. This step-up in basis can eliminate or greatly reduce your gain. 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 for $410,000, your gain is only $10,000, not $310,000.
If you received the property in a divorce, your basis is usually the fair market value on the date of the divorce decree. Ask your divorce attorney or tax professional for the exact value used.
If the property was a rental or investment property, not your primary residence, the primary residence exclusion does not apply. You owe tax on the full gain at long-term or short-term rates, depending on how long you owned it. You may also owe depreciation recapture tax at 25% on the portion of the gain that came from depreciation deductions you claimed while renting it out.
Frequently Asked Questions
Do I have to report the sale if my gain is small?
Yes. The IRS requires you to report all property sales on Schedule D, regardless of the gain size. Even if you owe no tax because of the primary residence exclusion or because the gain is small, you must file Schedule D and show the calculation. The title company reports the sale to the IRS, so not reporting it will trigger a notice.
What if I sold the property for less than I paid?
You have a capital loss. You can use it to offset capital gains from other sales in the same year. If you have no other gains, you can deduct up to $3,000 of the loss against wages, salary, or other ordinary income. Any loss above $3,000 carries forward to future years and can be used the same way.
Does the primary residence exclusion apply if I rented out part of the house?
It depends on how much of the house you rented. If you rented out a small part (like one room) and lived in the rest as your primary home, the exclusion usually still applies to the whole property. If you rented out a substantial portion or converted it to a rental property before selling, the exclusion may not apply or may apply only to the portion you lived in. Consult a tax professional for your specific situation.
Can I deduct the cost of a real estate agent from my gain?
Yes. Real estate commissions and other selling costs reduce your net sale price, which reduces your gain. If you sold for $400,000 and paid a $24,000 commission, your net proceeds are $376,000. That $24,000 is subtracted before calculating the gain.
What if I owned the property for exactly one year?
The holding period is measured from the acquisition date to the sale date. If you bought on June 15, 2023, and sold on June 15, 2024, you own it exactly one year, which qualifies as long-term. If you sold on June 14, 2024, it is short-term. The IRS counts the day you acquired it as day one.