I created this calculator when I was paying off my school loans, based off the derivation here. If you want to see the code that runs it, most browsers will let you inspect the source of this page.

Enter the necessary information about your loans. Then enter how much bonus payment you can make, and press 'Calculate'. For Rate of Compounding, School loans through the Department of Education compound daily, I think most other loans compound monthly.

Loan Principal Interest Rate Monthly Payment Rate of Compounding
Bonus Payment:

Note: You must have JavaScript enabled for this calculator to function.