← All articles
SellingCapital GainsCalifornia

Capital Gains Tax When Selling a House in California

How capital gains tax works when selling a house in California — the federal exclusion, who qualifies, and what you owe when you don't.

Capital Gains Tax When Selling a House in California

TL;DR: Most California homeowners owe zero federal capital gains tax on their home sale thanks to the Section 121 exclusion — but only if they meet the ownership and use tests. When the gain exceeds the exclusion, or the home was a rental or investment property, both federal and California state taxes apply, and the combined bite can be substantial.

Key Takeaways

  • Homeowners who have owned and lived in their primary residence for at least two of the past five years can exclude up to $250,000 of capital gain from income, or up to $500,000 for married couples filing jointly [1].
  • California has no separate capital gains tax rate — the state taxes gains as ordinary income, which means high earners face a steeper state bill than they would in most other states.
  • Your taxable gain is not simply the sale price minus what you paid; selling costs, closing fees, and the cost of capital improvements all reduce the number.
  • Sellers who do not meet the full two-year requirement may still qualify for a partial exclusion if the sale was prompted by a job change, health issue, or other qualifying circumstance.
  • Getting the home’s value right before you list protects both your timeline and your after-tax proceeds — our free home valuation is where that conversation starts.

What Is Capital Gains Tax on a Home Sale?

Capital gains tax applies to the profit you make when you sell a capital asset, and your house is a capital asset. The capital gain is the difference between your home’s sale price and its adjusted basis — your original purchase price plus the cost of capital improvements, minus any depreciation you may have claimed.

That distinction matters. Many sellers assume their gain is the difference between what they paid and what they sold for, but that is not how the IRS calculates it. Selling costs — including real estate commissions, title insurance, legal fees, and inspection fees — reduce your gain. So does every qualifying capital improvement you made during ownership, from a kitchen remodel to a new roof.

Here along the I-680 corridor, where home values in Alamo, Danville, and Walnut Creek have climbed steadily for decades, the gain on a long-held property can be significant. That is exactly why the federal exclusion exists — and why understanding whether you qualify is the first financial question to answer before you list your home.

How Does the Federal Exclusion Work?

The IRS allows you to exclude up to $250,000 of capital gain from the sale of your primary residence if you are single, or up to $500,000 if you are married and file a joint return [1]. This is the Section 121 exclusion, and it is the reason most homeowners in the valley owe nothing in capital gains tax when they sell.

To qualify for the full exclusion, you must meet two tests. First, the ownership test: you or your spouse must have owned the home for at least 24 months out of the five years leading up to the sale. Second, the use test: you must have used the home as your primary residence for at least 24 months of those same five years. You can meet these tests during different two-year periods, but both must fall within the five-year window ending on the date of sale.

One additional rule: you generally cannot claim the exclusion if you have already excluded the gain from the sale of another home during the two-year period prior to your current sale.

What Counts as Adjusted Basis?

Your adjusted basis starts with your original purchase price. Add the cost of capital improvements — not routine maintenance, but permanent upgrades like an addition, a new HVAC system, or a pool. Subtract any depreciation you took, such as deductions claimed while renting part of the home.

When the exclusion, capital improvements, selling costs, and pre-sale repairs are all factored in, many homeowners find that no capital gains tax is owed at all.

The IRS also recognizes costs for painting, landscaping, and similar work as selling costs when completed within 90 days of the sale and done to make the home more saleable. That is one more reason a well-executed preparation plan — the kind we walk through on our preparing your home page — pays for itself beyond just the sale price.

What Are the Tax Rates When the Exclusion Does Not Cover Everything?

When your gain exceeds the exclusion, or you do not qualify at all, federal capital gains tax rates depend on how long you owned the property and your income level.

Short-term gains apply if you sell within one year of purchase. These are taxed at your ordinary income tax rate.

Long-term gains apply if you owned the home for more than one year. These carry lower rates, and the exact rate depends on your filing status and taxable income.

Most sellers along the I-680 corridor — particularly in Alamo and Danville where median home values are well into seven figures — will owe federal capital gains tax if their gain exceeds the exclusion.

California’s Layer on Top

California does not offer a preferential capital gains rate. The state taxes capital gains as ordinary income, and its top marginal rate is among the highest in the country. For a seller whose combined federal and state marginal rates add up, the tax on gain beyond the exclusion can consume a meaningful share of the proceeds.

This is especially relevant for long-time homeowners in towns like Alamo, where the team’s sold record covers 219 closed MLS transactions totaling $261.7 million between 1996 and 2023, with a median sale price of $1,115,000. If you bought in the 1990s or early 2000s at a fraction of today’s values, your gain may well exceed the exclusion — and the combined federal and California tax bill deserves serious attention from a CPA before you list.

What If You Do Not Meet the Two-Year Requirement?

You may still qualify for a partial exclusion if you sold the home because of a change in employment, a health condition, or certain unforeseen circumstances. The partial exclusion is prorated based on how long you actually lived in the home relative to the two-year requirement.

Common scenarios where this applies:

  • Job relocation. You are transferred and must move before hitting the two-year mark. The exclusion is prorated based on months of qualifying use.
  • Health. A doctor-recommended move for you or a family member can trigger the partial exclusion.
  • Divorce or separation. One spouse may need to sell before the two-year window closes.

Even a partial exclusion can shield a significant portion of gain. If you think you might qualify, bring it up with your tax advisor before closing — the election is made on your return, and missing it means paying tax you did not owe.

Military Exception

Members of the Uniformed Services, the Foreign Service, or the intelligence community on qualified official extended duty may elect to suspend the five-year test period for up to 10 years. That means a service member stationed overseas does not lose eligibility simply because they have not physically lived in the home.

How Do Investment Properties and Rentals Differ?

The Section 121 exclusion applies only to your primary residence. If you are selling an investment property, a rental, or a second home, the full gain is taxable. You may, however, defer the tax through a 1031 exchange, which allows you to reinvest the proceeds into another investment property of equal or greater value.

A 1031 exchange has strict rules — you must identify a replacement property within 45 days and close within 180 days — and it requires a qualified intermediary. It does not eliminate the tax; it defers it until you eventually sell the replacement property without doing another exchange.

For homeowners in the East Bay who converted a former primary residence into a rental, the math gets complicated. Any depreciation you claimed during the rental period is subject to recapture and taxed separately, even if the rest of the gain qualifies for the exclusion. We have seen this trip up sellers in Danville and Walnut Creek who rented out a home for a few years before deciding to sell. Get a CPA involved early.

How Do You Calculate What You Actually Owe?

Here is the sequence, step by step:

  1. Start with the sale price. This is the gross amount on the closing statement.
  2. Subtract selling costs. Commissions, title insurance, escrow fees, legal fees, transfer taxes, and qualifying pre-sale repairs.
  3. Subtract your adjusted basis. Original purchase price plus capital improvements, minus depreciation.
  4. The result is your capital gain.
  5. Apply the exclusion. If you qualify, subtract up to $250,000 (single) or $500,000 (married filing jointly) [1].
  6. What remains is your taxable gain. Apply the applicable federal rate based on your filing status and income, then calculate your California state tax on the same amount.

Unmarried co-owners who each independently meet the ownership and use tests can each exclude up to $250,000 of their share of the gain [2]. That can be a meaningful planning opportunity for domestic partners or siblings who co-own a property.

What About Installment Sales?

If you sell your home under a contract where some or all of the payment arrives in a future year, you have made an installment sale. The gain is recognized as you receive payments, not all at once. This can spread the tax liability across multiple years and potentially keep you in a lower bracket in each year — useful for high-gain sales where the exclusion does not cover the full amount.

Installment sales are uncommon in the competitive East Bay market, but they come up in certain estate and family situations. If a seller is carrying back a note — say, selling to an adult child or as part of a trust distribution — the installment method may apply automatically unless you elect out.

Why This Matters

As of October 2026, home values along the I-680 corridor remain elevated relative to historical purchase prices, which means the capital gains question is live for a large share of the homeowners we talk to every week. A family that bought in Danville or Alamo in the early 2000s may be sitting on a gain that tests or exceeds the exclusion — and the combined federal and California tax exposure can run into six figures if they are not prepared.

The right time to work through these numbers is before you decide to sell, not at the closing table. A preliminary home valuation gives you a realistic sale price to plug into the calculation, and a conversation with your CPA fills in the brackets and deductions specific to your return. We coordinate with your tax advisor regularly — our team has closed 529 MLS transactions totaling $527.4 million between 1996 and 2024, and the capital gains question comes up in a large share of those conversations.

The exclusion is generous, but it is not automatic. It requires meeting specific tests, and the consequences of assuming you qualify without checking can be a tax bill you did not budget for. If you are weighing a sale in Alamo, Danville, Walnut Creek, or anywhere along the corridor, start with the valuation and the tax math — then decide on timing and pricing strategy from a position of clarity rather than guesswork.

Sources

[1] irs.gov, “Topic no. 701, Sale of your home | Internal Revenue Service”. https://www.irs.gov/taxtopics/tc701

[2] hd.carelonwellbeing.com, “Avoiding Capital Gains Tax When Selling Your Home: Read the Fine Print - Home Depot EAP | Carelon”. https://hd.carelonwellbeing.com/hd/find-legal-support/resources/taxes-and-audits/legal-assist/avoiding-capital-gains-tax-when-selling-your-home-read-the-fine-print

Frequently Asked Questions

How do I avoid capital gains tax when selling my house?

Meet the ownership and use tests by owning and living in the home as your primary residence for at least two of the five years before the sale. Married couples filing jointly can exclude the most, while single filers get a smaller but still significant exclusion. Even if you fall short of the full requirement, a partial exclusion may apply.

Do I owe capital gains tax if I sell my house and don't buy another one?

Whether you buy another home has no bearing on the exclusion. As long as you meet the ownership and use tests, you can sell, rent, move into an apartment, or leave the state — the exclusion still applies. That is a common misconception left over from the pre-1997 rollover rules.

How long do I have to own a house before selling to avoid capital gains tax?

You must have owned the home for at least two years out of the five years leading up to the sale and used it as your primary residence for at least two of those five years. The ownership period and the use period do not need to overlap.

Does California tax capital gains from a home sale differently than the federal government?

California taxes capital gains as ordinary income, so the state rate depends on your overall income bracket. There is no separate state-level exclusion, but the federal exclusion reduces the gain before California calculates its tax. Consult a CPA for your specific situation.

What is your home actually worth?

Get a pricing opinion built from five decades of local sales — not an algorithm. No obligation, no spam.

Get My Home Value

Related reading

Call Text Home Value