Loan Forgiveness Calculator Formula

Understand the math behind the loan forgiveness calculator. Each variable explained with a worked example.

Formulas Used

Estimated Amount Forgiven

forgiven_amount = original_balance * pow(1 + monthly_rate, payments_made) - monthly_payment * (pow(1 + monthly_rate, payments_made) - 1) / monthly_rate

Total Amount Paid

total_paid_out = total_paid

Qualifying Payments Remaining

payments_remaining = max(0, 120 - payments_made)

Variables

VariableDescriptionDefault
original_balanceOriginal Loan Balance ($)60000
annual_rateAnnual Interest Rate (%)6
monthly_paymentMonthly IDR Payment ($)350
payments_madeQualifying Payments Made120
total_paidDerived value= monthly_payment * payments_madecalculated
monthly_rateDerived value= annual_rate / 100 / 12calculated

How It Works

How Public Service Loan Forgiveness Works

PSLF forgives remaining balance after 120 qualifying payments (10 years) while working for a qualifying employer.

Remaining Balance Formula

Balance after N payments = Original x (1+r)^N - Payment x ((1+r)^N - 1) / r

The remaining balance after 120 payments is the amount forgiven. Under IDR plans, payments are based on income rather than loan amount.

Worked Example

A $60,000 loan at 6% with $350/month IDR payments for 120 months.

original_balance = 60000annual_rate = 6monthly_payment = 350payments_made = 120
  1. 01Monthly rate = 6% / 12 = 0.5%
  2. 02Balance growth = $60,000 x (1.005)^120 = $109,164
  3. 03Payments factor = $350 x ((1.005)^120 - 1) / 0.005 = $57,439
  4. 04Remaining balance = $109,164 - $57,439 = $51,725 (forgiven)
  5. 05Total paid = $350 x 120 = $42,000

Ready to run the numbers?

Open Loan Forgiveness Calculator