How to use this calculator
- Enter Balance of debt A ($)。
- Enter APR of debt A (%)。
- Enter Balance of debt B ($)。
- Enter APR of debt B (%)。
Leave any field blank and the calculator solves for it from the remaining values — every quantity is reversible.
The calculator then returns: Total interest, highest-rate first。
What is it
Debt Payoff Comparison — Enter Balance of debt A, APR of debt A, Balance of debt B and APR of debt B to get Total interest, highest-rate first — or leave any field blank to solve for it. Loan and interest calculators model the relationship between principal, rate, term and payment, so you can judge the true cost of borrowing. The core question it answers is: Total interest, highest-rate first. With Balance of debt A = 5,000 $, APR of debt A = 22 % and Balance of debt B = 9,000 $, Total interest, highest-rate first is 3,239 $.
Formula
| Variable | Inputs | Unit |
|---|---|---|
debtA | Balance of debt A | $ |
rateA | APR of debt A | % |
debtB | Balance of debt B | $ |
rateB | APR of debt B | % |
totalInterest | Total interest, highest-rate first | $ |
(function () { var hi, hr, lo, lr; if (rateA >= rateB) { hi = debtA; hr = rateA; lo = debtB; lr = rateB; } else { hi = debtB; hr = rateB; lo = debtA; lr = rateA; } var pay = 400, interest = 0, m = 0; while ((hi > 0 || lo > 0) && m < 1200) { var i1 = hi * hr / 100 / 12, i2 = lo * lr / 100 / 12; interest += i1 + i2; hi = Math.max(0, hi + i1 - pay); if (hi === 0) lo = Math.max(0, lo + i2 - pay); m++; } return interest; })()The relationship is solved in every direction, so any one unknown field can be derived.
Worked example
Using the default inputs:
- Balance of debt A = 5000 $
- APR of debt A = 22 %
- Balance of debt B = 9000 $
- APR of debt B = 12 %
Formula used: (function () { var hi, hr, lo, lr; if (rateA >= rateB) { hi = debtA; hr = rateA; lo = debtB; lr = rateB; } else { hi = debtB; hr = rateB; lo = debtA; lr = rateA; } var pay = 400, interest = 0, m = 0; while ((hi > 0 || lo > 0) && m < 1200) { var i1 = hi * hr / 100 / 12, i2 = lo * lr / 100 / 12; interest += i1 + i2; hi = Math.max(0, hi + i1 - pay); if (hi === 0) lo = Math.max(0, lo + i2 - pay); m++; } return interest; })()
Answer:
- Total interest, highest-rate first = 3,238.66 $
Example 1 (default inputs):Suppose Balance of debt A = 5,000 $, APR of debt A = 22 %, Balance of debt B = 9,000 $, APR of debt B = 12 %; then giving Total interest, highest-rate first = 3,239 $.
Example 2 (one input changed):If you change Balance of debt A to 7,500,giving Total interest, highest-rate first = 5,092 $.
Additional information
Assumptions and limitations
- Real loan contracts often add origination fees, insurance, prepayment penalties and variable-rate clauses. These calculators implement the standard amortisation formula and exclude such add-on costs.
- Good for: getting a directionally correct order of magnitude quickly, or comparing two scenarios.
- Not good for: using it as the sole basis for a decision, or for official filings, contract pricing and legal documents — those need a full model with your actual clauses and local rules.