Capital Gains Tax When You Sell Your Home in San Francisco or Marin
When you sell the home you live in, the gain that can be taxed is not the sale price. It is the price, less the costs of selling, less what you paid for the house and what you put into it. Most owners who live in their home can then leave out about $250,000 of that gain, or about $500,000 for a married couple filing jointly, and California follows the same rule. Homes bought decades ago in San Francisco and Marin often have gains well beyond those amounts, and the part above them is generally taxed by both the federal government and the state.
A broker's guide for owners who are thinking of selling: what goes into the gain, where the exclusion stops, how California treats the rest, what changes after a spouse has died, and what is behind the “California exit tax”. It is here so you know what to ask your CPA before the house is listed.
I'm a broker, not a CPA or an attorney. The tax points below are indications, read from IRS and California Franchise Tax Board publications in December 2026, so you know what to ask. They are not the final say; your CPA decides how they apply to you and works out what you owe. This page is about a home you own and live in. For a home you inherited, see my guide to step-up in basis.
Why long-time owners here should look at this early
The exclusion is a fixed sum. The gain on a house bought decades ago in San Francisco or Marin often is not close to it. So for a long-time owner the useful question is how large the gain really is once everything that counts has been counted, and that depends on your records as much as on the sale price.
It is also a question with a calendar attached. Some of the rules below look back a set number of years from the day the sale closes. Knowing them before you choose a date, move out or rent the house costs nothing. Finding out afterwards can.
The three figures that make up the gain
The IRS works out the gain on a home in two moves: the sale price less the costs of selling, and then less what the house has cost you over the years. Three figures go in, and you already hold the papers for most of them.
1
What you paid
The purchase price, plus certain closing costs from the day you bought, such as transfer taxes and the owner's title insurance. The settlement statement from your purchase lists them.
2
What you put in
Improvements that are still part of the house: an addition, a new roof, a modernized kitchen, new heating, wiring or plumbing, a deck, landscaping. Ordinary repairs and upkeep, such as painting or fixing a leak, generally do not count.
3
What the sale costs
The commission, the transfer tax you pay as the seller and the other costs tied directly to the sale come off the price before the gain is figured. They are the lines on a seller's net sheet.
One point reaches long-time owners in particular. Under the rules in place before May 1997, a seller could postpone the gain on one home by buying the next. If this house was bought that way, the IRS worksheet takes the postponed gain off your starting figure, so the gain on this sale can be larger than the purchase price suggests. Your CPA will want the papers from the earlier sale too.
An example, with round numbers
This is an example to show how the pieces fit together. It is not your figure, and the selling costs are an assumed amount.
| Sale price | $2,400,000 |
| Costs of selling (assumed) | − $120,000 |
| Purchase price, 1995 | − $450,000 |
| Improvements with records | − $230,000 |
| Gain | $1,600,000 |
| Exclusion, married couple filing jointly | − $500,000 |
| Gain left to be taxed | about $1,100,000 |
Without the records for the improvements, the taxed part in this example would be $230,000 larger. That is the reason to go looking for the paperwork.
Finding the records
Few owners have a tidy file that goes back thirty years. Most can rebuild more of it than they expect.
Whether a project counts as an improvement, and what will do where an invoice is missing, is your CPA's call. The IRS describes keeping these records until about three years after the return for the year of the sale is due.
The permit history is gathered for the sale in any case, because it is part of the package buyers receive. I pass a copy to you for your CPA.

The home-sale exclusion, and where it stops
The exclusion is for a main home. In general you need to have owned the house, and lived in it as your main home, for at least two of the five years before the sale closes. The two years do not have to be the same two, or unbroken. For the larger amount, a married couple files jointly, at least one spouse meets the ownership test and both meet the living-in test. The exclusion is generally available once every two years. The Franchise Tax Board says California follows the same rules.
These are the situations where it is worth asking your CPA how the exclusion applies before you set dates:
You moved out some time ago. Because the test looks back five years from the closing, a house that has stood empty or been rented for more than three years can fall outside it.
The house was a rental or a second home for a period. Time after 2008 when the house was not your main home can put part of the gain outside the exclusion. There are exceptions, including for the time after you last lived there.
Part of the property was rented or used for business. A separate unit, or an office you depreciated, is treated differently from the part you lived in. In a two-unit building where you live in one flat, this is the first thing to raise.
You are selling before two years are up. When the sale is brought on by a change of job, a health condition or an event you could not have foreseen, a reduced exclusion may be available.
You have moved to a care facility. If you lived in the house for at least 12 months of the five years, time in a licensed care facility can count toward the two years. My page on selling a home to move to a retirement community covers how that sale is timed.
You are divorced or separated. Time when a spouse or former spouse owned the house can count toward your ownership, and there are rules for a spouse who has moved out under a divorce or separation agreement.
How the gain above the exclusion is taxed
Three taxes can apply to the part of the gain that is left, and they are figured separately.
Tax | About how much | What decides it |
|---|---|---|
Federal capital gains tax | 0%, 15% or 20% for a home owned more than a year | Your taxable income for the year, including the gain. For 2025 returns the 20% rate began at about $533,000 for a single filer and about $600,000 for a married couple filing jointly; the amounts change each year. |
Federal net investment income tax | 3.8% | It applies to people with income above about $200,000, or about $250,000 for a married couple filing jointly. The excluded part of a home-sale gain is not counted; the part above the exclusion is. |
California income tax | Up to 13.3%, which is the top rate of 12.3% plus 1% on taxable income above $1 million (Franchise Tax Board, 2025 Form 540 booklet) | California has no lower rate for capital gains. The gain is added to your other income and taxed at the ordinary rates. |
A large gain arrives in one year's income, so it can be taxed in brackets your salary or pension never reaches. And the tax on a gain is not always paid when the return is filed: estimated payments may be expected during the year of the sale. Your CPA can tell you whether that applies to you and when.
Separately, escrow in California withholds part of the sale price for the Franchise Tax Board unless the seller certifies an exemption, and the sale of a principal residence is one of the exemptions. My page on seller closing costs explains it. The Franchise Tax Board is clear that being exempt from withholding is not the same as owing no tax.
If your spouse has died
Two rules can change the picture for a surviving spouse, and both are easy to miss in a hard year.
The starting figure may be reset. California is a community property state. The IRS says that when one spouse dies, the full market value of community property generally becomes the new starting figure for the whole property, including the half that belongs to the survivor, provided at least half of its value is counted in the estate of the spouse who died. For a house bought decades ago, that can take away most of the gain that built up before the death. Whether your home was community property depends on how title was held and on your own history, which is a question for your attorney and your CPA. The IRS notes that this rule does not extend to registered domestic partners. The value at that date is usually documented by an appraiser; my step-up guide explains how that works.
The larger exclusion can continue for a time. A surviving spouse who has not remarried may generally still use the couple's exclusion of about $500,000 when the home is sold within about two years of the death, and the time the late spouse owned and lived in the home can count toward the two-year tests. After that window the exclusion is the single amount. I mention it so it is part of your thinking, not to hurry anyone. Your CPA can tell you the exact date and whether, after the reset, it matters for you at all.
Is there a California exit tax?
Many owners who plan to leave the state look for one. This is what I found in the Franchise Tax Board's guidance in December 2026.
No tax for leaving. The guidance I read on residents, part-year residents and nonresidents describes no tax that is charged because a person moves out of California.
The house stays in California. What the guidance does describe is that California taxes nonresidents on income from California sources, and that real estate is taxed according to where it is located. Its own example is a nonresident who sells California property: the gain is taxable by California because the property is here. So moving to another state before you sell a San Francisco or Marin home generally does not take the gain out of California's reach. I think this is what most people mean when they say “exit tax”.
When you stop being a resident. The Franchise Tax Board treats someone as a resident who is in California for other than a temporary purpose, or whose permanent home is here while they are away temporarily. It publishes guidelines on the factors it weighs. If a move is part of your plan, the date your residency ends affects how your other income for that year is taxed, and that is for your CPA to work through with you.
Tax law changes, and proposals come and go. Your CPA can tell you what is in force in the year you sell.
Moving first, renting first, buying next
Renting the house before you sell. It changes the tax side, through the five-year test and depreciation, and it changes the sale. In San Francisco a tenancy generally continues through a later sale, which changes who the buyers are and what they pay. My guide to selling a tenant-occupied home in San Francisco covers the sale side. Ask your CPA about the tax side before you sign a lease.
Buying your next home. The IRS's current guide to selling a home offers the exclusion, not a way to postpone the gain by buying again. What a move can carry with it is your property tax base: California's Proposition 19 lets homeowners who are 55 or older move the taxable value of their primary residence to a replacement home in California, within limits and time periods. My Proposition 19 guide explains the outline; the county assessor decides whether a transfer qualifies.
If the house is in a living trust, or you are selling from another state. Neither changes the points above by itself, but each changes the paperwork. See my guides to selling a house held in a trust and selling from out of town.
What I prepare for you and your CPA
I do not estimate anyone's tax. What I can give you are the figures your CPA needs to do it, before you commit to a sale.
This belongs to Plan, the first of the five steps in Selling Well, the steps I follow on every sale: we walk the home and talk through your timeline and priorities, and I review the records and flag the questions that need answers before we set a plan. The tax on the gain is one of those questions. I flag it, and your CPA answers it.
One more point on preparation. I help you decide what to repair, paint, stage or leave alone, and I suggest only the upgrades buyers will notice and that give a noticeable return. That advice is about the price. How the money you spend getting the house ready is treated on your return is, again, your CPA's call.
Start with the two numbers your CPA will ask for
Tell me where the house is. I can walk through it with you, or start with a preliminary valuation, and put the value and a net sheet in writing for you to take to your CPA.
The price still matters most
The tax is figured on the gain, but what you keep starts with what the house sells for. My job is to get the highest price the market will offer. I recommend a list price designed to reach every buyer who is able to buy the home, and when the buyer pool for that kind of home is good, I will strategize with you about an offer date, so every interested buyer comes to the table at the same time. Competition among those buyers brings the strongest price.
The method is laid out in full in my guide to selling in San Francisco and Marin, and you can see how it played out, with list price, sale price and number of offers, in the case studies. If you are still choosing an agent, start with what a listing agent does in San Francisco or selling in Marin.
Frequently asked questions
Do I pay capital gains tax when I sell my home in California?
Only on the gain, and often only on part of it. An owner who has owned the house and lived in it as a main home for at least two of the five years before the sale can generally exclude up to about $250,000 of gain, or about $500,000 for a married couple filing jointly, and California follows the same rule. Gain above that is generally taxed by the IRS and by California. A CPA can work out your figure.
How much is capital gains tax on a home sale in California?
It depends on your income in the year of the sale. As an indication, as of December 2026: the federal rate on a long-term gain is 0%, 15% or 20%, some sellers also owe the 3.8% net investment income tax, and California taxes the gain as ordinary income at rates up to 13.3%, which is the top rate of 12.3% plus 1% on taxable income above $1 million (Franchise Tax Board, 2025 Form 540 booklet). These apply only to the gain left after the exclusion. A CPA has the final say on what you owe.
How can I reduce capital gains tax when I sell my house?
There is no way around the tax, but several things decide how much of the price counts as gain: the home-sale exclusion, the records of what you paid and what you spent on improvements, the costs of the sale, and timing against the two-out-of-five-year test. A surviving spouse has two further rules to ask about. I suggest raising all of it with a CPA before the house is listed, while the dates can still be chosen.
Is there a California exit tax?
The Franchise Tax Board guidance I read in December 2026 describes no tax charged for moving out of the state. It does say that California taxes nonresidents on income from California sources, and that real estate is taxed where it is located. So the gain on a San Francisco or Marin home generally remains taxable by California after the owner has moved away. A CPA can tell you what applies in the year you sell.
Do I avoid the tax if I buy another house?
Not under the current rules for a main home, as the IRS describes them: there is an exclusion, not a postponement for buying again. Before May 1997 a seller could postpone the gain that way, and a gain postponed then lowers the starting figure of the house bought with it.
Do owners over 55 get a capital gains break?
Age does not change it. The home-sale exclusion is the same for every seller and depends on ownership and use. The rule for owners 55 or older that many people have in mind is Proposition 19, which is about property tax on the next home, not the tax on the gain.
What records do I need to work out the gain on my home?
The settlement statement from your purchase, the contracts, invoices and proof of payment for improvements, and, if you bought before May 1997 with the proceeds of an earlier home, the papers from that sale. Permit records help date the work. I prepare the valuation and the net sheet that show the likely price and the costs of selling.
This article is provided for general information from a real estate broker's perspective and is not legal, tax or financial advice. The figures are indications that show you what to ask and whom to ask; they are not the final say, and tax rules and amounts change. Individual circumstances vary. Sellers should consult their own tax, legal and financial advisors about their situation. Current as of December 2026.



