Capital Gains Tax on a Home Sale Guide
Selling a home is one of the largest financial decisions most people ever make. It is not just about packing boxes, hiring movers, and finding your next place to live. The financial details can reshape your future. Rising home values mean many sellers walk away with significant profits, and that is where the IRS often steps in with capital gains tax.
For homeowners, this can come as a surprise. You may assume the entire profit from your home sale is yours to keep, only to learn that certain rules apply depending on how long you owned the property, how you used it, and whether you qualify for key IRS exclusions. For anyone selling a primary residence, an inherited property, or an investment home, understanding capital gains tax on a home sale is critical. It can determine how much money stays in your pocket and how much goes to taxes.
What Is Capital Gains Tax?

Capital gains tax is the tax paid on the profit you earn from selling an asset, like stocks, bonds, or real estate. When it comes to homes, the IRS looks at the difference between what you sold the property for and your adjusted basis.
Your adjusted basis is:
- The original purchase price.
- Plus the cost of major improvements.
- Minus depreciation or credits claimed over the years (common for rental properties).
Example:
- Purchase price: $180,000
- Improvements: $20,000
- Adjusted basis: $200,000
- Sale price: $350,000
- Gain: $150,000
That $150,000 profit is what the IRS considers for potential taxation.
The IRS Exclusion Rules
To help homeowners, the IRS offers an exclusion that eliminates tax for many people. Under Section 121, you can exclude:
- Up to $250,000 of profit if filing single
- Up to $500,000 if married filing jointly
To qualify:
- You must have owned the home for at least two of the last five years
- You must have used the home as your primary residence for two of the last five years
- You cannot have claimed this exclusion for another property within the past two years
Most homeowners who sell their primary residence fall under this exclusion, which is why many never owe capital gains tax at all. For exact requirements, the IRS provides details under Topic 701.
When Capital Gains Tax Applies

There are situations where the exclusion does not protect you:
- Selling a second home or vacation property
- Selling an investment or rental property
- Gains that exceed $250,000 for single filers or $500,000 for joint filers
- Not meeting the 2 out of 5 year ownership and use test
The IRS also treats gains differently depending on how long you owned the property:
- Short-term capital gains: If owned one year or less, taxed as ordinary income
- Long-term capital gains: If owned more than one year, taxed at 0%, 15%, or 20%, depending on your income bracket
For more about how taxes apply when selling a home, see our full discussion on do you pay taxes when you sell a house.
How Improvements Affect Your Taxable Gain
Home improvements increase your cost basis, which lowers taxable gain. This is why it is worth keeping receipts for upgrades that add value. Improvements include:
- Kitchen or bathroom remodels
- Room additions or finishing a basement
- Roof replacement
- HVAC or plumbing system upgrades
- New windows or siding
Routine maintenance, like painting or repairing a faucet, usually does not count. But projects that extend the life of your home or boost its value typically do.
State Taxes on Capital Gains

Federal tax rules are not the whole story. Many states, including Pennsylvania, impose their own income tax on capital gains. Even if you qualify for the federal exclusion, your state may require you to report gains. Always review your local tax laws or consult a tax professional to avoid surprises.
Read more here: Investopedia – Capital Gains Tax
Investment Properties and 1031 Exchanges
When selling rental or investment properties, the Section 121 exclusion generally does not apply. Instead, investors often use a 1031 exchange. This IRS provision lets you roll the profit from one property into another of equal or greater value, deferring capital gains tax until the replacement property is sold.
Example: An investor sells a rental with a $200,000 gain. Instead of paying taxes, they purchase another rental property of equal or greater value, using the 1031 exchange to defer the tax hit. This allows wealth to grow without losing momentum to taxes.
Special Cases and Exceptions

Not every home sale fits into neat categories. Here are some exceptions to know:
- Inheritance: Inherited properties receive a stepped-up basis, meaning the home’s value resets to its fair market value at the time of inheritance. Often this results in little to no taxable gain when sold. Read more about what happens if you inherit a home.
- Divorce settlements: When one spouse takes over the home, they also take on the original cost basis.
- Military service: Members of the military can extend the 2 out of 5 year rule under certain conditions.
Real World Scenarios
- Primary residence under the limit: Bought for $150,000, sold for $325,000. Profit of $175,000. A single filer pays no capital gains tax because it is under the $250,000 exclusion.
- High profit sale: A couple bought a house for $200,000 and sold for $800,000. Their $600,000 gain qualifies for the $500,000 exclusion, but they must pay tax on the remaining $100,000.
- Investment property: An investor sells a rental with a $200,000 gain. The full gain is taxable unless they complete a 1031 exchange.
Preparing Before You Sell

The best way to avoid surprises is to plan ahead:
- Track purchase documents and all receipts for improvements
- Wait until you meet the 2 out of 5 year rule before selling
- Consider income timing, selling in a lower income year may lower your tax rate
- Review state and federal rules to understand how they overlap
For homeowners who want to avoid the uncertainty of repairs, and long closings, companies like Buys Houses and We Buy Houses offer fast solutions. Buys Houses often closes as fast as 30 days with a more simplified process, which can be especially useful when dealing with inherited homes or properties that might otherwise trigger taxable gains.
Final Thoughts
Capital gains tax on a home sale does not always apply, but when it does, the impact can be significant. The good news is that most primary residence sales qualify for generous IRS exclusions, while investors have tools like 1031 exchanges to manage liability. By keeping records, planning around residency rules, and understanding both federal and state requirements, you can protect your profit and make selling your home a smoother process.
For homeowners who want a straightforward solution in Pittsburgh, working with experienced Pittsburgh cash home buyers can provide an easier path forward.


