The core formula is A = P (1 + r/n)^(n·t), where P is principal, r is the annual rate, n is compounding periods per year, and t is years. More frequent compounding (monthly, daily) beats annual compounding at the same nominal rate.
Compound interest is why starting to invest 10 years earlier often matters more than earning a percentage point more return — time is the biggest multiplier in the formula.
It cuts both ways: credit card balances that compound daily can double in under a decade at 20 % APR. Debt calculators use the same math with the sign flipped.