Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bullrun-Forever/401k-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1 Commit

Repository files navigation

401(k) Calculator

Free, open-source 401(k) retirement calculator with employer matching and 2026 contribution limits.

Project your retirement savings with employer match, catch-up contributions, the new super catch-up for ages 60-63, and a complete year-by-year breakdown.

Live Demo License: MIT


Try the Full Version

Use the 401(k) Calculator on BullRun Forever Tools — includes interactive charts, scenario comparison, CSV export, and dark mode.


Features

  • 2026 401(k) contribution limits (24,500ドル / 32,000ドル / 35,750ドル)
  • Employer matching calculations (configurable match % and cap)
  • Catch-up contributions for ages 50+ (7,500ドル)
  • NEW: Super catch-up contributions for ages 60-63 (11,250ドル)
  • Year-by-year growth breakdown with employer match tracking
  • Tax savings estimation from pre-tax contributions
  • 30-year extended projection
  • Zero dependencies — pure JavaScript math

2026 401(k) Contribution Limits

Age Group Employee Limit Catch-Up Total
Under 50 24,500ドル 24,500ドル
50-59 24,500ドル 7,500ドル 32,000ドル
60-63 24,500ドル 11,250ドル 35,750ドル
64+ 24,500ドル 7,500ドル 32,000ドル

The SECURE 2.0 Act introduced the super catch-up provision for ages 60-63, allowing an additional 11,250ドル on top of the base limit.

Total Annual Addition Limit (employee + employer): 71,000ドル


Quick Start

npm install
npm run dev

Open http://localhost:5173 to use the calculator locally.


The Math

Core Calculation

The calculator models year-by-year 401(k) growth including employee contributions, employer matching, and compound returns:

×ばつ contribution%, capped at limit) 3. Calculate employer match (employee contribution ×ばつ match%, capped at matchable salary) 4. Add both contributions to balance 5. Apply annual return: growth = balance ×ばつ rate 6. End-of-year balance = balance + growth">
For each year from current age to retirement age:
 1. Determine contribution limit based on age
 2. Calculate employee contribution (salary ×ばつ contribution%, capped at limit)
 3. Calculate employer match (employee contribution ×ばつ match%, capped at matchable salary)
 4. Add both contributions to balance
 5. Apply annual return: growth = balance ×ばつ rate
 6. End-of-year balance = balance + growth

Employer Match Calculation

×ばつ (matchCap / 100) employeeContributionForMatch = min(employeeContribution, matchableAmount) employerMatch = employeeContributionForMatch ×ばつ (matchPercent / 100)">
matchableAmount = annualSalary ×ばつ (matchCap / 100)
employeeContributionForMatch = min(employeeContribution, matchableAmount)
employerMatch = employeeContributionForMatch ×ばつ (matchPercent / 100)

Example: Salary 75,000,ドル employer matches 50% up to 6% of salary:

×ばつ 6% = 4,500ドル If employee contributes 4,500ドル+: Employer Match: 4,500ドル ×ばつ 50% = 2,250ドル/year (FREE money!)">
Matchable Amount: 75,000ドル ×ばつ 6% = 4,500ドル
If employee contributes 4,500ドル+:
 Employer Match: 4,500ドル ×ばつ 50% = 2,250ドル/year (FREE money!)

Full Example

Inputs:

  • Current Age: 30, Retirement Age: 65
  • Current Balance: 10,000ドル
  • Annual Salary: 75,000ドル
  • Contribution: 15% (11,250ドル/year)
  • Employer Match: 50% up to 6%
  • Expected Return: 8%

Year 1:

×ばつ 50% = 2,250ドル Total Added: 13,500ドル Starting: 10,000ドル + 13,500ドル = 23,500ドル Growth: 23,500ドル ×ばつ 8% = 1,880ドル Ending Balance: 25,380ドル">
Employee Contribution: 11,250ドル (under 24,500ドル limit)
Employer Match: min(11,250,ドル 4,500ドル) ×ばつ 50% = 2,250ドル
Total Added: 13,500ドル
Starting: 10,000ドル + 13,500ドル = 23,500ドル
Growth: 23,500ドル ×ばつ 8% = 1,880ドル
Ending Balance: 25,380ドル

After 35 years:

Total Value: ~2,847,000ドル
Your Contributions: ~404,250ドル
Employer Match: ~78,750ドル
Investment Earnings: ~2,364,000ドル
Est. Tax Savings: ~97,020ドル (at 24% bracket)

Key Formulas

Calculation Formula
Employee Contribution min(salary ×ばつ contributionPct, ageLimit)
Employer Match min(employeeContrib, salary ×ばつ matchCap) ×ばつ matchPct
Annual Growth balance ×ばつ (annualReturn / 100)
Tax Savings totalEmployeeContributions ×ばつ marginalTaxRate
Total Earnings finalValue - employeeContributed - employerContributed
Contribution Limit Age-based: <50: 24,500ドル / 50-59: 32,000ドル / 60-63: 35,750ドル / 64+: 32,000ドル

Usage (JavaScript)

import { calculate401k } from './src/calculator.js';
const result = calculate401k({
 currentAge: 30,
 retirementAge: 65,
 currentBalance: 10000,
 annualSalary: 75000,
 contributionPercent: 15,
 annualReturn: 8,
 employerMatchPercent: 50,
 employerMatchCap: 6
});
console.log(result.totalValue); // ~2,847,000ドル
console.log(result.totalEmployerContributed); // ~78,750ドル
console.log(result.estimatedTaxSavings); // ~97,020ドル
console.log(result.yearlyBreakdown); // Array of yearly data

Output Object

{
 totalValue: number, // Final 401(k) balance at retirement
 totalEmployeeContributed: number, // Sum of your contributions
 totalEmployerContributed: number, // Sum of employer match contributions
 totalContributions: number, // Employee + employer total
 totalEarnings: number, // Investment growth
 returnOnInvestment: number, // ROI percentage
 estimatedTaxSavings: number, // Tax savings from pre-tax contributions
 years: number, // Years until retirement
 yearlyBreakdown: [
 {
 year: number,
 age: number,
 startingBalance: number,
 employeeContribution: number,
 employerMatch: number,
 totalContribution: number,
 contributionLimit: number,
 growth: number,
 endingBalance: number,
 totalEmployeeContributed: number,
 totalEmployerContributed: number,
 totalEarnings: number
 }
 ],
 thirtyYearProjection: { // Extended projection (if applicable)
 totalValue: number,
 totalEmployeeContributed: number,
 totalEmployerContributed: number,
 totalEarnings: number
 }
}

Why 401(k)?

The 401(k) is the most widely used retirement vehicle in America:

  • 70+ million Americans actively contribute (Investment Company Institute)
  • Employer matching — an instant 50-100% return on your contributions
  • Tax-deferred growth — investments compound without annual tax drag
  • Higher limits — 24,500ドル vs. 7,000ドル for IRAs
  • Automatic payroll deductions — set it and forget it
  • Average employer match: 4.7% of salary (Vanguard's How America Saves 2025)

An employee earning 60,000ドル who skips the match forfeits 2,820ドル/year in free money.

Traditional vs Roth 401(k)

Feature Traditional 401(k) Roth 401(k)
Contributions Pre-tax (reduces taxable income) After-tax
Withdrawals Taxed as ordinary income Tax-free
Best if Lower tax bracket in retirement Higher tax bracket in retirement
RMDs Required at age 73 Required at 73 (can roll to Roth IRA)

FAQ

What are the 2026 401(k) contribution limits? 24,500ドル under 50, 32,000ドル for ages 50+, and 35,750ドル for ages 60-63 (super catch-up via SECURE 2.0 Act).

How does employer matching work? Your employer contributes based on your contributions. Common: 50% match up to 6% of salary. Always contribute enough to get the full match — it's free money.

What happens to my 401(k) if I change jobs? You can leave it, roll it to your new employer's plan, roll it into an IRA, or cash out (not recommended — 10% penalty + taxes).

How much should I contribute? Financial experts recommend 10-15% of gross income for retirement. At minimum, contribute enough for the full employer match.


More Free Financial Tools

This calculator is part of the BullRun Forever Toolkit — 16 free financial calculators including:


License

MIT License — use freely in your own projects.


Disclaimer

This calculator is for educational and informational purposes only. It is not financial, tax, or investment advice. Consult a qualified financial advisor for personalized recommendations. Tax laws and contribution limits may change.


Built by BullRun Forever
Free financial tools for everyone.

About

Free 401(k) retirement calculator with employer matching, 2026 contribution limits, catch-up contributions, and super catch-up for ages 60-63.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /