Student loans are typically extremely difficult, but not impossible, to discharge in bankruptcy. To do so, you must show that payment of the debt “will impose an undue hardship on you and your dependents.”
If you can successfully prove undue hardship, your student loan will be completely canceled, in bankruptcy.
Historically the most common test is the Brunner test which requires a showing that
1) the debtor cannot maintain, based on current income and expenses, a “minimal” standard of living for the debtor and the debtor’s dependents if forced to repay the student loans
2) additional circumstances exist indicating that this state of affairs is likely to persist for a significant portion of the repayment period of the student loans
3) the debtor has made good faith efforts to repay the loans.
(Brunner v. New York State Higher Educ. Servs. Corp., 831 F. 2d 395 (2d Cir. 1987). Most, but not all, courts use this test.
The courts and decisions have changed since this 1987 court decision and some courts have begun to question whether they should use a different standard. For now, most federal courts of appeal have adopted the Brunner test, but the law in this area is changing.