Skip to content

FI Calculator Guide

The FI Calculator is one of IndepAI’s most powerful tools. It calculates your path to Financial Independence based on your income, expenses, savings, and expected returns.

The FI Calculator uses the following formula:

FI Number = Annual Expenses × FI Multiplier

Where the FI Multiplier is typically 25 (based on the 4% safe withdrawal rate):

FI Multiplier = 100 / Withdrawal Rate = 100 / 4 = 25

To calculate years to FI, we use compound growth:

Years to FI = ln((FI Number × r + Savings) / (Current × r + Savings)) / ln(1 + r)

Where r is the real return rate (nominal return - inflation).

Terminal window
curl -X POST https://indepai.app/api/v1/calculator \
-H "Content-Type: application/json" \
-d '{
"currentAge": 30,
"annualIncome": 80000,
"annualExpenses": 40000,
"currentSavings": 100000
}'
Parameter Type Required Default Description
currentAge number Yes - Your current age (18-100)
annualIncome number Yes - Gross annual income
annualExpenses number Yes - Total annual expenses
currentSavings number Yes - Current invested assets
targetWithdrawalRate number No 4 Safe withdrawal rate (%)
expectedReturn number No 7 Expected annual return (%)
inflationRate number No 2 Expected inflation rate (%)
email string No - Email to associate with calculation
saveResult boolean No true Save for analytics
Field Description
fiNumber Target amount needed for FI
yearsToFI Years until FI is reached
fiAge Age when you’ll reach FI
fiDate Projected FI date (ISO 8601)
savingsRate Current savings rate (%)
monthlySavings Monthly savings amount
annualSavings Annual savings amount
currentProgress Current progress toward FI (%)
yearlyProjections Year-by-year wealth projections

For early retirement (more conservative 3% rate):

{
"currentAge": 28,
"annualIncome": 100000,
"annualExpenses": 35000,
"currentSavings": 200000,
"targetWithdrawalRate": 3
}

This increases your FI Number to 33.3× expenses instead of 25×.

If you expect higher returns (e.g., 100% stocks):

{
"currentAge": 25,
"annualIncome": 60000,
"annualExpenses": 30000,
"currentSavings": 50000,
"expectedReturn": 10,
"inflationRate": 2
}

Planning for lower returns and higher inflation:

{
"currentAge": 35,
"annualIncome": 90000,
"annualExpenses": 45000,
"currentSavings": 150000,
"expectedReturn": 5,
"inflationRate": 3
}

The yearlyProjections array shows your wealth trajectory:

{
"yearlyProjections": [
{
"year": 0,
"age": 30,
"netWorth": 100000,
"totalContributions": 100000,
"totalGains": 0,
"progressPercent": 10.0,
"fiReached": false
},
{
"year": 1,
"age": 31,
"netWorth": 145000,
"totalContributions": 140000,
"totalGains": 5000,
"progressPercent": 14.5,
"fiReached": false
}
// ... continues until FI + buffer
]
}
async function calculateFI(userInput) {
const response = await fetch("https://indepai.app/api/v1/calculator", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(userInput),
});
const result = await response.json();
if (result.success) {
return {
targetAmount: result.data.fiNumber,
yearsRemaining: result.data.yearsToFI,
retirementAge: result.data.fiAge,
savingsRate: result.data.savingsRate,
};
}
throw new Error(result.error);
}

Compare different scenarios:

const scenarios = [
{ name: "Current", expenses: 40000 },
{ name: "Frugal", expenses: 30000 },
{ name: "Comfortable", expenses: 50000 },
];
const results = await Promise.all(
scenarios.map((s) =>
fetch("https://indepai.app/api/v1/calculator", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
currentAge: 30,
annualIncome: 80000,
annualExpenses: s.expenses,
currentSavings: 100000,
}),
}).then((r) => r.json())
)
);
// Display comparison table
results.forEach((r, i) => {
console.log(`${scenarios[i].name}: FI in ${r.data.yearsToFI} years`);
});

Use the yearlyProjections to create a growth chart:

const { data } = await result.json();
// For Chart.js or similar
const chartData = {
labels: data.yearlyProjections.map((p) => p.age),
datasets: [
{
label: "Net Worth",
data: data.yearlyProjections.map((p) => p.netWorth),
},
{
label: "Contributions",
data: data.yearlyProjections.map((p) => p.totalContributions),
},
{
label: "FI Target",
data: data.yearlyProjections.map(() => data.fiNumber),
borderDash: [5, 5],
},
],
};

Common validation errors:

{
"success": false,
"error": "Validation error",
"code": "VALIDATION_ERROR",
"details": [
{ "path": "currentAge", "message": "Must be between 18 and 100" },
{ "path": "annualExpenses", "message": "Must be greater than 0" }
]
}

Handle them gracefully:

const result = await response.json();
if (!result.success) {
if (result.code === "VALIDATION_ERROR") {
result.details.forEach((err) => {
showFieldError(err.path, err.message);
});
} else {
showGeneralError(result.error);
}
return;
}

The calculator endpoint has these limits:

Tier Requests/Day
Starter 1,000
Pro 10,000

Check rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705312800