A mortgage foreclosure may also have federal income tax consequences. One issue is "discharge of indebtedness income." This can be understood as the IRS's attempt to tax you on money you were loaned but are not going to repay. The mortgage lender may be required to report the amount of the cancelled debt to you and the IRS on a Form 1099-C, Cancellation of Debt. Fortunately though there are various exceptions to this rule and even a recently added exception.
One of the exceptions to discharge of indebtedness income is if the mortgage debt is discharged in bankruptcy, including under chapter 7 or under chapter 13. In order to take advantage of this exception, it may be important to file for bankruptcy before the foreclosure sale.
Another exception to discharge of indebtedness income is the insolvency exception. That means if you are insolvent when the debt is cancelled, some or all of the cancelled debt may not be taxable to you. Insolvency generally means that your total debts are more than the fair market value of your total assets.
The new exception if the Mortgage Forgiveness Debt Relief Act of 2007 which generally allows people to exclude certain discharge of indebtedness from the foreclosure or mortgage restructuring on their principal residence. This new provision applies to debt forgiven in 2007, 2008 or 2009. Up to $2 million of forgiven debt is eligible for this exclusion ($1 million if married filing separately).
An applicable form is Form 982, "Reduction of Tax Attributes Due to Discharge of Indebtedness (and Section 1082 Basis Adjustment).