Closing Table Math

What a Sacramento seller actually walks away with, worked out line by line

Capital gains on a California home sale, with the arithmetic shown

Most of the gain on a home you've lived in for years can come to you tax-free, up to $250,000 for a single filer or $500,000 for a married couple filing jointly. Whatever is left over gets taxed, and California taxes it as ordinary income with no special capital gains rate. Escrow may also hold back 3 1/3% of the price for the state unless you certify an exemption.

The Julia Morgan House, a large Mediterranean-style home behind cypress trees on T Street
The Julia Morgan House on T Street in Sacramento. Photo: Irneh, Wikimedia Commons, CC BY-SA 3.0, cropped.

Income tax on the gain is the one seller cost that never gets its own line on the settlement statement. It shows up with your tax return. So it pays to do the arithmetic before you sign a listing, not after.

The federal exclusion in one paragraph

The rule is Internal Revenue Code section 121. If you owned the house and used it as your main home for at least two years during the five years ending on the sale date, you can exclude up to $250,000 of gain. A married couple filing jointly can exclude up to $500,000 if either spouse meets the ownership test, both meet the use test, and neither has used the exclusion on another home in the past two years. The two years don't have to be continuous, and the ownership years and the use years don't have to be the same years. IRS Publication 523, the 2025 edition used for 2025 returns, walks through all of it with worksheets, and Topic 701 is the one-page version.

You can use the exclusion only once in any two-year period.

If you fall short of two years

Publication 523 allows a partial exclusion when the main reason for the sale was a change in workplace location, a health issue, or an unforeseeable event. A work move counts if the new job is at least 50 miles farther from the home than the old one was. The unforeseeable list includes the home being destroyed or condemned, a casualty loss from a disaster, a death, a divorce or legal separation, multiple births from one pregnancy, and becoming eligible for unemployment compensation.

The math is a fraction. Take the shortest of your residence time, your ownership time, and the time since you last used the exclusion. Divide by 24 if you count in months, or by 730 if you count in days, and multiply by $250,000. Example: a single seller who lived in the house 15 months and moved for a qualifying job gets 15 divided by 24, times $250,000, which is $156,250.

How the gain itself is figured

The IRS formula has three steps: two subtractions and an addition in the middle.

  1. Amount realized is the sale price minus selling expenses, which Publication 523 describes as the costs directly tied to selling, such as commissions, advertising and legal fees.
  2. Adjusted basis is what you paid, plus certain purchase closing costs, plus improvements that are still part of the house.
  3. Gain is the amount realized minus the adjusted basis.

The middle step is where sellers leave money on the table, because basis needs paper. Here is what Publication 523 lets you count and what it doesn't.

Counts toward basisDoes not count
Purchase priceRepairs and maintenance that keep the house in good condition, such as painting, fixing leaks, filling cracks
Owner's title insurance, recording fees, survey fees, transfer taxes, legal fees for title search and the deed, at purchaseFire and casualty insurance premiums
Additions: bedroom, bathroom, deck, garage, porch, patioRent you paid to live there before closing, and utilities for that period
Lawn and grounds: landscaping, driveway, walkway, fence, retaining wall, poolLoan costs: points, origination fees, mortgage insurance, lender's appraisal, credit report
Systems: heating, central air, furnace, duct work, wiring, security system, sprinklersRefinance fees
Exterior: new roof, new siding, storm windows and doorsImprovements later removed, such as carpet you installed and then replaced
Insulation, water heater, built-in appliances, kitchen modernization, flooring, fireplaceAnything you already deducted as a moving expense

Repairs can count if they were part of a larger remodel. A new water heater counts. Patching the old one doesn't.

A worked example using Sacramento's price index

To show how long ownership changes the answer, I took one example house that sells for $560,000 in 2026 and asked what it would have cost in earlier years if its value had tracked the FHFA house price index for the Sacramento-Roseville-Folsom area exactly. The index stood at 408.95 in the second quarter of 2026. In the first quarter of 1998 it was 104.98, so the 1998 price is $560,000 times 104.98 divided by 408.95, or about $143,800. Same method for the other years.

Then I applied the same example assumptions to every owner: $30,000 of selling expenses, which makes the amount realized $530,000, and $20,000 of improvements added to basis. Real houses don't track an index perfectly, and real owners don't all spend $20,000 on improvements. These are teaching numbers.

Example: gain on a $560,000 sale by year of purchase

Purchase prices back-cast from the FHFA all-transactions index, Q1 of purchase year vs Q2 2026. Assumes $30,000 selling expenses and $20,000 improvements for every owner.

Example ownerGain
Bought 1998 for $143,800$366,200
Bought 2006 for $399,400$110,600
Bought 2012 for $209,200$300,800
Bought 2020 for $399,900$110,100

Source: Index values from FRED series ATNHPIUS40900Q (FHFA), read October 2026; example arithmetic by Arlene Whitcomb. Dashed line: $250,000 exclusion for a single filer.

Example ownerBack-cast purchase priceAdjusted basis (+$20,000)Gain on $530,000 realizedOver the $250,000 single exclusion
Bought 1998$143,800$163,800$366,200$116,200
Bought 2006$399,400$419,400$110,600None
Bought 2012$209,200$229,200$300,800$50,800
Bought 2020$399,900$419,900$110,100None

Two things in that table surprised me when I first ran it. The 2006 buyer and the 2020 buyer paid almost exactly the same price, because the index was 291.66 in early 2006 and 292.05 in early 2020, with a long trough in between. And the owner who bought near that trough in 2012 has a bigger gain than either of them.

A single filer from 1998 would have $116,200 of taxable gain in this example. A married couple filing jointly with the same numbers, both meeting the tests, could exclude all of it, since $366,200 is under $500,000. Same house, same price, different tax return.

What California does with the gain

California follows the federal exclusion. The Franchise Tax Board's sale of home page says the state conforms to the IRS rules, and that gain over $250,000 for an individual, or $500,000 for a qualifying married or registered domestic partner couple, is taxable. If federal and state amounts differ, you file California's Schedule D (540).

What's different is the rate. The FTB's capital gains page is blunt: "California does not have a lower rate for capital gains. All capital gains are taxed as ordinary income." So that $116,200 from the example gets added to the seller's other California income for the year and taxed at whatever bracket it lands in.

The 3 1/3 percent escrow holdback

California also collects in advance. The FTB describes real estate withholding as a prepayment of income tax due on the sale. No withholding is required if the price is $100,000 or less, the property is in foreclosure, or the seller is a bank acting as trustee. You file your exemption by giving Form 593 to escrow before closing.

The standard amount is 3 1/3% of the sale price. On the $560,000 example that's $560,000 divided by 30, or about $18,667, held out of your proceeds and sent to the state. The 2026 Form 593 instructions list the ways out. Line 1 covers a house that qualifies as your principal residence under section 121. Line 2 covers a house that was last used as your main home, without regard to the two-year period, though a house last used as a rental or second home doesn't qualify. Line 3 covers a loss or zero gain, and the instructions warn you can't claim it just because you're getting no cash out of the sale. There's also an alternative calculation that applies a rate from the instructions, 12.3% for an individual, to your estimated gain instead of to the price.

Withholding is a prepayment you claim on your return, not an extra tax. But $18,667 is a lot to float until April if you didn't need to.

Records that make the basis number real

Publication 523 says to keep basis records until three years after the due date of the return for the year you sold. For a house bought in 1998, that means the 1998 closing statement and the receipts for every improvement since. If you receive a Form 1099-S for the sale, Publication 523 says you report it on Form 8949 even when the whole gain is excluded.

The way you sell doesn't change any of this. A listing, or a direct sale to a company you found by searching sell my house fast in Sacramento, goes through the same three steps. A direct sale may have a lower price and lower selling expenses, so run both through the formula. If you're comparing, read about the three steps of a direct sale and then put the numbers in the table above.

Sales near or over the exclusion are where a CPA or enrolled agent earns the fee. Bring them the purchase closing statement, the improvement receipts, and the net sheet. The arithmetic on this page will get you in the neighborhood. A preparer will get you the exact figure.

Arlene Whitcomb kept the books for a small title and escrow office in Carmichael for twenty-two years and still balances her checkbook to the penny. She writes about the numbers on a seller's settlement statement. She is not an accountant, attorney or escrow officer.