You're about to sell your California home, you've watched its value climb for years, and now a worry has crept in: how much of that gain is the government going to take? You've heard "capital gains tax," done some quick mental math on the difference between what you paid and what it's worth now, and landed on a scary number. So you're searching capital gains tax when selling a house in California, trying to figure out what you'll actually keep.
Here's the reassuring, honest answer: most people who sell their primary home in California owe $0 in capital gains tax. There's a powerful federal rule — the home-sale exclusion — that lets you exclude up to $250,000 of gain if you're single, or $500,000 if you're married filing jointly, on the sale of your main home. For the large majority of California sellers, that exclusion erases the entire taxable gain. This guide walks through exactly how it works, with real Bay Area math, plus what happens if your gain is bigger than the exclusion. (One note up front: this is general education, not tax advice — confirm your specifics with a CPA.)
The rule that saves most sellers: the home-sale exclusion (Section 121)
Under federal tax law (IRC §121), when you sell a home that has been your primary residence, you can exclude a large chunk of the profit from capital gains tax entirely:
- $250,000 of gain if you file as single
- $500,000 of gain if you're married filing jointly
This isn't a deduction or a deferral — it's an outright exclusion. That gain simply isn't taxed. And critically, the exclusion applies to your gain (profit), not the sale price. People panic because they picture owing tax on the whole sale amount, or on the entire increase since they bought. Neither is true. You're only ever taxed on gain above the exclusion — and for most California homeowners, there isn't any. The graphic below shows how it plays out.
A real Bay Area example
Say you and your spouse bought a Hayward home years ago for $400,000, and you're selling it now for $850,000. Here's the math:
- Sale price: $850,000
- Original purchase price (your basis): −$400,000
- Your gain: $450,000
- Married filing jointly exclusion: −$500,000
- Taxable gain: $0
Even though the home nearly doubled in value, the entire $450,000 gain is under the $500,000 married exclusion, so none of it is taxed. A single filer with the same numbers would exclude $250,000 and owe tax only on the remaining $200,000 — still far from the "15% of $850,000" nightmare number people fear. And remember, your gain gets even smaller once you factor in your basis additions and selling costs, which we cover below.
Do you qualify? The 2-of-5-year test
To claim the full exclusion, you generally have to pass two tests, both measured over the five years before the sale:
- Ownership test: you owned the home for at least 2 of the last 5 years.
- Use test: you lived in it as your main home for at least 2 of the last 5 years.
The two years don't have to be continuous, and for married couples only one spouse needs to meet the ownership test, but both must meet the use test to get the full $500,000. You also generally can't have used the exclusion on another home sale in the past two years. If you've lived in and owned the home you're selling for at least a couple of years, you almost certainly qualify.
What if your gain is bigger than the exclusion?
If your gain exceeds your exclusion — more common for long-held homes in the priciest Bay Area markets — only the excess is taxed, not the whole gain and certainly not the whole sale. That excess is taxed as a long-term capital gain (assuming you owned it more than a year), and here's how the two layers work in California:
- Federal: long-term capital gains rates of 0%, 15%, or 20% depending on your total income. Most sellers fall in the 15% band.
- California: the state has no separate capital-gains rate — it taxes the gain as ordinary income (roughly 1%–13.3% by bracket, with most sellers in the ~6%–9.3% range). But again, this applies only to the portion above your federal exclusion.
So even a seller with a gain over the exclusion is taxed only on the slice that pokes above $250k/$500k — a much smaller number than the headline sale price. The same long-term-vs-ordinary rules we explain in our guide to capital gains tax on an inherited California house apply here too, just with the primary-residence exclusion layered on top.
Shrink the gain: what adds to your basis (and what selling costs do)
Your taxable gain is sale price minus your adjusted basis minus selling costs — so anything that raises your basis or counts as a selling cost lowers the gain:
- Capital improvements add to your basis: a new roof, an addition, a remodeled kitchen or bath, new HVAC, solar, landscaping, a pool. Keep receipts — decades of improvements can add up to six figures of basis.
- Selling costs come off the amount realized: agent commissions, escrow and title fees, transfer taxes, and certain closing costs. Our breakdown of what closing costs a California seller pays shows exactly what's deductible against the sale.
- Routine repairs don't count — patching, painting, and fixing are maintenance, not improvements, and don't add to basis.
For a seller whose gain is near the exclusion limit, documenting improvements and selling costs can be the difference between owing a little and owing nothing.
Special situations worth knowing
- Divorce. A married couple selling during or around a divorce can usually still claim the $500,000 exclusion if they sell while still legally married and both meet the tests; timing matters, so coordinate with your attorney. (See selling a home during divorce for the practical side.)
- Inherited, then lived in. If you inherited a home and later made it your primary residence, you may combine the stepped-up basis with the exclusion. The pure-inheritance case is different — that's covered in our inherited-home capital gains guide.
- A former rental converted to your home. If the property was once a rental, part of your gain tied to depreciation is "recaptured" and taxed even if you later moved in. If you're selling a property you rent out, our guide on selling a rental with tenants covers that path.
- Partial exclusion. Even if you don't hit the full 2 years, a move forced by a job change, health issue, or other qualifying "unforeseen circumstance" can earn you a prorated exclusion — often still enough to erase the gain.
Does selling to a cash buyer change your capital gains?
No. Your capital gain is driven by your sale price versus your basis, regardless of who buys the home — a cash buyer, an iBuyer, or a retail buyer with a mortgage. What a fast, as-is cash sale does do is remove agent commissions and let you skip pre-sale repairs, which keeps more money in your pocket at closing (and, if your gain is near the exclusion limit, the saved commission can even help keep you under it). If speed matters, see how we rank every option in how to sell a house fast in the Bay Area, and how offers are built in how much cash home buyers pay.
Frequently asked questions
Do I pay capital gains tax when I sell my house in California?
Usually not, if it's your primary residence. The federal home-sale exclusion lets you exclude up to $250,000 of gain (single) or $500,000 (married filing jointly), which erases the taxable gain for most sellers. You'd only owe tax on gain above that exclusion — and California taxes only that excess, not the whole sale.
How much is capital gains tax on a home sale in California?
On the portion of gain above your exclusion, you'd pay federal long-term capital gains tax (0%, 15%, or 20% based on income) plus California's ordinary-income rate on that same slice (most sellers land in the ~6%–9.3% range). California has no separate capital-gains rate. If your gain is under the exclusion, the rate is effectively zero.
What is the $250,000 / $500,000 home-sale exclusion?
It's the IRC §121 exclusion. If a home was your primary residence for at least 2 of the last 5 years, you can exclude up to $250,000 of gain when single, or $500,000 when married filing jointly, from capital gains tax entirely. It applies to your profit, not the sale price.
How do I avoid capital gains tax when selling my house?
For a primary home, the exclusion usually handles it — make sure you meet the 2-of-5-year ownership and use tests, and don't sell two exclusion-eligible homes within two years. Beyond that, document capital improvements (they raise your basis) and selling costs (they reduce the gain). For investment property, a 1031 exchange defers the tax, but that's a different rule from the primary-home exclusion.
Does California have an extra capital gains tax on home sales?
California doesn't have a special capital-gains rate, but it does tax capital gains as ordinary income. So on any gain above your federal exclusion, you'd pay California income tax at your normal bracket. On gain within the exclusion, there's nothing to tax at the state level either.
What if I only lived in the home for one year?
You generally need 2 of the last 5 years to claim the full exclusion. But if your move was triggered by a qualifying reason — a job relocation, a health issue, or certain unforeseen circumstances — you may qualify for a partial exclusion prorated by the time you did live there, which is often still enough to cover the gain.
The honest bottom line
The capital gains tax on selling your California home is almost never the monster it feels like at first. The home-sale exclusion shields up to $250,000 of gain for singles and $500,000 for married couples, which wipes out the taxable gain for the majority of sellers. If your gain is bigger than that, only the excess is taxed — never the whole sale — and improvements and selling costs shrink it further. The tax should rarely be the reason you hesitate to sell.
If you'd like to know what you'd actually net on your Bay Area home — after selling costs and any capital gains — tell us the address and roughly what it's worth, and we'll walk you through a real, no-obligation number. We buy homes as-is, pay all closing costs (no commission), and can close in as little as two weeks. Call (408) 717-4505. We buy across the Bay Area, including Oakland, San Jose, Hayward, and Fremont — and please confirm your specific tax situation with a CPA before you file.

