compound interest
compound_interestCalculates compound interest growth over time using the formula A = P(1 + r/n)^(nt). Given a principal, annual rate, duration in years, and compounding frequency, returns the future value, total interest earned, effective annual rate (APY), and a year-by-year growth schedule. Supports optional recurring monthly contributions for savings projections. Works for savings accounts, CDs, investment returns, and retirement planning. Currency-agnostic.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| years | Yes | Investment duration in years. Max 100. | |
| principal | Yes | Initial investment or deposit amount (any currency unit). | |
| annual_rate_pct | Yes | Annual interest rate as a percentage (e.g., 5.5 for 5.5%). | |
| compounds_per_year | No | How often interest compounds per year. Allowed: 1 (annually), 2 (semi-annually), 4 (quarterly), 12 (monthly), 52 (weekly), 365 (daily). Defaults to 12. | |
| monthly_contribution | No | Optional recurring monthly contribution added at each month. Defaults to 0. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schedule | Yes | Year-by-year growth schedule. | |
| future_value | Yes | Final balance after all compounding and contributions. | |
| total_interest | Yes | Total interest earned over the full period. | |
| total_contributions | Yes | Total of all contributions (principal + recurring). | |
| effective_annual_rate_pct | Yes | Effective annual rate accounting for compounding frequency (APY). |