Notation
- P is the deposit (principal).
- r is the nominal annual interest rate (APR), as a decimal: 4.00% is 0.04.
- APY is the annual percentage yield, as a decimal.
- n is the number of compounding periods per year.
- t is the time in years: months ÷ 12, or days ÷ 365.
- A is the amount withdrawn early, m a number of months and d a number of days of interest.
Balance and interest
From an interest rate (APR) and a compounding frequency:
FV = P × (1 + r/n)n·t
From an APY, the compounding frequency is already built in:
FV = P × (1 + APY)t
Interest is FV − P. The month-by-month schedule uses the same formula with t = k ÷ 12 for month k, plus a final part-month row when the term is set in days.
Compounding frequencies
Daily compounding uses n = 365, monthly n = 12, quarterly n = 4 and annually n = 1.
APY and APR
Interest rate to APY:
APY = (1 + r/n)n − 1
APY back to an interest rate:
r = n × ((1 + APY)1/n − 1)
When you enter an APY, results use the APY balance formula and show the equivalent APR for the compounding you choose. When you enter an APR, results use the APR balance formula and show the APY.
APY from interest paid
This is the formula US institutions use for APY disclosures, where I is the interest paid over a number of days:
APY = (1 + I/P)365/days − 1
Early withdrawal penalties
A penalty set in months of interest:
Penalty = A × r/12 × m
A penalty set in days of interest:
Penalty = A × r × d/365
If you enter an APY, it is first converted to an interest rate with the formula above. Interest earned so far uses the balance formula for the months held. For a full withdrawal, you would receive the deposit plus the interest earned so far, minus the penalty. For a partial withdrawal, the penalty is applied to the amount you take out, and you receive that amount minus the penalty; the rest stays in the CD and keeps earning at its rate. When the penalty is larger than the interest earned, the difference would come out of the deposit; some institutions do this, and the calculator shows it as a red line.
If the penalty exceeds the amount withdrawn, the result shows $0 received; we don't model penalties beyond that.
Interest paid out
When interest is paid out each month instead of being added to the CD, it does not compound:
I = P × r × t
The amount per month is P × r/12.
CD ladders
Each rung uses the APY balance formula for its own term. Total interest is the sum of each rung's interest, and the total returned is the sum of each rung's value at maturity. Rungs are held to maturity, with no reinvestment.
Blended APY = Σ(amounti × APYi) ÷ Σ amounti
This is an amount-weighted simple average. It is a summary figure, not a yield.
Rounding and limits
Every calculation uses full double-precision numbers. Rounding happens only for display: money to the cent, rates to 3 decimal places on the page and 4 in the test cases.
- Deposit: $1 to $100,000,000.
- Rate: 0% to 30%; 0% is allowed.
- Term: 1 to 120 months, or 1 to 3,650 days.
- Penalty: 0 to 60 months, or 0 to 1,825 days, of interest.
- Months held must not be more than the term.
Input outside these limits shows a message next to the field instead of a result.
Test cases
Every number below is checked automatically against the same script the calculators run. Rates are example rates only. Tolerance is ±$0.005 on money and ±0.00005 on rates.
| ID | Input | Expected |
|---|---|---|
| H-daily | P=10000, 4.00% APR, daily, 12 mo → FV | 10,408.08 |
| H-monthly | P=10000, 4.00% APR, monthly, 12 mo → FV | 10,407.42 |
| H-quarterly | P=10000, 4.00% APR, quarterly, 12 mo → FV | 10,406.04 |
| H-annually | P=10000, 4.00% APR, annually, 12 mo → FV | 10,400.00 |
| H-apy12 | P=10000, 4.00% APY, 12 mo → FV | 10,400.00 |
| H-apy60 | P=5000, 4.00% APY, 60 mo → FV | 6,083.26 |
| H-apy60i | P=5000, 4.00% APY, 60 mo → interest | 1,083.26 |
| H-100k | P=100000, 4.00% APY, 12 mo → interest | 4,000.00 |
| H-6mo-apy | P=10000, 4.00% APY, 6 mo → interest | 198.04 |
| H-days | P=10000, 4.00% APY, 182 days → interest | 197.49 |
| H-zero | P=10000, 0% rate, 12 mo → FV | 10,000.00 |
| I-m6 | P=10000, 4.00% APR monthly, 6 mo → interest | 201.67 |
| I-d24 | P=25000, 4.50% APR daily, 24 mo → interest | 2,354.21 |
| I-q36 | P=10000, 4.00% APR quarterly, 36 mo → interest | 1,268.25 |
| I-simple | P=10000, 4.00% APR paid out monthly (no compounding), 12 mo → total interest | 400.00 |
| I-payout | P=10000, 4.00% APR paid out monthly → per month | 33.33 |
| I-m1 | P=10000, 4.00% APR monthly compounding → month-1 interest | 33.33 |
| I-avg | P=10000, 4.00% APY 12 mo → avg interest per month | 33.33 |
| P-earn6 | P=10000, 4.00% APR monthly, withdraw at 6 mo → interest earned | 201.67 |
| P-pen3 | penalty 3 months of interest (P*r/12*3) | 100.00 |
| P-net | net interest after penalty | 101.67 |
| P-recv | amount received | 10,101.67 |
| P-earn2 | same CD, withdraw at 2 mo → interest earned | 66.78 |
| P-pen6 | penalty 6 months of interest | 200.00 |
| P-recv2 | amount received (principal cut) | 9,866.78 |
| P-d90 | P=10000, 4.00%, penalty 90 days of interest | 98.63 |
| P-part | partial: withdraw 4000 of 10000, 4.00%, 3 months → penalty on 4000 | 40.00 |
| P-be | break-even months to recover 3-mo penalty (P=10000, 4.00%) = 3 | 3 |
| P-cap-full | P=10000, 30.00% APR monthly, 60-mo term, held 0, penalty 60 months (15,000 > balance) → amount received | 0.00 |
| P-cap-part | partial: withdraw 4000 of 10000, 30.00% APR monthly, 60-mo term, held 0, penalty 60 months on 4000 (6,000 > 4,000) → amount received | 0.00 |
| L-1 | rung 1: 5000 at 3.50% APY, 12 mo → value | 5,175.00 |
| L-2 | rung 2: 5000 at 3.75% APY, 24 mo → value | 5,382.03 |
| L-3 | rung 3: 5000 at 4.00% APY, 36 mo → value | 5,624.32 |
| L-4 | rung 4: 5000 at 4.10% APY, 48 mo → value | 5,871.82 |
| L-5 | rung 5: 5000 at 4.20% APY, 60 mo → value | 6,141.98 |
| L-tot | ladder total interest (no reinvestment) | 3,195.16 |
| L-total-value | ladder total value at each maturity summed | 28,195.16 |
| A-daily | 4.00% APR daily → APY | 4.0808% |
| A-monthly | 4.00% APR monthly → APY | 4.0742% |
| A-quarterly | 4.00% APR quarterly → APY | 4.0604% |
| A-annually | 4.00% APR annually → APY | 4.0000% |
| A-5000 | 4.00% APY on 5000 for 1 year → interest | 200.00 |
| A-tisa | P=10000, interest 200 over 182 days → APY (TISA) | 4.0513% |
| A-tisa365 | P=10000, interest 400 over 365 days → APY | 4.0000% |
| R-daily | 4.00% APY → APR daily | 3.9223% |
| R-monthly | 4.00% APY → APR monthly | 3.9285% |
| R-quarterly | 4.00% APY → APR quarterly | 3.9414% |
| R-annually | 4.00% APY → APR annually | 4.0000% |
| R-round | round trip 5.00% APR monthly → APY → APR | 5.0000% |
| ID | Input | Expected |
|---|---|---|
| V-1 | Rate left empty | No result; the message “Enter the rate from your account disclosure” |
| V-2 | Rate 31% | The message “Rate must be 0–30%” |
| V-3 | Months held more than the term | An error message; no result |
| V-4 | Deposit 0 or negative | An error message; no result |
| V-5 | Any input | The output never shows “NaN” or “Infinity” |
What we do not model
Taxes, fees, variable or step-up rates, reinvestment at maturity, and leap years (days are divided by 365). Add-on CDs with regular extra deposits are not covered.