How to Backtest a Portfolio: A Free, Step-by-Step Guide
7 min read · Updated 2026-06-15
Backtesting applies a portfolio's allocation to historical market data to estimate how it would have performed — its returns, the bumps along the way, and how deep the losses got. Done honestly, it turns “I think this mix is fine” into “here's exactly what this mix would have lived through.”
This guide walks through how to backtest a portfolio for free, how to read each result, and the traps that make a backtest look better than reality. You don't need a finance background or an account to follow along.
What you need before you start
A backtest needs four simple inputs. Each one changes the result, so it's worth being deliberate:
- •Tickers — the stocks or ETFs you hold (e.g. VTI, BND, or individual names).
- •Target weights — the percentage of the portfolio in each holding. They should sum to 100%.
- •A date range — the longer the better, because it has to include real downturns to be meaningful.
- •A benchmark — usually a broad index (like the S&P 500) so you can see whether your mix actually beat “just buy the market.”
Step by step
1. Enter your holdings and weights. 2. Pick a start date that includes at least one bear market (2008 and 2020 are the useful stress points). 3. Choose a benchmark. 4. Run it. In a few seconds you get a full return-and-risk picture instead of a single number.
If you just want to see how it works, load a ready-made example first, then swap in your own tickers.
How to read the results
A good backtest reports more than “how much did it make.” The metrics that matter most for a real investor:
- •CAGR (compound annual growth rate) — the smoothed yearly return. This is the headline growth number.
- •Volatility — how much the returns bounced around. Higher means a rougher ride.
- •Maximum drawdown — the worst peak-to-trough loss. This is the number that tells you whether you'd actually have held on.
- •Sharpe & Sortino ratios — return earned per unit of risk. They let you compare two portfolios fairly, not just by raw return.
- •Beta & alpha vs the benchmark — how much of your result came from simply moving with the market, and how much was genuine outperformance.
The mistakes that make a backtest lie
Most backtests flatter the portfolio. Watch for these:
- •Overfitting — tweaking the mix until it looks perfect on past data. A portfolio tuned to ace history rarely repeats it.
- •Too short a window — a backtest that starts in 2010 never saw 2008. If it didn't include a crash, you don't know the real downside.
- •Ignoring dividends — price-only returns understate total return badly. Always reinvest dividends.
- •Ignoring fees and taxes — small drags compound into large gaps over decades.
- •Survivorship bias — testing only companies that still exist today quietly deletes the failures.
What a backtest can and can't tell you
A backtest is a study of the past, not a forecast. It's excellent for understanding risk — how deep the losses got, how long recovery took, whether two holdings move together — and for comparing strategies on a level field. It cannot predict future returns, and real markets have shocks no historical sample fully captures.
Use it to build conviction you can hold through a downturn, not to chase the mix with the prettiest past.
Try it yourself
FAQ
- Is backtesting a portfolio free?
- Yes — you can backtest any mix of stocks and ETFs here for free, with no account, using 30+ years of split-adjusted prices and reinvested dividends.
- How far back should I backtest?
- As far as your holdings have data, and far enough to include at least one major downturn (2008 and 2020 are the key stress tests). A window with no bear market hides your true downside.
- Does backtesting predict future returns?
- No. It estimates how a strategy behaved historically. It's most useful for understanding risk and comparing strategies, not for forecasting.
Key terms in this guide
Plain-English definitions in the Learning Hub.
Stop guessing — run the numbers on your own portfolio, free.
Run a free backtest →More guides
- The 60/40 Portfolio: Returns, Drawdowns, and Whether It Still Works →
- How to Tell If Your Portfolio Is Actually Diversified →
- The 4% Rule, Explained: How Long Will Your Retirement Savings Last? →
- The Efficient Frontier, Explained (Without the Math Headache) →
- Lump Sum vs Dollar-Cost Averaging: What the Data Says →
- Lazy Portfolios, Explained: Simple Index Mixes That Beat Most Investors →
- How Much Do I Need to Retire? A Simple Way to Find Your Number →
- Maximum Drawdown: Why the Worst Loss Matters More Than the Average Return →
- The Sharpe Ratio, Explained: Are You Being Paid for the Risk You Take? →
- Monte Carlo Simulation, Explained: Planning for a Range of Futures →
- Stocks vs Bonds: How They Differ and How to Mix Them →
- How to Read a Stock's Fundamentals (Without an Accounting Degree) →
- Portfolio Rebalancing, Explained: Why and How to Reset Your Mix →
- VOO vs VTI: S&P 500 or Total US Market — Does It Matter? →
- Asset Allocation by Age: How Your Mix Should Change Over Time →
- Index Funds vs ETFs: What's the Difference and Which Should You Pick? →
- Should You Invest Internationally? Home-Country Bias, Explained →