In most cases the bankruptcy discharge is tax free. Outside of bankruptcy, any discharge of indebtedness is taxed as income. For example, if you settle a $10,000 for $5,000, then you can be taxed on the $5,000 that the creditor forgave. Many creditors will send a 1099 form to the debtor and to the IRS so that the IRS knows to collect income taxes from the debtor.
The bankruptcy discharge is given this special treatment because Congress knows that people who file for bankruptcy do not have lots of money to pay taxes, so it would be unfair to give them a big tax bill right after they file for bankruptcy. It is not uncommon to discharge $50,000 of debt in a bankruptcy, but the income taxes on that could easily be $10,000. No one who just filed for bankruptcy could afford that tax bill, so people wouldn't get the fresh start which bankruptcy relief is designed to provide.
Other types of debt forgiveness that can create big tax bills include: foreclosures, short sales, and any settlement with a creditor for less than the full balance of the debt. Since debts to the IRS are often not dischargeable in bankruptcy, it is often better to file bankruptcy and be done with the debt than it is to settle the debts. If you settle the debts, then you might be trading regular debts for IRS and state tax debts.
The IRS is more dangerous than other creditors because the IRS can place tax liens, and take future tax refunds to satisfy their debts and use traditional debt collection actions such as wage garnishment, and bank levy. Tax debts are also much more difficult to discharge in bankruptcy, often requiring that you wait 3 years or more before they can be discharged.
Because settling a debt often has the effect of trading a regular creditor for the IRS, it is wise to check with a bankruptcy attorney and maybe even an accountant to figure out how to lower your debt without owing lots of money to the IRS before agreeing to a settlement with a creditor.
This article does not constitute taxadvice or legal advice. This is a short overview of a complicated topic, and the rules mentioned here may not apply to every taxpayer or debtor.
Please consult personally with experienced professionals to get personalized legal advice before making important financial decisions.