sell · taxes

Capital gains tax when you sell a home in Massachusetts

The federal exclusion, how Massachusetts taxes gains, and what to bring to your tax professional before you list.

The short answer

If the home was your main residence for two of the last five years, you can usually exclude up to $250,000 of gain from federal tax ($500,000 if married filing jointly), and Massachusetts generally follows the same exclusion. Gain above that may be taxed by both. This page is general information, not tax advice. Talk to a CPA before you list.

How the gain is figured

Sale priceWhat the buyer pays
minus selling costsCommission, deed excise, attorney and other costs of sale
minus adjusted basisWhat you paid, plus certain purchase costs and capital improvements
= gainBefore any exclusion

Capital improvements are things that add value or extend the life of the home: an addition, a new roof, a kitchen renovation, new windows. Keep the receipts for as long as you own the home.

The home sale exclusion

  • Up to $250,000 of gain for a single filer, $500,000 for married couples filing jointly.
  • You must have owned and lived in the home as your main residence for at least two of the five years before the sale. The two years do not have to be continuous.
  • Generally usable once every two years.
  • A partial exclusion may be available if you sell early because of a job change, health or certain other events.

How Massachusetts treats the gain

Massachusetts generally follows the federal home sale exclusion. Taxable gain is then taxed by the state: long-term gains at 5% and short-term gains (held one year or less) at 8.5%. A 4% surtax applies to total taxable income above $1,107,750 for tax year 2026 (the threshold is adjusted each year), which a large taxable gain can trigger in the year of sale.

Situations to bring to a CPA

  • Gain above the exclusion, especially if it could push your income over the surtax threshold
  • A home you rented out, used for business, or depreciated
  • A second home or investment property, including a 1031 exchange
  • Inherited property (basis rules are different)
  • Divorce, a death in the family, or a trust that holds the property

Timing matters. Selling in January instead of December can change which tax year the gain falls into. Have the conversation before you choose a list date.

Sources

Questions this page answers

Do I pay capital gains tax when I sell my house in Massachusetts?

Often not on a main home. Federal law lets you exclude up to $250,000 of gain, or $500,000 for married couples filing jointly, if you owned and lived in the home for at least two of the five years before the sale. Massachusetts generally follows that exclusion. Gain above it, or on a second home or rental, can be taxed. Confirm your situation with a CPA.

What is the Massachusetts capital gains tax rate on real estate?

Long-term gains (assets held more than one year) are generally taxed at 5%, and short-term gains at 8.5%. The 4% surtax on taxable income above $1,107,750 (tax year 2026) can also apply. Rates and thresholds change, so check with a tax professional for the year you sell.

Does the Massachusetts millionaires tax apply to a home sale?

It can. The 4% surtax applies to total taxable income above an annual threshold ($1,107,750 for tax year 2026, adjusted each year). A large taxable gain can push income over it in the year of sale. Gain excluded under the home sale exclusion is not counted as taxable income.

How do I lower my taxable gain?

Your gain is the sale price minus selling costs and your adjusted basis. Basis includes what you paid plus the cost of capital improvements, such as a new roof or addition. Keep receipts. Routine repairs generally do not count.

What if I rented the house out?

Rental periods and depreciation change the math. Depreciation you took, or could have taken, is generally taxed when you sell, and the exclusion may be reduced. This is a CPA question.