Seller Guide
Capital Gains Tax on Home Sale: What Sellers Owe and How to Keep More of It
Most sellers owe no capital gains tax on a home sale. Learn how the $250K and $500K exclusions work, what counts toward basis, and how to lower your tax bill.
Capital Gains Tax on Home Sale: What Sellers Owe and How to Keep More of It
Most homeowners who sell their primary residence owe nothing in federal capital gains tax. The IRS lets a single filer exclude up to $250,000 of profit and a married couple filing jointly exclude up to $500,000, as long as they meet the ownership and use rules. That one provision covers the large majority of home sales in the country.
The sellers who do get a tax bill tend to fall into a few groups. Some bought decades ago in markets where values have tripled. Others rented the home out for a stretch, sold a second home, or moved before hitting the two-year mark. If any of that sounds like you, the details below will help you estimate what you owe before you sign a listing agreement.
How the Gain on a House Gets Calculated
Your taxable gain is the difference between what you walk away with and what you have invested in the property. The IRS calls those two numbers the amount realized and the adjusted basis. Neither one is the same as the sale price or the original purchase price, and that distinction saves sellers a lot of money.
The amount realized starts with the contract sale price. You then subtract selling costs such as the listing and buyer agent commissions, title charges, transfer taxes you paid, attorney fees, and any seller concessions. On a $600,000 sale, those costs can easily total $35,000 or more.
Adjusted basis starts with what you paid for the home plus most of the closing costs from your purchase. Then you add the cost of capital improvements made over the years. A new roof, a finished basement, an addition, new windows, a replaced HVAC system, or a kitchen remodel all count. Routine repairs and maintenance, like repainting a bedroom or fixing a leaky faucet, do not.
A Quick Worked Example
Say a couple bought a house in 2009 for $280,000 and paid $6,000 in closing costs. Over the years they spent $40,000 on a kitchen remodel and $15,000 on a new roof. Their adjusted basis is about $341,000.
They sell this year for $900,000 and pay $50,000 in commissions and closing costs, so the amount realized is $850,000. Their gain is roughly $509,000. After the $500,000 married exclusion, only about $9,000 is taxable. Without tracking those improvements, the taxable portion would have been $64,000.
Receipts Matter More Than You Think
The IRS can ask you to prove every improvement you add to your basis. Keep invoices, contracts, permits, and canceled checks in one folder for as long as you own the house, plus at least three years after you file the return that reports the sale. A seller who cannot document a $30,000 remodel loses that deduction.
Who Qualifies for the $250,000 or $500,000 Exclusion
The exclusion under Section 121 of the tax code comes down to two tests. You must have owned the home for at least two years, and you must have lived in it as your main home for at least two years. Both periods are measured within the five years ending on the date of sale.
The two years do not need to be continuous, and they do not need to line up with each other. Someone could rent a condo for a year, buy it, live there two more years, and qualify. A seller who lived in the home for 24 months, moved out to rent elsewhere, and then sold within three years of moving out also qualifies. You can use the full exclusion once every two years.
Married couples get the larger $500,000 amount when they file jointly, either spouse meets the ownership test, and both spouses meet the use test. Neither spouse can have claimed the exclusion on another home sale in the prior two years. If only one spouse meets the use test, the couple is generally limited to $250,000.
When You Fall Short of Two Years
Selling early does not always mean losing the exclusion entirely. The IRS allows a partial exclusion if the main reason for the sale was a job change that meets a distance test, a health issue, or certain unforeseen circumstances such as divorce, a death in the family, multiple births from one pregnancy, or a natural disaster that damaged the home.
The partial amount is prorated. A single seller who lived in the home for 12 months before relocating for work could exclude up to half of $250,000, or $125,000. For many short-term owners, that covers the entire gain.
Federal Tax Rates on the Taxable Portion
Gain above the exclusion is taxed at long-term capital gains rates if you owned the home for more than one year. Those rates are 0%, 15%, or 20%, depending on your total taxable income for the year. Most middle-income sellers land in the 15% bracket.
If you owned the home for one year or less, the gain is short-term and taxed at your ordinary income rate. That can run as high as 37% at the federal level. Short holding periods are where house flippers and accidental short-term sellers get the biggest surprise.
Higher earners may also owe the 3.8% Net Investment Income Tax. It applies when modified adjusted gross income tops $200,000 for single filers or $250,000 for married couples filing jointly. The excluded portion of a home sale gain is not subject to this tax. Only the gain above the exclusion counts.
Depreciation Recapture on Rentals and Home Offices
If you ever rented out the property or took depreciation for a home office, that depreciation comes back at sale. The IRS taxes it at a maximum rate of 25%, and the exclusion cannot shelter it. A seller who claimed $30,000 in depreciation over six years of renting should expect a recapture bill on that $30,000 even if the rest of the gain is excluded.
Rental Years Can Shrink Your Exclusion
Turning a former rental into your main home does not reset the clock as cleanly as many people hope. Since 2009, the IRS has applied a rule for "nonqualified use." Any period after 2008 when the home was not your main residence can reduce the share of the gain you can exclude.
Here is how it plays out. Suppose you bought a house, rented it out for three years, then moved in and lived there for two years before selling. Three of your five years of ownership were nonqualified use, so roughly 60% of the gain is not eligible for the exclusion.
The order matters. Time spent renting the home after you moved out does not count as nonqualified use if it falls within the five-year window. A seller who lived in a house first and then rented it out for up to three years before selling can usually still claim the full exclusion, minus depreciation recapture.
Second Homes, Investment Property, and Inherited Houses
Vacation homes and investment properties do not qualify for the Section 121 exclusion unless you convert them and meet the use test. The entire gain on a lake cabin or a beach rental is taxable. For a property bought at $300,000 and sold at $500,000, that can mean a five-figure federal bill.
Investors have another option. A 1031 exchange lets you defer the tax by rolling the proceeds into another investment property of equal or greater value. The rules on timing are firm: you have 45 days to identify a replacement and 180 days to close, and a qualified intermediary has to hold the money. A primary residence does not qualify for a 1031 exchange.
Inherited homes follow different math. Heirs usually receive a stepped-up basis equal to the home's fair market value on the date of death. If a parent bought a house for $90,000 and it was worth $420,000 when they passed, the heir's basis is $420,000. Selling soon after for about that price produces little or no taxable gain, which is why getting a date-of-death appraisal is worth the few hundred dollars it costs.
State Taxes on Your Sale
Federal tax is only part of the picture. Most states with an income tax treat capital gains as regular income, and many of them follow the federal exclusion. California, for example, taxes gains as ordinary income with rates topping out above 13%, so a large gain above the exclusion can cost sellers there far more than the federal bill alone.
A handful of states have no broad income tax, including Florida, Texas, Nevada, Tennessee, South Dakota, and Wyoming. Sellers there typically owe only the federal amount. Washington has no wage income tax but does tax certain long-term capital gains, although sales of real estate are generally exempt.
Reporting the Sale to the IRS
If your entire gain is excluded and you did not receive a Form 1099-S, you generally do not need to report the sale on your return. Title companies often ask sellers to sign a certification that the gain is fully excludable, which lets them skip issuing the form.
When you do receive a 1099-S, or when part of the gain is taxable, you report the sale on Form 8949 and carry the totals to Schedule D. Sellers who expect a large taxable gain should consider an estimated tax payment for the quarter of the sale. That avoids an underpayment penalty when you file the following spring.
Ways to Lower What You Owe
Timing is the simplest tool. Waiting a few extra months to pass the two-year mark, or to move a sale into a year when your income will be lower, can change the bill by thousands of dollars. Retirees who sell in the first year without wages sometimes land in the 0% or 15% bracket on the taxable portion.
Go back through your records and rebuild your basis before you list. Old permits on file with your city or county can help you document improvements you forgot about. Selling costs also add up, so keep your final settlement statement.
If you have investment losses elsewhere, such as stocks sold at a loss this year, those losses can offset the taxable part of your home sale gain. A tax professional can run the numbers on that before closing.
Sellers with large gains often benefit from talking to their agent and a CPA at the same time. An agent who knows recent comparable sales can give you a realistic price, and a CPA can turn that price into a likely tax figure. You can find more seller guides on pricing, timing, and closing costs on our real estate blog for home sellers.
Frequently Asked Questions
Do I have to buy another house to avoid capital gains tax?
No. That rule ended in 1997 when the current exclusion replaced the old rollover system. You can sell, take up to $250,000 or $500,000 of gain tax free, and rent or buy whatever you like next.
Does a home sale gain count toward my income for Medicare premiums?
Only the taxable portion does. If a married couple has $560,000 in gain and excludes $500,000, the remaining $60,000 adds to their modified adjusted gross income, which can push Medicare Part B and D premiums higher two years later.
Can I claim the exclusion if I worked from home and deducted an office?
Yes, as long as the office was inside the house and not a separate building. You will still owe tax on any depreciation you claimed for the office space, at a rate of up to 25%.
What if I sell my home at a loss?
A loss on the sale of a personal residence is not deductible. A seller who bought at $450,000 and sells for $420,000 after costs cannot use that $30,000 against other income, although a loss on a true rental property may be treated differently.
How long do I need to live in the home after a divorce to keep the exclusion?
The departing spouse can count the time the other spouse lives in the home under the divorce or separation agreement. That means a seller who moved out four years ago may still qualify for $250,000 if the former spouse stayed there until the sale.