How to Avoid Capital Gains Tax When Selling Your Home in California
The complete California homeowner's guide to Section 121 exclusions, cost basis strategies, 1031 exchanges, and every legal method to reduce or eliminate capital gains tax on your home sale.
If you are selling a home in California, capital gains tax is likely your biggest financial concern after the sale itself. With LA-area home values appreciating significantly over the past decade, many homeowners are sitting on gains that far exceed what they paid. A homeowner who bought in Eagle Rock for $450,000 in 2012 and sells for $1,200,000 in 2026 has a gross gain of $750,000. Without the Section 121 exclusion, the combined federal and California tax bill on that gain could exceed $180,000.
The good news: the IRS provides several legal methods to reduce or completely eliminate capital gains tax on your home sale. The Section 121 exclusion is the most powerful tool, but it is not the only one. Cost basis improvements, partial exclusions, 1031 exchanges for investment properties, stepped-up basis for inherited homes, installment sales, and military-specific exceptions all have a role depending on your situation. This guide covers every strategy with worked examples at real LA price points.
I have helped sellers across Los Angeles, Pasadena, the San Gabriel Valley, and South Bay structure their home sales to minimize tax exposure. The difference between a well-planned sale and an uninformed one can be tens of thousands of dollars. Every dollar you keep is a dollar you can reinvest.
What's Your Home Worth?
Find out what your home is worth to calculate your potential capital gains.
Get Your Free Home Value- The Section 121 Exclusion ($250K / $500K)
- The 2-of-5-Year Rule Explained
- Partial Exclusions (Job, Health, Unforeseen)
- California Capital Gains Tax Rates
- Worked Example: $1.2M LA Home Sale
- Cost Basis Improvements That Reduce Your Gain
- 1031 Exchange for Investment Properties
- Stepped-Up Basis for Inherited Homes
- Divorce, Military, and Installment Sales
- Frequently Asked Questions
The Section 121 Exclusion: Your Primary Tax Shield
Section 121 of the Internal Revenue Code is the single most valuable tax benefit available to homeowners. It allows you to exclude a substantial portion of your capital gain from taxation when you sell your primary residence. For single filers, the exclusion is up to $250,000. For married couples filing jointly, it is up to $500,000.
To qualify for the full exclusion, you must meet three requirements:
- Ownership test: You owned the home for at least two of the five years before the date of sale.
- Use test: You lived in the home as your primary residence for at least two of the five years before the date of sale.
- No prior exclusion: You have not used the Section 121 exclusion on another home sale within the past two years.
For married couples to claim the full $500,000 exclusion, both spouses must meet the use test, at least one spouse must meet the ownership test, and neither spouse has used the exclusion within the past two years.
If you are a married couple who bought your LA home more than two years ago and have lived in it as your primary residence, your first $500,000 in gains is completely tax-free. At current LA median prices, this covers the majority of homeowners. The Section 121 exclusion is the reason most primary residence sellers in California owe no capital gains tax at all.
Wondering if your gain exceeds the exclusion? We can run the numbers for you.
📞 Call (213) 262-5092The 2-of-5-Year Rule: What Counts and What Does Not
The 2-of-5-year rule is more flexible than most homeowners realize. You do not need to have lived in the home for the two years immediately before the sale. The 24 months of residency can be spread across any portion of the five-year lookback period, and they do not need to be consecutive.
Scenarios That Qualify
- Lived in, then rented out: You lived in your Pasadena home for three years, then rented it out for two years before selling. You qualify because you lived there for at least 24 months within the five-year window.
- Split residency: You lived in the home for 14 months, moved out for 12 months, then moved back in for 10 months before selling. Your total residency is 24 months within the five-year window. You qualify.
- Temporary absences: Short vacations, seasonal travel, and temporary work assignments away from home generally do not break your residency period as long as the home remains your primary residence.
Scenarios That Do NOT Qualify
- Less than two years of residency: You bought, lived in for 18 months, then sold. You do not meet the 24-month requirement (though you may qualify for a partial exclusion, covered in the next section).
- Never lived in it: You purchased the property as a rental investment and never used it as your primary residence. Section 121 does not apply. Consider a 1031 exchange instead.
- Used the exclusion recently: You sold another primary residence within the past two years and claimed the Section 121 exclusion on that sale. You must wait two years from the prior sale date.
If you are approaching the two-year mark and considering selling, timing your sale to fall after the 24-month residency threshold can save you hundreds of thousands of dollars. If you moved into your LA home in June 2024 and are planning to sell, waiting until at least June 2026 means you qualify for the full exclusion. Selling one month early could cost you the entire benefit.
Partial Exclusions: Selling Before Two Years
If you need to sell before meeting the full 2-of-5-year requirement, you may still qualify for a partial exclusion under three qualifying circumstances. The partial exclusion is prorated based on the percentage of the 24-month requirement you fulfilled.
Qualifying Circumstance 1: Job Relocation
If you sell because your new place of employment is at least 50 miles farther from your home than your old workplace was, you qualify for a partial exclusion. This applies whether you are starting a new job, were transferred, or are self-employed and your new principal place of business meets the distance requirement.
Qualifying Circumstance 2: Health Reasons
If a doctor recommends a change of residence for health reasons related to a diagnosis, cure, or treatment of a disease, illness, or injury for you, your spouse, a co-owner, or certain family members, you qualify. This includes situations where the home has environmental factors (mold, air quality) that are medically harmful.
Qualifying Circumstance 3: Unforeseen Circumstances
The IRS recognizes several unforeseen circumstances that qualify for a partial exclusion:
- Death of a spouse, co-owner, or family member living in the home
- Divorce or legal separation
- Natural or man-made disaster, war, or act of terrorism resulting in a casualty to the home
- Involuntary conversion (condemnation or eminent domain)
- Loss of employment that makes you unable to pay the mortgage
- Multiple births from the same pregnancy (making the home too small)
Partial Exclusion Calculation Example
A single filer bought a home and lived in it for 15 months before a job relocation required them to sell. They lived in the home for 15 out of the required 24 months, so 62.5% of the time. The partial exclusion is 62.5% of $250,000 = $156,250. Any gain up to $156,250 is excluded from taxation.
Relocating for work or health? We can help you calculate your partial exclusion and plan the sale.
💬 Text Us Your SituationCalifornia Capital Gains Tax Rates: What You Actually Owe
California does not offer a separate, lower tax rate for capital gains. Unlike the federal system, which taxes long-term capital gains at preferential rates (0%, 15%, or 20%), California treats capital gains as ordinary income. This means your gain is added to your other income and taxed at your marginal state income tax rate, which can reach 13.3% for the highest earners.
| Tax Level | Rate Range | Applied To |
|---|---|---|
| Federal Long-Term Capital Gains | 0% / 15% / 20% | Gains on assets held 1+ years, based on income |
| Federal Short-Term Capital Gains | 10% - 37% | Gains on assets held less than 1 year (taxed as ordinary income) |
| Net Investment Income Tax (NIIT) | 3.8% | Applies to higher-income taxpayers (AGI over $200K single / $250K married) |
| California State Capital Gains | 1% - 13.3% | Taxed as ordinary income, no preferential rate |
| Combined Maximum Rate | Up to 37.1% | Federal (20%) + NIIT (3.8%) + CA (13.3%) for highest earners |
Many sellers mistakenly assume California taxes capital gains at a lower rate. It does not. Every dollar of capital gain above your Section 121 exclusion is added to your California taxable income and taxed at your marginal rate. For a couple with $200,000 in other income and $300,000 in taxable gains above the exclusion, the California tax alone on that gain could exceed $30,000.
Worked Example: Selling a $1.2M LA Home
Here is a realistic example using LA-area numbers. This is the calculation every seller should run before listing.
The Scenario
A married couple purchased a home in Eagle Rock in 2015 for $600,000. Over the years, they spent $85,000 on capital improvements: a kitchen remodel ($45,000), new roof ($18,000), HVAC replacement ($12,000), and bathroom renovation ($10,000). They are now selling the home for $1,200,000. Selling costs (agent commissions, escrow, title, transfer taxes) total $72,000.
Calculate Adjusted Cost Basis
Purchase price ($600,000) + capital improvements ($85,000) + purchase closing costs ($8,000) = $693,000 adjusted cost basis
Calculate Net Gain
Sale price ($1,200,000) - selling costs ($72,000) - adjusted cost basis ($693,000) = $435,000 net capital gain
Apply Section 121 Exclusion
The couple qualifies for the $500,000 married exclusion. Their net gain of $435,000 is entirely below the $500,000 threshold. Federal capital gains tax owed: $0. California capital gains tax owed: $0.
By documenting their $85,000 in capital improvements and taking advantage of the full married Section 121 exclusion, this couple pays no capital gains tax on an $600,000 gross gain. Without the improvement documentation, their gain would have been $520,000, putting $20,000 above the exclusion and triggering a tax bill of approximately $5,200 in combined federal and state taxes.
What If They Were Single Filers?
If this were a single filer with the same numbers, the Section 121 exclusion covers only $250,000. The remaining $185,000 in gains would be taxable. Assuming a 15% federal long-term capital gains rate and a 9.3% California state rate (for a mid-to-upper income bracket), the approximate tax bill would be:
- Federal: $185,000 x 15% = $27,750
- NIIT (if applicable): $185,000 x 3.8% = $7,030
- California: $185,000 x 9.3% = $17,205
- Total estimated tax: $51,985
This is why cost basis documentation matters. Every dollar of documented improvements reduces your taxable gain dollar for dollar.
What's Your Home Worth?
Get a current valuation to calculate your potential capital gains before you list.
Get Your Free Home ValueCost Basis Improvements That Reduce Your Taxable Gain
Your cost basis is not just your purchase price. Every qualifying capital improvement you made during ownership increases your basis and reduces your taxable gain. The key distinction: improvements add value or extend the life of the property. Repairs maintain existing condition and do not count.
Qualifies as Capital Improvement
- Kitchen or bathroom remodel
- Room addition or ADU construction
- New roof or complete re-roofing
- HVAC system replacement
- New windows and doors
- Solar panel installation
- Landscaping and hardscaping
- Pool or spa installation
- Electrical or plumbing upgrades
- Foundation repair or reinforcement
- Seismic retrofitting
- Security system installation (hardwired)
Does NOT Qualify (Repairs)
- Painting interior or exterior
- Fixing a leaky faucet
- Replacing broken window panes
- Patching drywall
- Cleaning carpets or gutters
- Fixing a running toilet
- Unclogging drains
- Replacing light bulbs or fixtures
- Pest control treatments
- General maintenance and upkeep
- Appliance repairs
- HVAC tune-ups and filter changes
You need receipts, invoices, contracts, and permits for every improvement you claim. If you cannot prove the expense, the IRS will not allow it. Start a folder (physical or digital) for every home improvement project, and keep it for at least three years after selling. A permit from your city's building department is particularly strong evidence.
The Pre-Sale Improvement Strategy
If your gain is close to or above the exclusion threshold, strategic pre-sale improvements can push your cost basis higher and your taxable gain lower. A $30,000 kitchen refresh that also increases your sale price by $40,000 gives you a double benefit: higher sale price AND higher cost basis. Just make sure improvements are completed and paid for before the closing date.
Not sure which improvements qualify? Text us a list of your upgrades and we will sort them.
💬 Text "Improvement Review" to (213) 262-5092We will identify which improvements increase your cost basis.
1031 Exchange: Deferring Gains on Investment Properties
The Section 121 exclusion only applies to your primary residence. If you are selling a rental property, vacation home, or other investment real estate, the 1031 exchange (also called a like-kind exchange) is the primary tool for deferring capital gains tax. You do not eliminate the tax. You defer it by reinvesting into a replacement property.
How a 1031 Exchange Works
Sell the Relinquished Property
Close on the sale of your investment property. A qualified intermediary (QI) holds the proceeds. You cannot touch the money. If you receive any funds directly, the exchange fails and the full gain is taxable.
Identify Replacement Property (45 Days)
Within 45 calendar days of closing, you must identify up to three potential replacement properties in writing to your QI. This deadline is strict. No extensions. If day 45 falls on a weekend or holiday, it does not move.
Close on Replacement Property (180 Days)
Within 180 calendar days of selling the original property, you must close on the replacement property. The QI transfers the funds directly to escrow. The replacement property must be of equal or greater value to defer the full gain.
(No Extensions)
(No Extensions)
(Tax Deferred, Not Eliminated)
California conforms to federal 1031 exchange rules, but there is a catch. If you exchange a California property for an out-of-state replacement property and later sell the replacement, California will recapture the deferred gain and tax it at California rates, even if you no longer live in the state. You must file Form 3840 annually to track deferred gains on out-of-state exchanges. This is unique to California and catches many investors off guard.
Stepped-Up Basis: The Inherited Property Advantage
If you inherited a home, you receive one of the most powerful tax benefits in the code: a stepped-up cost basis. The cost basis of the property is reset to the fair market value on the date of the decedent's death, not the original purchase price. All of the capital gains that accumulated during the previous owner's lifetime are permanently eliminated.
Stepped-Up Basis Example
Your parents purchased their home in Alhambra in 1985 for $150,000. When they passed away in 2025, the home was worth $1,100,000. Your cost basis is $1,100,000, not $150,000. If you sell the home for $1,150,000, your taxable gain is only $50,000, not $950,000. If you lived in the inherited home as your primary residence for two years before selling, the $50,000 gain would be covered by the Section 121 exclusion, and you would owe zero capital gains tax.
For community property states like California, when one spouse dies, the surviving spouse receives a stepped-up basis on the entire property, not just the decedent's half. This is a significant benefit unique to community property states. A couple who bought their home in 1990 for $200,000, where one spouse passes when the home is worth $1,400,000, gets the full $1,400,000 as the new basis.
If you plan to sell an inherited home, get a professional appraisal establishing the fair market value as of the date of death. This appraisal is your evidence for the stepped-up basis. Without it, you may end up in a dispute with the IRS over the correct basis amount. An appraisal costs $400 to $600 and can save tens of thousands in taxes.
For more on buying or inheriting property from family members, see our guide on Buying Your Parents' House in California, which covers Prop 19 parent-child transfers, gift of equity, and step-up in basis in detail.
Inherited a property and need a current market valuation? We provide free CMAs for inherited homes.
💬 Text "Inherited Home CMA" to (213) 262-5092Special Situations: Divorce, Military, and Installment Sales
Capital Gains and Divorce
Divorce creates unique capital gains scenarios depending on how the home is handled:
- Home sold during divorce: Both spouses can claim their individual $250,000 exclusion (totaling $500,000) if both meet the ownership and use tests at the time of sale, even if filing separately.
- Home transferred to one spouse: Property transfers between spouses (or former spouses incident to divorce) are tax-free under IRC Section 1041. The receiving spouse takes over the original cost basis. When they eventually sell, they can use the Section 121 exclusion if they meet the 2-of-5-year requirement.
- Spouse who moved out: A spouse who moves out of the home as part of a divorce decree can still count the time their ex-spouse lives in the home toward the use test, as long as they retain ownership. This prevents the non-resident spouse from losing their exclusion eligibility.
Military Service Members: Extended Exclusion Period
Active duty service members receive a significant benefit under the Military Family Tax Relief Act. If you are on qualified official extended duty (stationed at least 50 miles from home or ordered to live in government quarters), you can suspend the 5-year lookback period for up to 10 years. This effectively gives you up to 15 years to meet the 2-of-5-year residency requirement.
A service member buys a home at Camp Pendleton in 2016, lives in it for two years, then receives PCS orders to Fort Liberty in 2018. They rent the home for the next eight years. In 2026, they sell. Because they can suspend the lookback period, their 2016-2018 residency still counts. They qualify for the full Section 121 exclusion despite not living in the home for eight years.
Installment Sales: Spreading the Tax Over Time
If your gain exceeds the Section 121 exclusion, an installment sale allows you to spread the taxable gain over multiple tax years by receiving the sale proceeds in installments rather than a lump sum. This can keep you in a lower tax bracket each year and reduce your overall tax burden.
In an installment sale, you act as the lender. The buyer makes a down payment and then monthly payments with interest over an agreed period. You report the capital gain proportionally as you receive each payment. This is most commonly used for high-value properties where the gain significantly exceeds the exclusion.
Installment sales carry risk: the buyer could default on payments. You also cannot access the full sale proceeds immediately. Consult a tax professional and real estate attorney before structuring an installment sale. The interest you charge must meet the IRS minimum rate (Applicable Federal Rate) or the IRS will impute interest income.
Quick Reference: Capital Gains Tax Cheat Sheet
Save this cheat sheet. Then get your home's current value to run the numbers.
🏠 Get Your Free Home ValueCalculate Your Capital Gains
Step one is knowing your home's current market value. Get a free estimate in seconds.
Get Your Free Home ValueFrequently Asked Questions
How much capital gains tax do you pay when selling a home in California?
California taxes capital gains as ordinary income at rates up to 13.3%. Federal long-term rates are 0%, 15%, or 20% depending on income. However, most primary residence sellers pay zero because of the Section 121 exclusion ($250K single / $500K married). You only pay tax on gains that exceed the exclusion after subtracting your adjusted cost basis and selling costs.
What is the Section 121 exclusion?
Section 121 of the Internal Revenue Code allows you to exclude up to $250,000 (single) or $500,000 (married filing jointly) in capital gains from the sale of your primary residence. You must have owned and lived in the home for at least two of the five years before selling, and you cannot have used the exclusion on another sale within the past two years.
What is the 2-of-5-year rule?
You must have owned the home and used it as your primary residence for at least 24 months during the five-year period ending on the date of sale. The 24 months do not need to be consecutive. If you lived in the home for two years, moved out, and rented it for up to three years, you still qualify if the sale occurs within the five-year window.
Have a question not answered here? We respond to every text personally.
💬 Text Your Question to (213) 262-5092Can I get a partial exclusion if I did not live in my home for two years?
Yes, if you sold due to a job relocation (new workplace at least 50 miles farther), a qualifying health condition, or unforeseen circumstances (divorce, death of spouse, natural disaster). The partial exclusion is prorated based on the time you actually lived there relative to the 24-month requirement.
What home improvements reduce capital gains tax?
Capital improvements that add value, extend the home's life, or adapt it to new uses increase your cost basis. Examples: kitchen and bathroom remodels, room additions, new roofing, HVAC replacement, solar panels, ADU construction, landscaping, and new windows. Routine repairs (painting, fixing leaks, replacing fixtures) do not qualify. Keep all receipts and invoices.
How does a 1031 exchange work for investment properties?
A 1031 exchange defers capital gains tax by reinvesting sale proceeds into a like-kind replacement property. You must identify a replacement within 45 days and close within 180 days. A qualified intermediary must hold the funds. It applies only to investment and business properties, not primary residences. California will recapture deferred gains if the replacement is out of state.
What is a stepped-up basis for inherited property?
When you inherit a property, the cost basis is reset to the fair market value on the date of death. All gains that accumulated during the decedent's lifetime are permanently eliminated. If your parents bought for $150,000 and the home was worth $1,200,000 at death, your basis is $1,200,000. California's community property rules allow the full step-up when one spouse dies.
Do military members get special capital gains rules?
Yes. Active duty service members can suspend the 5-year lookback period for up to 10 years while on qualified official extended duty at least 50 miles from home. This gives military members up to 15 years to meet the 2-of-5-year residency requirement for the Section 121 exclusion.
Related Homeowner Resources
Sell Smart. Keep More of Your Equity.
We help California homeowners understand their capital gains exposure, maximize their cost basis, and plan tax-efficient sales. No cost. No obligation.
- Free home valuation to calculate your potential gain
- Cost basis improvement review and documentation guidance
- Section 121 eligibility verification and timeline planning
- CPA and tax attorney referrals for complex situations
📞 Call (213) 262-5092
Or search homes: search.lametrohomefinder.com






