When you sell your primary home in Massachusetts, the state taxes the profit at 5% for long-term gains, but only on the portion left after the federal Section 121 exclusion of $250,000 for single filers or $500,000 for married couples filing jointly. Because Massachusetts honors that exclusion in full, most home sales generate no state tax at all. Sales that clear the exclusion face the 5% rate, and if your total taxable income for the year crosses $1,083,150 in 2025, an additional 4% surtax applies to the excess.1Mass.gov. Massachusetts Tax Rates2Mass.gov. Massachusetts 4% Surtax on Taxable Income
The Exclusion That Eliminates Most Sellers’ Tax
Section 121 of the Internal Revenue Code shelters the first $250,000 of gain on the sale of a principal residence, or $500,000 for a married couple filing jointly. Massachusetts conforms to this exclusion dollar for dollar, so whatever you exclude on your federal return, you also exclude on your state return.
To qualify for the full amount, you need to pass two tests within the five years before the sale. You must have owned the home for at least two of those five years, and you must have lived in it as your primary residence for at least two of those five years. The ownership and use periods don’t have to line up, but each must total at least 24 months. For the $500,000 joint exclusion, only one spouse needs to meet the ownership test, but both must meet the use test.3Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Partial Exclusion for Early Sales
Sell before the two-year mark and you may still get a prorated exclusion, provided the sale was driven by a job relocation, a health issue, or an unforeseeable event. The IRS divides the months you owned and used the home by 24, then multiplies by $250,000 or $500,000. A single filer who sells after 12 qualifying months, for example, gets a $125,000 exclusion.
Qualifying job relocations generally require your new workplace to be at least 50 miles farther from the home than your old one. Health-related moves cover situations where you moved to get treatment or to care for a family member. Unforeseeable events include divorce, job loss, natural disasters, and multiple births from the same pregnancy.4Internal Revenue Service. Publication 523 (2025), Selling Your Home
Figuring the Taxable Gain
Your gain is the difference between what you netted from the sale (the amount realized) and your adjusted basis in the property. Both sides of that calculation have room for legitimate reductions that shrink the taxable number.
Amount Realized
Take the sale price and subtract your selling expenses: real estate commissions, legal fees, advertising, transfer taxes you paid as the seller, and any loan charges you covered that would normally have been the buyer’s. A home that sold for $900,000 with $50,000 in commissions and closing costs produces an amount realized of $850,000.4Internal Revenue Service. Publication 523 (2025), Selling Your Home
Adjusted Basis
Basis starts with what you originally paid, including settlement costs at purchase like title insurance, recording fees, survey fees, and transfer taxes. Then you add capital improvements made during ownership: projects that add value, extend the home’s useful life, or adapt it to a new use.
- Additions such as bedrooms, bathrooms, decks, garages, and porches
- Major systems including central air, heating replacements, security systems, and updated wiring
- Exterior work such as a new roof, siding, insulation, or storm windows
- Interior remodels covering kitchens, flooring, built-in appliances, and fireplaces
- Grounds work including landscaping, driveways, fencing, retaining walls, and pools
Routine repairs don’t count unless they were part of a larger remodel. Replacing one broken window is a repair; replacing every window in the house is an improvement. You must also reduce basis by any depreciation claimed while part of the home was used as a rental or home office.4Internal Revenue Service. Publication 523 (2025), Selling Your Home Original cost plus improvements minus depreciation gives you the adjusted basis. Subtract that from your amount realized, and the result is the gain that gets measured against the exclusion.
Losses on the sale of a personal residence aren’t deductible for either federal or Massachusetts purposes. The home is personal-use property, so a loss doesn’t produce a tax benefit.
The Massachusetts Rate on What’s Left
Whatever gain remains after the exclusion flows onto your Massachusetts return. The rate depends on how long you owned the home.
Long-Term Gains
Held the home for more than a year? The gain above the exclusion is taxed at the flat 5% personal income tax rate. This covers almost every primary residence sale, since most owners are in the property for years before selling.1Mass.gov. Massachusetts Tax Rates
Short-Term Gains
Sell within a year of buying, and the gain is short-term, taxed at 8.5%. The rate was 12% before it was reduced starting with tax year 2023.5Massachusetts Department of Revenue. Differences Between MA and Federal Tax Law for Personal Income A quick sale also means you probably won’t hit the two-year mark for the full federal exclusion, though a partial exclusion can apply if the move was driven by a qualifying reason.
The 4% Surtax on High-Income Years
This is the piece that surprises sellers with large gains. Starting in 2023, Massachusetts imposes an additional 4% surtax on taxable income above an annually adjusted threshold. For tax year 2025 the threshold is $1,083,150. The 2026 figure will be inflation-adjusted but has not yet been published.2Mass.gov. Massachusetts 4% Surtax on Taxable Income
Capital gains from a home sale count toward that threshold. There’s no carve-out for real estate. If your total taxable income for the year, including the taxable slice of your home sale, exceeds the threshold, you owe an extra 4% on every dollar above it.
Consider a married couple with $200,000 in ordinary income. If they sell and end up with a $900,000 gain after the $500,000 exclusion, their total taxable income is $600,000, well below the threshold, and no surtax applies. Change the gain to $1,200,000 after exclusion, though, and total income jumps to $1,400,000. On top of 5% on the full gain, they’d owe 4% on roughly $317,000, adding about $12,700 to the bill.
Non-Residents Selling Massachusetts Property
A full-year resident owes Massachusetts tax on gains from property sold anywhere. A non-resident who sells a home located in Massachusetts also owes Massachusetts tax, because real property in the state is treated as Massachusetts-source income. Part-year residents who move in or out during the year of sale report the full gain on any Massachusetts home they sell.6Massachusetts Department of Revenue. Filing and Withholding Rules: Real Estate Sales of $1 Million or More
Withholding on Sales of $1 Million or More
Non-residents selling Massachusetts real estate for $1 million or more face mandatory withholding at closing. The default is 4% of the gross sale price. If the seller gives the closing agent a signed Transferor’s Certification, the withholding can instead be calculated at 5% of the estimated net gain, which usually holds back much less. When either figure crosses the surtax threshold, an additional 4% is withheld on the excess. Without the certification, the closing agent must withhold at the default rate on the full sale price. The amount withheld is credited against your actual Massachusetts tax when you file, and anything over what you owe comes back as a refund.6Massachusetts Department of Revenue. Filing and Withholding Rules: Real Estate Sales of $1 Million or More
The Deeds Excise at Closing
The deeds excise is separate from the income tax on your gain. Massachusetts charges this transfer tax every time real property changes hands, at $2.28 per $500 of sale price statewide, which works out to $4.56 per $1,000. On a $700,000 sale, that’s about $3,192. Barnstable County applies a higher rate. The seller customarily pays at closing, and the amount counts as a selling expense when you calculate your gain.7Mass.gov. Directive 89-14: Exchange of Property
Reporting the Sale
You still report the sale on your federal return even when the exclusion wipes out the whole gain. List the transaction on Form 8949 with the sale price and adjusted basis, and record the exclusion as a negative adjustment. Totals carry to Schedule D and then to Form 1040.8Internal Revenue Service. Instructions for Form 8949 (2025)
For Massachusetts, full-year residents file Form 1 and report the gain on Schedule D. Non-residents and part-year residents use Form 1-NR/PY. You report the full gain, then subtract the applicable exclusion on the designated line. The taxable remainder is taxed at 5% or 8.5% depending on holding period, and if your total taxable income tops the surtax threshold, you calculate and report the extra 4% as well.1Mass.gov. Massachusetts Tax Rates