How Home Sales Affect Your Taxes in Retirement
What happens to your taxes when you sell a home in retirement
When you sell a home, the IRS taxes the profit you made — the difference between what you paid for it and what you sold it for. In retirement, this matters more because you may be on a fixed income and a large capital gain can push you into a higher tax bracket or affect other benefits. The good news: most people who sell a primary home owe nothing, because of the primary residence exclusion. If you're single, you can exclude up to $250,000 of gain from taxes. If you're married filing jointly, you can exclude up to $500,000. You must have owned and lived in the home for at least two of the five years before the sale.
The tax you owe depends on three things: how much profit you made, whether you meet the exclusion requirements, and your income level that year. A tax professional or your accountant can calculate this before you list the home, so you know what to expect.
Key Takeaways
- Most people selling a primary home owe no federal tax on the first $250,000 (single) or $500,000 (married filing jointly) of profit, as long as they owned and lived there for two of the last five years.
- Profit above the exclusion amount is taxed as a capital gain, with rates depending on your total income that year — this can affect Medicare premiums and other retirement benefits.
- You may owe state or local taxes on the sale even if you owe nothing to the federal government, depending on where you live and where you're moving.
- Selling costs like realtor commissions, title insurance, and inspection fees reduce your profit and lower your tax bill.
- A tax professional should review your situation before you sell, because timing, marital status, and other income sources can change what you owe.
How the primary residence exclusion works
The primary residence exclusion is a one-time break the IRS gives you when you sell a home you've lived in. To use it, you must have owned the home and lived there as your main residence for at least two of the five years before the sale. Those two years don't have to be consecutive, and they don't have to be the most recent two years — you just need to meet the two-out-of-five test.
If you're married and filing jointly, you can exclude $500,000 of profit. If you're single, divorced, or widowed, the limit is $250,000. If you're married but filing separately, each spouse gets $250,000. You can use this exclusion only once every two years, so if you sold another home in the past two years and used the exclusion then, you cannot use it again yet.
Example: You bought a home for $300,000 and sold it for $650,000. Your profit is $350,000. If you're married filing jointly and meet the ownership and residence test, you exclude $500,000 — but your profit is only $350,000, so you owe tax on $0. If you're single, you exclude $250,000, leaving $100,000 subject to capital gains tax.
Capital gains tax rates and how your income affects them
If your profit exceeds the exclusion, the excess is taxed as a long-term capital gain (assuming you owned the home more than one year, which is almost always true). Long-term capital gains rates are lower than ordinary income rates: 0%, 15%, or 20%, depending on your total taxable income for the year.
In 2024, for single filers, the 0% rate applies if your taxable income is under $47,025. The 15% rate applies from $47,025 to $518,900. The 20% rate applies above $518,900. For married couples filing jointly, the brackets are roughly double. These numbers change each year, so check with your tax preparer for the current year.
This matters in retirement because a large home sale can push you into a higher bracket. If you're on Social Security, it can also trigger taxation of your benefits or increase your Medicare premiums. The IRS uses a calculation called modified adjusted gross income (MAGI) to determine if your Social Security is taxable and what you pay for Medicare Part B and Part D. A capital gain counts toward MAGI, so selling a home can affect these costs even if you owe no income tax on the sale itself.
State and local taxes on home sales
Federal tax is only part of the picture. Many states tax capital gains on home sales, and some cities do as well. State capital gains tax rates vary widely — some states have no capital gains tax at all, while others tax it as ordinary income. A few states, like California, have a separate capital gains tax on top of income tax.
If you're moving out of state in retirement, you need to know the tax rules in both your old state and your new one. Some states tax you on the sale even after you've moved away, if you sold property you owned while you were a resident. Others don't. A tax professional in your new state can tell you what applies to your situation.
You may also owe transfer tax or recording fees to your county or municipality when you sell. These are usually small — often a percentage of the sale price — but they add up and reduce your net proceeds.
Costs that reduce your taxable profit
Your taxable profit is not the sale price minus the purchase price. It's the sale price minus your adjusted basis — the original purchase price plus the cost of improvements you made, minus depreciation if you ever rented out part of the home.
Improvements are permanent upgrades that add value: a new roof, a kitchen remodel, an addition, new windows, or a deck. Repairs and maintenance don't count — painting, fixing a leak, or replacing a broken window are not improvements. Keep receipts and invoices for any major work you had done.
Selling costs also reduce your profit: realtor commissions (typically 5–6% of the sale price), title insurance, home inspection, appraisal, attorney fees, and transfer taxes. These are subtracted from the sale price before you calculate your gain. If you sold through a discount broker or sold the home yourself, you may have lower selling costs, which means a higher profit and potentially higher taxes.
Timing the sale and coordinating with other income
The year you sell matters, because your capital gains tax rate depends on your total income that year. If you're already receiving a pension, Social Security, or retirement account withdrawals, a home sale in a high-income year could push you into a higher bracket. In a lower-income year, the same sale might be taxed at a lower rate.
Some people in retirement coordinate the timing of other income sources with a home sale. For example, if you're planning to take a large withdrawal from an IRA or sell other investments, you might delay the home sale to a different year to avoid stacking all the income together. A tax professional can model different scenarios and tell you which year makes sense for your situation.
If you're married and one spouse has significantly lower income than the other, filing status matters too. Married filing jointly usually gives you a wider bracket before you hit the higher capital gains rate, but there are situations where filing separately is better. This is worth discussing with a tax preparer before you sell.
What to do before you list the home
Before you put the home on the market, gather your records: the original purchase documents, receipts for any improvements, and a list of selling costs you expect to pay. If you've owned the home a long time and don't have the original purchase price, your county assessor's office or the title company can often find it.
Meet with a tax professional — a CPA or tax attorney — to calculate your expected gain and estimate what you'll owe in federal, state, and local taxes. This takes a few hours and costs $200 to $500, but it prevents surprises and helps you decide whether to sell now or wait. If the tax bill will be large, your tax preparer can also suggest strategies to reduce it, like timing the sale differently or coordinating it with other financial moves.
If you're selling because you're downsizing or moving to a retirement community, remember that the exclusion applies to the home you're selling, not the one you're buying. You don't need to reinvest the proceeds in another home to avoid taxes — the exclusion is automatic if you meet the requirements.
Frequently Asked Questions
Do I have to reinvest the money from the home sale to avoid taxes?
No. The primary residence exclusion is automatic — you don't have to buy another home or reinvest the proceeds. You can use the money for anything: living expenses, travel, medical care, or savings. The exclusion applies based on your ownership and residence in the home you sold, not on what you do with the money afterward.
What if I owned the home with my spouse but we're now divorced?
If you received the home in a divorce settlement and lived there for the required two of five years, you can still use the exclusion as a single filer ($250,000 limit). The time you owned it while married counts toward the two-year requirement. Your ex-spouse has their own $250,000 exclusion for their share if they also meet the ownership and residence test.
Will selling my home affect my Social Security or Medicare?
The capital gain from the sale counts toward your modified adjusted gross income (MAGI), which can affect whether your Social Security is taxable and what you pay for Medicare Part B and Part D premiums. A large gain might push you into a higher income bracket for that year, increasing your costs. A tax professional can calculate this before you sell.
What if I owned the home for less than two years?
You cannot use the primary residence exclusion if you don't meet the two-out-of-five-years test. Any profit is taxed as a capital gain at your ordinary income tax rate (not the lower long-term capital gains rate), which is much higher. If you're in this situation, talk to a tax professional about whether waiting to sell makes sense for your finances.
Do I owe taxes if I'm selling at a loss?
No. If you sell for less than you paid (including improvements), you have no taxable gain and owe no capital gains tax. You also cannot deduct the loss on your federal tax return — losses on personal residences are not deductible. However, you should still report the sale to the IRS on Form 8949 and Schedule D.