401k Portfolio Balancing Calculator

Analyze your retirement portfolio allocation across accounts and compare to a VT/BNDW-based target.

Supports Vanguard and Fidelity funds. Fund data is looked up automatically when you submit.

Allocation Method
(stock/bond split derived from Vanguard Target Retirement funds)
Advanced: US Stock Cap Targets

Target breakdown of US stock allocation by market cap

Default 85/10/5 approximates the total US stock market. Funds are classified by name (e.g. “500 Index” = Large Cap).

Advanced: Tax-Adjusted Allocation

Adjust allocation percentages to reflect the after-tax value of holdings in different account types. Learn more

Set to 0 to disable. In bulk import, tag holdings with tax:roth, tax:traditional, tax:after-tax, or tax:brokerage.

Auto-save portfolio
What does this do?

When enabled, your portfolio settings are automatically saved to a browser cookie. Cookies are stored on your computer, in your browser. No tracking, no analytics, no third-party cookies. Turning this off clears all saved data.

About This Calculator

What This Calculator Does

This calculator analyzes your retirement portfolio across multiple accounts and providers, comparing your current allocation to a target. It breaks down holdings into four categories — US stocks, international stocks, US bonds, and international bonds — and shows where you're over- or under-allocated.

How Allocation Targets Work

You can set your target two ways:

Within stocks and bonds, the US vs. international split comes from real VT (Vanguard Total World Stock ETF) and BNDW (Vanguard Total World Bond ETF) holdings data, reflecting current global market weights.

Fund Data Pipeline

When you submit your portfolio, the calculator scrapes fund profiles from Vanguard and Fidelity to determine each fund's asset breakdown. Data is cached for 90 days in a D1 database. If your funds aren't cached, you'll see a loading screen while they're fetched.

Rebalancing Solver

The rebalancing engine uses projected gradient descent to minimize deviation from your target allocation across all four categories. It respects account boundaries — the same fund in different accounts is treated as a separate holding, so recommendations are account-specific. An optional cap-aware mode further breaks down US stocks by large/mid/small cap targets.

Key Concepts

Tax-Aware Rebalancing

When you tag accounts with tax types (Roth, Traditional, etc.) and set a tax rate, the rebalancing solver internally adjusts portfolio weights to account for the different after-tax values of holdings in different account types. For example, $10,000 in a Roth account is worth more after taxes than $10,000 in a Traditional account, because Roth withdrawals are tax-free.

These tax adjustments are used only by the solver to produce better rebalancing recommendations. All displayed values — dollar amounts, allocation percentages, and the summary total — show nominal (unadjusted) figures that match your actual account balances.

Limitations

commit 39c9264 · common v0.18.0

© 2026 Shane Mathews

← shane.fail