What capital gains tax is and when you owe it

Capital gains tax is a federal tax on the profit you make when you sell property for more than you paid for it. The profit itself — not the sale price — is what gets taxed. If you bought a house for $200,000 and sold it for $300,000, your capital gain is $100,000, and that $100,000 is what the IRS taxes.

You owe capital gains tax only if you sell at a profit. If you sell for less than you paid, you have a capital loss, and you cannot deduct it from your taxes (with rare exceptions for investment property). The tax rate depends on how long you owned the property and your income level.

Most homeowners do not owe capital gains tax on a primary residence because of the Section 121 exclusion. If you owned and lived in the home for at least two of the last five years before the sale, you can exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly. This exclusion applies once every two years.

Key Takeaways

  • Capital gains tax applies to the profit on a property sale, not the full sale price, and the rate depends on how long you owned it.
  • Most primary homeowners pay zero capital gains tax because the Section 121 exclusion covers up to $250,000 (single) or $500,000 (married) of profit.
  • Investment properties, rental homes, and vacation homes do not may have access to for the Section 121 exclusion and are taxed on the full profit.
  • You calculate gain by subtracting your adjusted cost basis (purchase price plus improvements) from the sale price, then applying the appropriate tax rate.
  • Long-term capital gains (property held over one year) are taxed at 0%, 15%, or 20% depending on income; short-term gains are taxed as ordinary income.

How to calculate your cost basis

Cost basis is the starting point for calculating gain. For most homeowners, it is the purchase price plus the cost of any capital improvements you made. Capital improvements are permanent upgrades that add value or extend the life of the property — a new roof, a deck, a kitchen remodel, or a new HVAC system. Routine repairs and maintenance do not count.

If you inherited the property, your cost basis is usually the fair market value on the date of death, not what the previous owner paid. If you received the property as a gift, your basis is generally the donor's cost basis. Keep receipts and documentation for all improvements; the IRS may ask for proof.

Do not include property taxes, homeowners insurance, mortgage interest, or utilities in your basis. These are deductible expenses in other contexts but not part of basis. Also do not include the cost of selling — realtor commissions, title insurance, and closing costs reduce your net proceeds but are handled separately when you calculate gain.

Calculating the gain and applying the Section 121 exclusion

The formula is straightforward: Sale Price − Selling Costs − Adjusted Cost Basis = Capital Gain. Selling costs include realtor commissions (typically 5–6% of sale price), title insurance, transfer taxes, and attorney fees. Subtract these from the sale price first.

Example: You bought a house for $200,000. You added a $30,000 deck and a $20,000 roof. Your adjusted basis is $250,000. You sold it for $400,000. Realtor commission was $24,000. Your gain is $400,000 − $24,000 − $250,000 = $126,000.

If this is your primary residence and you meet the Section 121 requirements, you exclude $250,000 (or $500,000 if married filing jointly). In the example above, your taxable gain would be $126,000 − $250,000 = $0. You owe no federal capital gains tax.

If your gain exceeds the exclusion, only the excess is taxed. If you are married but filing separately, each spouse can exclude only $250,000, and both must meet the ownership and use test.

Tax rates for long-term versus short-term gains

How long you owned the property determines the tax rate. Long-term capital gains apply if you owned it for more than one year. Short-term capital gains apply if you owned it for one year or less.

Short-term gains are taxed as ordinary income at your regular tax bracket rate, which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your income and filing status. Long-term gains are taxed at preferential rates: 0%, 15%, or 20%, also based on your income and filing status.

For 2024, the 0% long-term rate applies to single filers with taxable income up to $47,025, or married filing jointly up to $94,050. The 15% rate applies to income above those thresholds up to $518,900 (single) or $583,750 (married filing jointly). Income above those levels is taxed at 20%. These income thresholds change each year.

Most home sales may have access to for long-term treatment because owners hold property longer than one year. If you sell within a year, you face ordinary income tax rates, which are significantly higher.

Investment property, rental homes, and vacation homes

The Section 121 exclusion does not apply to investment property, rental homes, or vacation homes. You must pay capital gains tax on the full profit, with no $250,000 or $500,000 deduction.

If you rented out part of your home or claimed a home office deduction, you may have disqualified yourself from the full exclusion. The IRS treats the rental or business portion as investment property. You can exclude gain only on the portion you used as your primary residence.

Depreciation also affects rental property. If you claimed depreciation deductions while renting the property, you must "recapture" that depreciation when you sell. Depreciation recapture is taxed at 25%, separate from the capital gains rate on the remaining profit. This is one reason rental property sales are more complex than primary residence sales.

State and local taxes on capital gains

Federal capital gains tax is only part of the picture. Most states also tax capital gains, and the rates vary widely. Some states tax capital gains as ordinary income at rates up to 13%. A few states have no capital gains tax at all.

California, for example, taxes long-term capital gains at the same rate as ordinary income, with top rates around 13.3%. New York taxes long-term gains at ordinary income rates up to 10.9%. Washington and Texas have no state income tax and therefore no capital gains tax. Check your state's tax authority website for the rate in your state.

Some states also impose local taxes on real estate sales or transfer taxes. These are separate from capital gains tax and apply regardless of whether you have a gain. Your closing statement will itemize these costs.

Reporting the sale to the IRS

You report the sale on Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses), both filed with your federal tax return. Your real estate agent or title company will provide a Form 1099-S if the sale price exceeds $600 (the threshold varies by state and may change). The 1099-S reports the gross sale price to the IRS, but it does not account for your basis or selling costs, so you must calculate the actual gain yourself.

If you have no taxable gain because of the Section 121 exclusion, you still may need to file Form 8949 and Schedule D to report the sale and claim the exclusion. Check the IRS instructions for your specific situation, or consult a tax professional.

Keep all documentation: the purchase deed, receipts for improvements, the closing statement, the sale contract, and the 1099-S. The IRS can audit real estate transactions for up to three years after filing, and longer if there is substantial underreporting of income.

Frequently Asked Questions

Do I have to pay capital gains tax if I sell my primary home?

Not if you meet the Section 121 requirements: you owned and lived in the home for at least two of the last five years, and your gain does not exceed $250,000 (single) or $500,000 (married filing jointly). If your gain is larger than the exclusion, you pay tax only on the excess.

What if I owned the property for less than one year?

Short-term capital gains are taxed as ordinary income at your regular tax bracket rate, which is much higher than the long-term rate. If possible, wait until you have owned the property for more than one year before selling to may have access to for the preferential long-term rate.

Can I deduct the cost of selling the house from my gain?

Yes. Realtor commissions, title insurance, transfer taxes, and attorney fees all reduce the net proceeds and lower your gain. These are subtracted from the sale price before you calculate the profit.

What counts as a capital improvement?

Permanent upgrades that add value or extend the life of the property: a new roof, deck, kitchen remodel, HVAC system, or addition. Repairs and maintenance do not count. Keep receipts to prove the cost if the IRS asks.

Do I owe capital gains tax on inherited property?

Usually no, because inherited property receives a "step-up" in basis to the fair market value on the date of death. If you inherit a house worth $400,000 and sell it shortly after for $400,000, your gain is zero. You owe tax only if you sell for more than the value on the date of death.