Every few months someone on a dev forum posts their debts and asks how to pay them off fastest. Two strategies always come up — the snowball and the avalanche — and the thread turns into an argument over which one is "correct." I got curious enough to actually build a small calculator and run the numbers. Here's the core logic, and what the simulation showed.

The two strategies, one line each

  • Avalanche — pay the minimum on every debt, then throw every spare dollar at the highest-APR debt first. Mathematically minimizes total interest.
  • Snowball — same idea, but target the smallest balance first. Clears whole debts faster, which matters more than most spreadsheets admit.

Everything else is identical: you pay minimums on everything, and each time a debt hits zero you roll its payment onto the next target. The only variable is the order you attack in.

The core simulation

It's a month-by-month loop: accrue interest, pay minimums, then pour whatever's left into the debts in priority order.

def simulate(debts, monthly_budget): debts = [dict(d) for d in debts] months, total_interest = 0, 0.0 while any(d["balance"] > 0.005 for d in debts): months += 1 # 1) accrue one month of interest for d in debts: if d["balance"] > 0: interest = d["balance"] * d["apr"] / 100 / 12 d["balance"] += interest total_interest += interest # 2) pay every minimum budget = monthly_budget for d in debts: if d["balance"] > 0: pay = min(d["min"], d["balance"]) d["balance"] -= pay budget -= pay # 3) extra goes down the list in priority order for d in debts: if budget <= 0: break if d["balance"] > 0: pay = min(budget, d["balance"]) d["balance"] -= pay budget -= pay return months, round(total_interest, 2) 

The only thing that makes it "snowball" or "avalanche" is how you sort the list before passing it in:

debts = [ {"name": "Phone", "balance": 600, "apr": 0, "min": 25}, {"name": "Personal", "balance": 1500, "apr": 9, "min": 55}, {"name": "Credit card", "balance": 8000, "apr": 25, "min": 160}, {"name": "Car", "balance": 11000, "apr": 6, "min": 230}, ] avalanche = sorted(debts, key=lambda d: -d["apr"]) # highest APR first snowball = sorted(debts, key=lambda d: d["balance"]) # smallest balance first print(simulate(avalanche, 750)) # -> (33, ~3565) print(simulate(snowball, 750)) # -> (34, ~4064) 

What the numbers actually say

With a $750/month budget on those four debts:

Method Months to debt-free Total interest
Avalanche 33 ~$3,565
Snowball 34 ~$4,064

So the avalanche is "better" — by about $499 and one month. That's the entire prize the math camp is fighting over.

But log when each debt hits zero and a different story appears: the snowball clears two whole debts in the first six months, while the avalanche finishes nothing for almost two years because it's busy grinding down the big 25% card the whole time.

That's the part a pure interest-minimizer misses. Debt payoff mostly fails on follow-through, not arithmetic — and visible wins are what keep people going. The "optimal" method only wins if you actually finish it.

If you want the non-code version

I wrote the full plain-English guide — the complete month-by-month breakdown, how to choose the method that fits you, and a hybrid that captures most of both — over here: Debt snowball vs. avalanche: which actually saves you more.

Educational content, not financial advice. The code is simplified for clarity — real payoffs have fees, variable rates, and the occasional missed month.