Compound Interest Calculator
calc_interestCalculate the future value of an investment using compound interest. Input principal, annual rate, time, and compounding frequency.
Instructions
Calculate compound interest for investments.
Formula: A = P(1 + r/n)^(nt) Where:
P = principal amount
r = annual interest rate (as decimal)
n = number of times interest compounds per year
t = time in years
Examples: compound_interest(10000, 0.05, 5) # $10,000 at 5% for 5 years → $12,762.82 compound_interest(5000, 0.03, 10, 12) # $5,000 at 3% compounded monthly → $6,744.25
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rate | Yes | Annual interest rate as decimal 0.0-1.0 (e.g. 0.05 = 5%). If entering a percentage, divide by 100 first. | |
| time | Yes | Investment time in years (must be > 0), e.g. 10.0 | |
| principal | Yes | Initial investment amount in dollars (must be > 0), e.g. 1000.0 | |
| compounds_per_year | No | Compounding frequency per year (must be > 0): 12=monthly, 365=daily |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rate | Yes | ||
| time | Yes | ||
| topic | Yes | ||
| formula | Yes | ||
| principal | Yes | ||
| difficulty | Yes | ||
| final_amount | Yes | ||
| total_interest | Yes | ||
| compounds_per_year | Yes |