Portfolio Rebalancer
Calculate optimal buy orders for new cash contributions to hit your target allocation — no selling required.
How It Works
Portfolio rebalancing is the practice of realigning your investment portfolio back to your target asset allocation. Over time, market movements cause some positions to grow larger than intended while others shrink. Rather than selling overweight positions — which can trigger capital gains taxes — you can use fresh cash contributions to buy more of your underweight assets.
The calculator takes your current holdings (ticker, shares owned, and current market price), your desired target allocation percentages, and the amount of cash you are ready to contribute. It then computes how many shares of each asset to buy so that your portfolio — after the contribution — is as close as possible to your target allocation.
The Formula
TotalCurrentValue = Σ (sharesᵢ × priceᵢ)
TotalNewValue = TotalCurrentValue + CashContribution
TargetValueᵢ = TotalNewValue × (targetPercentageᵢ / 100)
Shortfallᵢ = TargetValueᵢ − (sharesᵢ × priceᵢ)
SharesToBuyᵢ = min(⌊shortfallᵢ / priceᵢ⌋, ⌊remainingCash / priceᵢ⌋)
Orders are allocated largest-shortfall-first and capped by remaining cash.
FAQ
What is portfolio rebalancing?
Portfolio rebalancing is the process of realigning the weightings of your portfolio assets back to your target allocation. This calculator helps you buy the right amount of each asset with new cash contributions — no selling required.
Why should I rebalance without selling?
Selling triggers taxable events in taxable accounts. By directing new contributions to underweight assets, you can rebalance tax-efficiently while staying invested.
How is the buy order calculated?
Each asset shortfall is computed as (target value - current value). Shares to buy = floor(shortfall / price). Orders are allocated largest-shortfall-first and capped by your remaining cash contribution.
What if my targets don't add up to 100%?
The total allocation must equal 100%. The calculator shows a warning if your entered targets sum to anything else, and the results may not reflect your intended portfolio.
Does this tool support fractional shares?
Buy orders round down to whole shares. Any leftover cash after filling the largest shortfalls is shown as unallocated cash.
Related Tools
More calculators coming soon: compound interest, tax drag simulator, retirement drawdown.