What Capital Gains Tax Means When You Sell Property

Capital gains tax is the tax you owe on the profit you make when you sell real estate. The profit is the difference between what you paid for the property and what you sold it for, minus certain costs you can subtract. The federal government taxes this profit at different rates depending on how long you owned the property — shorter ownership periods are taxed at your regular income tax rate, while longer ownership periods get a lower rate.

You do not owe tax on the full sale price, only on the gain. If you bought a house for $300,000 and sold it for $400,000, your gain is $100,000. That $100,000 is what gets taxed, not the $400,000. Some costs you paid to buy, improve, or sell the property can reduce that gain, which lowers your tax bill.

Key Takeaways

  • Your capital gain is the sale price minus your original purchase price, adjusted for improvements and certain costs.
  • Long-term capital gains (property owned more than one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
  • You can subtract the cost of improvements like a new roof or kitchen remodel, but not routine maintenance like painting or repairs.
  • Primary residence sales may exclude up to $250,000 (single) or $500,000 (married filing jointly) of gain from federal tax if you meet ownership and use tests.
  • State and local taxes on real estate sales vary widely and are calculated separately from federal capital gains tax.

Calculate Your Cost Basis and Adjusted Basis

Cost basis is what you originally paid for the property, including the purchase price plus closing costs like title insurance, recording fees, and attorney fees. Do not include the down payment separately — it is part of the purchase price. If you took out a mortgage, the loan amount is not part of your basis; you are only counting what you actually paid out of pocket plus borrowed money.

Adjusted basis is your cost basis plus the cost of capital improvements you made while you owned the property. Capital improvements are permanent upgrades that add value or extend the life of the property: a new roof, a kitchen remodel, an addition, new windows, or a new HVAC system. Routine maintenance and repairs do not count — painting, fixing a leak, replacing a broken window, or patching drywall are not improvements.

Keep receipts and invoices for all improvements. If you cannot document the cost, you cannot subtract it. Add up all improvement costs and add that total to your original cost basis to get your adjusted basis.

Determine Your Amount Realized and Calculate the Gain

Your amount realized is the sale price minus the costs you paid to sell the property. Selling costs include real estate agent commissions (typically 5–6% of the sale price), title insurance for the buyer, recording fees, attorney fees, and any other costs the seller pays at closing. These are the costs that come out of your proceeds at the closing table.

Once you have your adjusted basis and your amount realized, the calculation is straightforward:

Capital Gain = Amount Realized − Adjusted Basis

If the amount realized is less than your adjusted basis, you have a capital loss instead of a gain. Losses on personal residences cannot be deducted, but losses on investment properties can be used to offset other capital gains.

Understand Long-Term vs. Short-Term Capital Gains Rates

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

Short-term capital gains are taxed at your ordinary income tax rate — the same rate as your salary or wages. This can be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your total income and filing status.

Long-term capital gains have their own lower tax brackets: 0%, 15%, or 20%. Which rate you pay depends on your taxable income and filing status. For 2024, a single filer pays 0% on long-term gains up to $47,025 of income, 15% from $47,025 to $518,900, and 20% above that. These income thresholds change each year. Married filing jointly filers have higher thresholds. The key point is that long-term rates are almost always lower than short-term rates, so holding property longer than one year usually saves you money on taxes.

explore the Primary Residence Exclusion If You may have access to

If the property you sold was your primary residence, you may be able to exclude part of your gain from federal tax. Single filers can exclude up to $250,000 of gain; married couples filing jointly can exclude up to $500,000. This exclusion is available 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 five years before the sale. The two years do not have to be consecutive, and they do not have to be the most recent two years. If you meet these tests, you straightforward subtract the exclusion amount from your capital gain before calculating tax.

Example: You are married, bought a house for $300,000, made $50,000 in improvements, and sold it for $600,000. Your adjusted basis is $350,000. Your gain is $250,000. Because you lived there for three of the past five years, you can exclude $500,000 — but your gain is only $250,000, so your taxable gain is zero and you owe no federal capital gains tax.

Account for State and Local Taxes

Federal capital gains tax is only part of the picture. Most states tax capital gains as ordinary income, and some cities add local taxes on top. State rates range from zero (in states like Texas, Florida, and Wyoming) to over 13% (in states like California and New York). A few states tax capital gains at a different rate than ordinary income.

You will need to check your state's rules separately. Some states allow you to deduct federal taxes paid, and some have their own primary residence exclusions. A few states tax real estate gains differently than other capital gains. Because state rules vary widely, the safest approach is to consult your state's tax authority website or a tax professional who knows your state's rules.

Track Improvements and Keep Documentation

The difference between a large tax bill and a smaller one often comes down to documentation. Keep every receipt, invoice, and contract related to improvements you made to the property. Take photos before and after major work. If you hired a contractor, keep the contract showing what work was done.

For the sale itself, keep the closing statement (HUD-1 or Closing Disclosure form), the deed, and any receipts for selling costs like agent commissions and title insurance. If you refinanced the mortgage, that does not change your basis — only actual money spent on improvements counts.

If you owned the property for many years and made improvements over time, go back through old bank statements, credit card statements, and tax returns to find evidence of what you spent. The IRS can ask you to prove your basis, so having documentation is critical.

Frequently Asked Questions

Do I have to pay capital gains tax on the sale of my primary home?

Not necessarily. If you owned and lived in the home for at least two of the past five years, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) of gain from federal tax. Many people owe zero federal tax because their gain falls within the exclusion. You still may owe state or local tax depending on where you live.

What counts as a capital improvement versus routine maintenance?

Improvements add value or extend the life of the property and include new roofs, kitchens, bathrooms, additions, new HVAC systems, and new windows. Maintenance keeps the property in its current condition and includes painting, fixing leaks, replacing broken parts, and repairs. Only improvements reduce your capital gains tax.

How do I know if my gain is long-term or short-term?

Count the days from the date you bought the property to the date you sold it. If it is more than one year (365 days), it is long-term and taxed at the lower 0%, 15%, or 20% rates. If it is one year or less, it is short-term and taxed at your ordinary income tax rate, which is usually higher.

Can I deduct the cost of a new roof or kitchen remodel from my capital gains?

Yes. Add the cost of the roof or remodel to your adjusted basis. This reduces your capital gain and lowers your tax. Keep the invoice or receipt from the contractor as proof. Routine repairs like fixing a leak or patching drywall do not count.

What if I sold the property at a loss?

If you sold a personal residence at a loss, you cannot deduct it. Losses on primary homes are not tax-deductible. If you sold an investment property at a loss, you can use it to offset capital gains from other investments in that year, and carry unused losses forward to future years.