Compound Interest

Calculate compound interest with a year-by-year breakdown. Supports any compounding frequency — annual, monthly, daily.

⚡ 1 credit per call

Try it

Fill in the fields below and hit Send.

Why use this

LLMs struggle with precise financial calculations. Use this for accurate compound interest projections with a full year-by-year breakdown.

Input

Field Type Required Description
principal number Initial investment amount
annual_rate_pct number Annual interest rate as a percentage (e.g. 5 for 5%)
years number Number of years to calculate (1–100)
compounds_per_year number How many times interest compounds per year (default: 12 for monthly)

Response

Field Type Description
final_amount number Balance at end of term
total_interest number Total interest earned
year_by_year array Per-year breakdown of balance and interest earned

API Reference

Endpoint

POST https://api.lightningapi.tools/compound-interest

Required headers

Authorization: Bearer <apiKey>
Content-Type: application/json

Example request

{
  "principal": 1000,
  "annual_rate_pct": 5,
  "years": 10,
  "compounds_per_year": 12
}

Example response

{
  "final_amount": 1647.01,
  "total_interest": 647.01,
  "year_by_year": [
    { "year": 1, "balance": 1051.16, "interest_earned": 51.16 },
    { "year": 2, "balance": 1104.94, "interest_earned": 53.78 },
    ...
  ]
}