Editor's note - You can trust the integrity of our balanced, independent financial advice. We may, however, receive compensation from the issuers of some products mentioned in this article. Opinions are the author's alone, and this content has not been provided by, reviewed, approved or endorsed by any advertiser.
Zero Cap Gains.png

It is often said that buying a house is the largest purchase you will make in your life. If you’re not careful, though, that house can also create one of the largest tax bills you will pay in your life.

There are usually a million things going through your head when you buy a house: Can I get financing? Does this house have an H.O.A.? Is this a good neighborhood? What about the schools? And so on.

If you’re like most people, minimizing your potential capital gains tax is not one of those million things… that is, until the time comes to sell your house. Fear not. What an appreciating real estate market giveth, the tax man need not taketh away.

Capital Gains Tax

Generally speaking, taxes on capital gains are triggered when a person sells an appreciated asset. Stocks are a great example this. Capital gains come in two main flavors, short term (property held less than 12 months) and long term (property held longer than 12 months).  For most people, selling their house has the potential to trigger long term capital gains tax.

A person’s long term capital gains tax rate is determined by their marginal tax rate on ordinary income – aka the rate most people think of as “their tax rate.” Currently, 20% is the the top federal income tax rate on long term capital gains*. This rate only applies to those people (un)lucky enough to be in the 39.6% marginal tax bracket.

For most people, (those making between $37,650 – $415,050 as an individual, or $75,300 – $466,950 married filing jointly) the federal long term capital gains rate will be 15%. While 15% may not seem like a lot when you’re leaving your server a tip after a nice meal, 15% of several hundred thousand dollars adds up very quickly.

Capital gains tax, as you might imagine, is a tax on any gain earned from the sale of property. For tax purposes, gain is calculated by subtracting the property’s basis from the sale price (fair market value). Most of the time, a person’s basis in their house is the same as the price they paid when they bought the house. For example, Able purchases a house in 2008 for $150,000. Able’s basis in the house is $150,000. When Able sells the house in 2016 for $210,000, he has a gain of $60,000.

Exclusion for Sale of Primary Residence

In one of its more generous provisions, the tax code provides for a potentially huge tax break when selling your personal home. According to IRS Publication 523 (IRS Pubs are always a good read if you can’t sleep):

The tax code recognizes the importance of homeownership by providing certain tax breaks when you sell your home.

Those tax breaks come in the form of an exclusion of up to $250,000 of gain for an individual, $500,000 for those married filing jointly. However, those exclusions are not automatic. In order to qualify for the full $250,000 or $500,000, your home must pass the eligibility test, which is essentially this:

  • You must have owned the house for at least two years
  • The house must be your primary residence
  • You must have lived in the house for two of the past five years.

This exclusion is very substantial, and for most people, married couples especially, this exclusion alone can completely negate any potential capital gains tax when selling a house that meets the criteria.

In fact, some real estate investors use this exclusion regularly to avoid capital gains tax. People who buy and fix homes to sell (sometimes known as flippers) use this tactic to make essentially “tax free” income.

So long as the investor meets the other criteria for the exclusion, they purchase and occupy a house as their primary residence while fixing it up for sale, live in the house two years, sell the house, claim the exclusion, and repeat.

Keep Track of Home Improvements (and Keep the Receipts)

One of the realities of home ownership is the seemingly constant need for maintenance and upkeep. While money expended for those purposes does not have any benefit from a capital gains tax perspective, money expended on home improvements does.

Money spent on home improvements, such as a kitchen remodel, room addition, roof replacement, and so on, can reduce capital gains tax because the cost of said improvements gets added to the property’s basis.

Take our same example of Able, above. In this case, Able remodels his master and guest bathrooms in 2009, at a cost of $20,000, and builds a deck onto the back of his house in 2012 for a cost of $10,000. In this case, Able adds the $30,000 of improvements to his basis (now at $180,000). Now, when he sells the house in 2016 for $210,000, he has a lower gain of $30,000 and thus, a lower potential capital gains tax.

Estate Planning and Capital Gains

Even if you plan to live in your house for the rest of your life, you should take capital gains tax into account. The reality, in most cases, is that after you pass on, your house will be sold at some point. By taking simple steps, you can reduce or eliminate the capital gains tax your heirs will have to pay.

When a person inherits real property, that property generally gets what is known as a “stepped up basis.” According to the tax code, property “acquired by bequest, devise, or inheritance, or by the decedent’s estate from the decedent” is entitled to a stepped up basis.

Essentially, the beneficiary’s basis in the property gets “stepped up” from the now deceased owner’s basis to the current fair market value of the house. For example: rather than selling his house, our friend Able passes away in 2016, and leaves his house to his daughter, Beth. In this case, Beth’s stepped up basis in the house would be the fair market value of $210,000. If Beth then immediately sells the house at that price, she would have no gain, and thus, pay no capital gains tax.

Hold Title to Your House Appropriately

In the case of a married couple, heirs of the surviving spouse can get a double step up in basis, if title to the house is held in a certain way.

Broadly speaking, and without getting to state specific laws regarding community property: when a house is held by a married couple as joint tenants and one spouse passes away, the surviving spouse gets 100% ownership of the house and a stepped up basis (as described above).

Then, when the surviving spouse leaves the house to their heir, the heir will receive a second step up in basis. Assuming that the house continues to appreciate in value after the first spouse’s death, the second step up in basis can create a significant tax savings.

When inheriting a house, capital gains tax issues will likely be one of the furthest things from the mind of the beneficiary.  An inheritance is necessarily preceded by someone’s passing and in those situations, emotional concerns may take precedent over financial ones. That being said, a bit of planning and forethought will go a long way in helping things along when it comes time to address financial matters.

*It is also worth noting that most states also have a state level capital gains tax. The exact percentage will vary from state to state. For example, we Californians have the dubious distinction of being subject to the highest state capital gains tax rate at 13%, bringing the total top capital gains rate for Californians to 33%!

Author Bio

Total Articles: 13
Evan is an attorney licensed in California and Oregon. Though his legal practice is mainly focused on civil litigation, Evan has a passion for tax, retirement planning, and personal finance. When not in court or at the office, Evan can be found hiking around Southern California or tending his suburban backyard farm with his wife and daughter. Evan earned his J.D. from Western State College of Law, and an LL.M. in Taxation from Chapman University.

Article comments


Im actually considering selling my primary and it fits all the criteria. I just LOVE the fact that I wont have to pay taxes on my gains. Super awesome!!

Randy Collier says:

My wife passed away in 2004 and now have a domestic partner. Would that help me for the $500,000 deduction on capital gains when I sell?

Eric Bowlin says:

Great info. Any way to avoid taxes is good info!

Do you know anything about a personal residence that you then rent out once you move into another home?

Sal Valle says:

I owe the home, but have rented the house to my daughter. I have another residence that I have lived in for over ten years. How does that effect my capital gains on the first home? On my second home?

David says:

What about a house you purchased as a rental and want to move into it ten years later? I have been taking deprecation on it every year. Thank you.

David. Lue says:

Do you have to pay tax on a home sale we live in it for over 25 years what do we do with the gain $250000

Ray kniffin says:

All good info, but what I was looking for is can the excess. Profit over the 500,000 be placed into a 401 retirement account tax free?

Catherine Martinez says:

My house was left to me, in a trust, by my parents. I have lived in this house almost 30 years. It is in major disrepair. I can no longer manage the upkeep or property taxes. I have received an cash offer $70,000 “As Is”, which is less than half of what my parents paid for it. I am 58 years old, single and live in California. Do I pay taxes if i gift the money to my children? I really do not want to be a homeowner again. I would like my daughter to use the money to help her and her husband buy their first house in Nevada.

Carlos Vejar says:

Where do you live? You should be able to get significantly more..even if it does need repairs.

Christopher Terry says:

I have a similar situation to yours. Did you ever get an answer or figure out a solution? Thanks

Kent w Myers says:

Over 65 will you have to pay any capital gain tax on sale of personal residence lived in for 40 years

jerome ruifrok says:

Just sold a house, house was worth 350,000 sold at a loss for 220,000. the house was bought for $15,000 in 1958. Did not know of tax would be $40,000.00. How do I avoid?

Christopher Terry says:

I own a house and small farm that my still living Mother deeded to me with a life estate attached as she is still living there. I grew up in this home and am retired and 61. She is now failing and needs to sell the home, not farm as she can no longer maintain it. She came up with a 30/70 split of the house proceeds – 30% to Mom. Is there a way to avoid some or all of the capital gains that I would be hit with unlike I would on her death? Will she be hit with capital gains also?

D Hill says:

My wife and I purchased our house in 1987 for $85,000 and have made some major improvements over the years. I can say we probably could show $200,000 basis for the house. Here is the issue. Our property was rezoned recently causing a very significant increase in property value. We figure we will be selling (basically forced) within the next couple years. With our basis and our $500K deduction, we can see a significant 7 figure profit. We are trying to figure out ideas on how to reduce the significant capital gains tax we will be seeing. Any ideas?

Catherine B says:

If you are unemployed and have no “ordinary income” in the year you sell your home, can you avoid capital gains tax all together?