Finance Utilities

Compound Interest

Calculate compound interest with precision using principal, rate, time, and compounding frequency. Available via MCP in Cursor and other AI editors, or REST API at `/v1/finance/compound-interest`. Input $1000 at 5% annually for 10 years, get exact future value calculations. Returns both final amount and interest earned separately.

API Endpoint

GET /v1/finance/compound-interest

Code Examples

curl "https://tinyfn.io/v1/finance/compound-interest" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/finance/compound-interest', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/finance/compound-interest',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's finance tools:

{
  "mcpServers": {
    "tinyfn-finance": {
      "url": "https://tinyfn.io/mcp/finance",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I calculate compound interest with different compounding frequencies?

Specify the compounding frequency (annual, quarterly, monthly, daily) along with principal, interest rate, and time period. The tool applies the standard compound interest formula A = P(1 + r/n)^(nt).

Can AI agents use this for financial modeling in MCP-enabled editors?

Yes, Claude Code, Cursor, and other MCP clients can call this tool to perform accurate compound interest calculations for investment scenarios, loan analysis, or financial projections without approximation errors.

What's the difference between simple and compound interest calculation?

Simple interest calculates on principal only, while compound interest includes interest earned on previous interest. This tool specifically handles the compounding effect with configurable frequencies.

Does the compound interest calculator handle fractional years?

Yes, the tool accepts decimal time periods like 2.5 years or 18 months (1.5 years) and calculates proportional compound growth accurately.

What format does the compound interest API return?

Returns JSON with final amount, total interest earned, principal amount, effective rate, and calculation details. All monetary values are precise decimals, not rounded approximations.

Try Compound Interest Now

Get your free API key and start using Compound Interest in seconds.

Get Free API Key