Leave a Message

Thank you for your message. We will be in touch with you shortly.

Capital Gains Tax When Selling Your San Francisco Home

Sean Mamola  |  September 4, 2026

Capital Gains Tax When Selling Your San Francisco Home

When you sell your San Francisco home, you may owe federal capital gains tax on the profit, but a major exclusion often reduces or eliminates it. Under Internal Revenue Code Section 121, if the home was your primary residence for at least two of the last five years, you can exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly. Gain above that is generally taxable. This guide explains how it works in plain terms. It is general information, not tax advice, so confirm your specific situation with a CPA or tax advisor.

Key Findings

  • Section 121 excludes up to $250,000 of gain (single) or $500,000 (married filing jointly) on the sale of a primary residence.
  • You must have owned and used the home as your main home for at least two of the last five years.
  • Your taxable gain is the sale price minus selling costs minus your cost basis (purchase price plus capital improvements).
  • The exclusion applies to a primary residence, not an investment property, though a 1031 exchange can defer tax on the latter.
  • This is general information, not tax advice. A CPA should run your specific numbers.

Will I Owe Capital Gains Tax on My Home Sale?

Maybe, but many primary-residence sellers owe little or nothing thanks to the Section 121 exclusion. The tax applies to your gain, not the full sale price, and only to the portion of the gain that exceeds your exclusion. In high-value markets like San Francisco, long-time owners with large gains are the most likely to owe, which is exactly why understanding the rules and your cost basis matters. The IRS explains the basics in Topic No. 701, Sale of Your Home.

How Does the $250,000 / $500,000 Exclusion Work?

To qualify, you generally must have both owned the home and used it as your primary residence for at least 24 months out of the five years before the sale. Single filers can exclude up to $250,000 of gain, and married couples filing jointly up to $500,000. The excluded gain is never taxed, and notably the exclusion amounts have not been adjusted for inflation since 1997, which means more long-term owners bump against the cap over time.

How Is My Taxable Gain Calculated?

Your gain is not simply what you paid versus what you sold for. It is the sale price, minus your selling costs (commission, transfer tax, and other closing costs), minus your cost basis. Your basis is generally your original purchase price plus the cost of capital improvements you made over the years, such as a renovation or a new system. Keeping records of those improvements can meaningfully reduce your taxable gain, so it is worth gathering them before you sell.

Here is an illustrative example for a married couple filing jointly who sold their San Francisco primary residence. The numbers are hypothetical, meant only to show how the pieces fit together:

Step

Amount

Sale price

$1,800,000

Less selling costs (commission, transfer tax, closing)

-$105,000

Amount realized

$1,695,000

Less cost basis (2013 purchase $900,000 + $120,000 in improvements)

-$1,020,000

Total gain

$675,000

Less Section 121 exclusion (married filing jointly)

-$500,000

Taxable gain

$175,000

In this example, the couple still owes tax on $175,000 of gain because their profit exceeded the $500,000 exclusion, a common outcome for long-time San Francisco owners. Note how the $120,000 in documented improvements lifted their basis and shaved $120,000 off the gain. This is an illustration, not tax advice; your basis, holding period, filing status, and California treatment all affect the real number, which your CPA should calculate.

What If It Is a Rental or Investment Property?

The Section 121 primary-residence exclusion does not apply to an investment or rental property. For those, a 1031 exchange can allow you to defer capital gains tax by reinvesting the proceeds into another qualifying property within set timelines. The rules are strict and time-sensitive, so this is firmly a coordinate-with-your-professionals situation.

From experience: I recently helped an owner build a comps-based case to challenge an inflated property-tax assessment on their San Francisco home. The first thing I told them, and the first thing I will tell you, is that I am a real estate specialist, not a tax professional. On anything touching your taxes, my job is to bring accurate market data and closed-sale comparables and to coordinate with your CPA, who runs the actual numbers. That division of labor protects you and gets you the most reliable answer.

A Note on Tax Advice

This article is general information about how the rules commonly work, not personalized tax advice. Your basis, holding period, filing status, and any prior exclusions all affect the outcome, and California has its own tax treatment as well. Before you sell, review your specific situation with a qualified CPA or tax advisor.

Frequently Asked Questions

Do I have to pay capital gains tax when I sell my San Francisco home?

Only on gain above your exclusion. If the home was your primary residence for two of the last five years, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly); gain above that is generally taxable.

How much capital gain can I exclude?

Up to $250,000 if you file single, or $500,000 if you are married filing jointly, on a qualifying primary residence.

What is the two-of-five-year rule?

You generally must have owned and lived in the home as your main residence for at least 24 months out of the five years before the sale to claim the exclusion.

How do I calculate my gain?

Sale price, minus selling costs, minus your cost basis (purchase price plus capital improvements). Records of improvements can lower your taxable gain.

Does the exclusion apply to a rental property?

No. The primary-residence exclusion does not apply to investment property, but a 1031 exchange may let you defer the tax by reinvesting in another qualifying property.

Is this tax advice?

No. This is general information. Confirm your specific situation with a CPA or tax advisor, since individual circumstances and California rules vary.

Work With Sean Mamola

Planning a sale and wondering about your numbers? Sean Mamola brings 17+ years of real estate expertise and a luxury hospitality background to every client relationship, with a track record spanning entry-level condos to an $8.7 million South Beach penthouse. As a Global Luxury Specialist with Compass, Sean provides the accurate market data and comparables your CPA needs, and coordinates with your advisors so the whole picture lines up. Schedule a consultation or call (415) 704-3640.

Sean Mamola

Sean Mamola

Rises.co Sales Associate

Global Luxury Specialist & Penthouse Expert

Sean Mamola is a San Francisco real estate agent who specializes in luxury properties and penthouses throughout the city's most coveted neighborhoods. As a Global Luxury Specialist with Compass and Rises.co, Sean works with discerning clients who are buying and selling exceptional properties in San Francisco. Since 2018 he has closed 75+ transactions and more than $100M in sales volume across the city's high-rise condo and penthouse market.

Neighborhood Expertise

Sean focuses on San Francisco's premier areas including South Beach, Yerba Buena, Mission Bay, Pacific Heights, Lower Pacific Heights, Russian Hill, and Nob Hill. His deep knowledge of these neighborhoods allows him to guide clients to properties that perfectly match their lifestyle and investment goals.

Whether you're drawn to the modern luxury of South Beach condos, the urban sophistication of Yerba Buena, the waterfront appeal of Mission Bay, the timeless elegance of Pacific Heights, the historic charm of Russian Hill, or the prestigious heights of Nob Hill, Sean understands what makes each area unique.

Luxury Real Estate Services

For Sellers
Sean creates comprehensive marketing strategies that attract qualified buyers with refined tastes. He believes in elegant staging with meticulous attention to detail, ensuring your property makes an unforgettable impression. His marketing reaches both international and local luxury markets, maximizing exposure for condos, penthouses, condotels, and new developments.

For Buyers
Using cutting-edge technology and market research, Sean carefully analyzes pricing and property trends to find homes that satisfy his clients' specific preferences, price points, and lifestyles. His 24/7 availability and white-glove service ensure you never miss the right opportunity.

The Sean Mamola Advantage

Working with Sean and his partnership with Rises.co gives clients significant competitive advantages. His vast network of interconnected agents results in winning offers and an impressively low ratio of properties shown to offers accepted. Sean's impeccable work ethic and precise negotiation skills ensure sellers find the right buyer and buyers secure their dream home.

Background & Approach

Before becoming a licensed real estate agent, Sean spent years in luxury hospitality, skills he applies to every client relationship and transaction. He has tremendous respect for people's privacy and consistently exceeds expectations – from international travel to execute transactions to handling unique special requests.

As a Bay Area native who lived in New York City for 15 years, Sean brings a global perspective and genuine appreciation for people from all walks of life. His diverse background helps him connect with clients whether they're local San Francisco residents or international buyers seeking their perfect property.

Personal Touch

When not working, Sean enjoys cycling, spending time with his large Irish-Italian family, and volunteering for Food Runners, The Richmond/Ermet Aid Foundation (REAF), and Broadway Cares/Equity Fights AIDS. This community involvement reflects his commitment to giving back to the city he serves.

Ready to Work Together?

If you're looking for an exceptional San Francisco real estate agent who specializes in luxury properties and provides truly high-touch service, let's talk. Sean is ready to help you find your perfect San Francisco home or achieve the best possible outcome when selling your property.

Specializing in luxury condos, penthouses, and exceptional properties in South Beach, Yerba Buena, Mission Bay, Pacific Heights, Lower Pacific Heights, Russian Hill, and Nob Hill.

 

Recent Blog Posts

Stay up to date on the latest real estate trends.

Work With Rises.Co