When you bought your home, you may have paid settlement fees or closing costs in addition to the contract price of the property. Generally speaking, closing costs are not allowable as a deduction on your return. They are an increase in your basis or cost of the property to you. When you sell the property your basis may be adjusted which results in a smaller gain on the sale of the property.
An exception to this may be related to points (discount points or loan origination fees) paid at closing. In the Q&A for Itemized Deductions, there is a specific interview that will assist you with determining if your points are deductible and over what period of time they are deductible.
Deductible fees are limited to home mortgage interest, mortgage insurance premiums, and certain real estate taxes, which are itemized deductions on Schedule A (Form 1040) Itemized Deductions.
Per IRS Publication 551 Basis of Assets, starting on page 2:
Settlement costs. Your basis includes the settlement fees and closing costs for buying property. You can't include in your basis the fees and costs for getting a loan on property. A fee for buying property is a cost that must be paid even if you bought the property for cash.
The following items are some of the settlement fees or closing costs you can include in the basis of your property.
Settlement costs don't include amounts placed in escrow for the future payment of items such as taxes and insurance.
The following items are some settlement fees and closing costs you can't include in the basis of the property.
Real estate taxes. If you pay real estate taxes the seller owed on real property you bought, and the seller didn't reimburse you, treat those taxes as part of your basis. You can't deduct them as taxes.
If you reimburse the seller for taxes the seller paid for you, you can usually deduct that amount as an expense in the year of purchase. don't include that amount in the basis of the property. If you didn't reimburse the seller, you must reduce your basis by the amount of those taxes.
For additional information, please see the following publications:
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the document at the time it is accessed.