Savings Calculator Formula

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

Formulas Used

Future Value

future_value = initial_deposit * pow(1 + monthly_rate, num_months) + monthly_contribution * (pow(1 + monthly_rate, num_months) - 1) / monthly_rate

Total Contributions

total_contributions = initial_deposit + monthly_contribution * num_months

Interest Earned

total_interest_earned = future_value - total_contributions

Variables

VariableDescriptionDefault
initial_depositInitial Deposit(USD)5000
monthly_contributionMonthly Contribution(USD)200
annual_rateAnnual Interest Rate(%)4.5
yearsTime Period(years)10
monthly_rateDerived value= annual_rate / 12 / 100calculated
num_monthsDerived value= years * 12calculated

How It Works

How Savings Growth Is Calculated

This calculator uses the compound interest formula with regular contributions:

FV = P(1+r)^n + PMT × [(1+r)^n - 1] / r

Where P = initial deposit, PMT = monthly contribution, r = monthly rate, n = total months.

Worked Example

$5,000 initial deposit with $200/month at 4.5% APY for 10 years.

initial_deposit = 5000monthly_contribution = 200annual_rate = 4.5years = 10
  1. 01Monthly rate = 4.5% / 12 = 0.375%
  2. 02Months = 10 × 12 = 120
  3. 03Initial deposit grows to: $5,000 × 1.00375^120 = $7,834
  4. 04Contributions grow to: $200 × (1.00375^120 - 1) / 0.00375 = $30,038
  5. 05Future value = $7,834 + $30,038 = $37,872
  6. 06Total contributed = $5,000 + $24,000 = $29,000
  7. 07Interest earned = $37,872 - $29,000 = $8,872

Ready to run the numbers?

Open Savings Calculator