How this calculator works
The calculator follows your money down two paths. On the first, you never sold. On the second, you sold in the month you picked, kept the money in cash, and bought back in another month, or never did. The difference between the two is what the sale cost you, or saved you. It works the same for a sale that wasn’t a panic, like selling a winner too early. It doesn’t connect to your broker or send an alert when your portfolio falls, because that would need an account, and these tools never ask for one or for your email. The math runs in your browser, and Bufetico doesn’t keep what you type. Your numbers do go into the page address, so you can share the result. If you share that address, your numbers go with it, and they’re still there when you reload the page.
It uses the S&P 500 month by month since 1871, from the data Robert J. Shiller of Yale keeps at shillerdata.com: each month’s price, its dividend and the US consumer price index. Each month, money in the index grows by the price change plus one twelfth of the yearly dividend, reinvested. While you’re out, your cash earns the rate on three-month US Treasury bills for each year, from Aswath Damodaran’s data at NYU, or a rate you type. A Treasury bill is a short loan to the US government, and a common place to keep cash.
S&P 500 is a registered trademark of Standard & Poor’s Financial Services LLC, and the index is a product of S&P Dow Jones Indices LLC. Bufetico isn’t affiliated with them or endorsed by them.
In the example the calculator opens with, you put $10,000 into the S&P 500 in January 2020, sold in March 2020, the month COVID-19 hit the markets, and bought back in January 2021. If you had stayed in, the $10,000 would be $25,776 in September 2026. Because of the sale, it’s $17,802, or $7,974 less. You sold with the index at 2,652.39 and bought back at 3,793.75, 43.0% higher.
Each month’s price is the average of that month’s daily closes, the way Shiller keeps it, so a crash looks smaller here than it felt. The question about it below has the numbers for 2020. If you know the exact prices you got, use “My own prices”.
What bad timing costs the average investor
Morningstar measures what bad timing costs fund investors every year. In its Mind the Gap study of August 2026, the money people actually had in US mutual funds and ETFs (funds that trade like a stock) earned about 1.2 points a year less than the funds themselves over the ten years to December 2025, because of when they bought and sold. The gap was more than 2 points a year in the fifth of funds whose prices move the most, and 0.4 points a year in the calmest fifth (Morningstar, Mind the Gap 2026). DALBAR, which measures the gap a different way, found 0.72 points for 2025 and 8.48 points for 2024 (DALBAR, April 16, 2026).
Some people never come back. Researchers at MIT went through 653,455 brokerage accounts from 2003 to 2015. They counted a panic sale when the money a household had in stocks dropped 90% in one month, and at least half of that drop came from its own selling (Elkind, Kaminski, Lo, Siah and Wong, 2022). Press reports of the study say about 31% of those households never put money back into stocks or other risky investments (Evidence Investor). The first tab has that case too: tick “I never bought back”.
How long the market took to come back
The index’s monthly average fell 20% or more 13 times since 1871. The table shows each fall and when the index got back to its old high. Going by the price alone, the recovery takes longer, because the price leaves out the dividends you’d have reinvested.
| High | Low | Fall | Back at the high, price only | Back with dividends reinvested |
|---|---|---|---|---|
| May 1872 * | June 1877 | -47.3% | February 1880 (7 years and 9 months) | June 1878 (6 years and 1 month) |
| June 1881 * | August 1896 | -42.1% | December 1900 (19 years and 6 months) | August 1896 (15 years and 2 months) |
| September 1902 * | October 1903 | -29.3% | March 1905 (2 years and 6 months) | November 1904 (2 years and 2 months) |
| September 1906 * | November 1907 | -37.7% | August 1909 (2 years and 11 months) | December 1908 (2 years and 3 months) |
| December 1909 * | August 1921 | -37.4% | January 1925 (15 years and 1 month) | August 1921 (11 years and 8 months) |
| September 1929 * | June 1932 | -84.8% | September 1954 (25 years) | January 1945 (15 years and 4 months) |
| December 1961 | June 1962 | -22.5% | September 1963 (1 year and 9 months) | April 1963 (1 year and 4 months) |
| December 1968 | June 1970 | -29.0% | March 1972 (3 years and 3 months) | March 1971 (2 years and 3 months) |
| January 1973 | December 1974 | -43.4% | July 1980 (7 years and 6 months) | July 1976 (3 years and 6 months) |
| August 1987 | December 1987 | -26.8% | July 1989 (1 year and 11 months) | May 1989 (1 year and 9 months) |
| August 2000 | February 2003 | -43.7% | May 2007 (6 years and 9 months) | October 2006 (6 years and 2 months) |
| October 2007 | March 2009 | -50.8% | March 2013 (5 years and 5 months) | August 2012 (4 years and 10 months) |
| December 2021 | October 2022 | -20.3% | December 2023 (2 years) | December 2023 (2 years) |
* Before March 1957, Shiller’s S&P Composite. The count of months starts at the high. Source: Robert J. Shiller, shillerdata.com.
A fall needs a bigger rise to undo it. After a 20% fall, the index has to rise 25% to get back where it was, and after a 50% fall, it has to double. The rise you need is 1 ÷ (1 − the fall) − 1.
Other indexes took much longer. On price alone, Japan’s Nikkei 225 needed 34 years to pass its December 1989 record, which it did on February 22, 2024 (AP). In the US, the Nasdaq Composite needed 15, from March 10, 2000 to April 23, 2015 (AP). And a monthly table can hide a fast fall: in the spring of 2025 the S&P 500 dropped nearly 20% from its February high in daily closes and closed at a record on June 27 (NPR), so it isn’t in the table above.
The best days, and the worst ones
Hartford Funds counted 76% of the S&P 500’s best days from 1996 to 2025 in a bear market, a fall of 20% or more, or in the first two months of the rise after one (Hartford Funds, data as of March 2026). So the best days tend to come while the news is still bad. That’s often when people who sold are still sitting in cash.
The third tab of the calculator puts the J.P. Morgan and Ben Carlson numbers next to the best and the worst months since 1871, measured on the same monthly data.
What a calculator like this can’t see
It’s easy to judge a sale looking back. And there are things a calculator like this one can’t see:
- Monthly averages. Each month here is one average price, so the real low, and the price you really got, can be lower or higher. If you know your exact prices, use “My own prices”.
- Hindsight. The best and the worst months are clear now. While they were happening, you couldn’t tell which was which.
- One index. Japan’s Nikkei took 34 years to get back on price alone, and a single company can go to zero. And some dead companies still show an old price, as if nothing happened.
- Taxes. The tax here is one rate on the gain of your sale. It leaves out the tax on the interest your cash earned, state tax and the losses you could use. In the US, a gain on shares held a year or less is taxed like your regular income, usually at a higher rate than on shares held longer, and a loss bought back within 30 days is a wash sale.
- Cash outside the US. Treasury bill rates are for dollars. For cash in euros, pounds or pesos, type your own rate.
- Your situation. If you need the money in a year or two, you may not have time to wait for a rebound. This calculator doesn’t know your situation.
The free course has a lesson on the costs that come out of a gain, like the spread and taxes.
Questions people ask
How much does panic selling cost?
It depends on how far the market came back while you were out. In the example the calculator opens with, selling in March 2020 and buying back in January 2021 left $7,974 less by September 2026, about 31%. Across funds, Morningstar measured the cost of buying and selling at the wrong times at about 1.2 points a year over the ten years to 2025.
What happens if you miss the 10 best days in the market?
J.P. Morgan measured it from January 2, 2006 to December 31, 2025: $10,000 fully invested in the S&P 500 became $80,619, and missing the 10 best days left $35,866. Six of those 10 best days came within two weeks of the 10 worst, so leaving after a bad day often means missing the good one that follows. This calculator has months, and the third tab does the same with the best and worst months.
How long does the stock market take to recover from a crash?
In the monthly averages since 1871, the index fell 20% or more 13 times. Getting back to the old high on price alone took 5 years and 5 months in the middle case. The longest was the fall that began in September 1929: the price got back in September 1954, and with dividends reinvested the money was back in January 1945. After the October 2007 high, it got back in March 2013. Each one is in the table above.
I sold. When should I buy back in?
The right month only shows up looking back. The second tab runs different ways of coming back over every fall since 1871, and the first one compares buying back all at once with spreading it over several months.
Should I move my 401(k) to cash when the market drops?
It depends on your situation, which the calculator doesn’t know. It can show what the move did in the past: open “Monthly additions, buying back and tax”, put in your monthly contribution, and switch between the money going to cash and stopping while you’re out.
Is it better to sell before a crash?
Selling before a crash only helps if you know when the crash comes. The second tab tests rules people use over every year since 1871. Since 1950, selling after a 20% fall and buying back once the index got back to its old high would have turned $10,000 into $7,045,242, against $46,990,478 staying in. That way back always buys back above the price it sold at. Buying back six months later instead came out 2.1% ahead with a 20% fall, before taxes, and behind with a 15% or a 25% fall. That’s one setting out of many, found by looking back. It doesn’t tell you how any rule will do next time.
Does “sell in May and go away” work?
In the second tab, selling every May and buying back in November since 1950 sold 77 times. 26 of those round trips came out ahead of staying in and 51 behind, and the rule ended 79% behind, before taxes.
What about a stop-loss order?
A trailing stop-loss is an order to your broker to sell if the price falls a set percentage from its high. It works like the “fall from the high” rule in the second tab, except it sells during the day, at whatever price it gets, instead of at a monthly average. In a fast fall it can sell near the bottom, and it doesn’t buy back for you.
What is a wash sale?
In the US, if you sell a stock or fund at a loss and buy the same one, or one that’s substantially identical, within 30 days before or after the sale, the loss doesn’t count for tax yet. It’s added to the cost of the new shares. The calculator flags it when you sell at a loss and buy back about a month later.
Why does a crash look smaller here than it felt?
Each month here is the average of its daily closes. In 2020 the S&P 500 fell 33.9% from its February high to its March low in daily closes, and 19.1% from the February average to the March average. If you know your exact prices, use “My own prices”.
Should I sell my stocks because of a war or the news?
I can’t answer that for you. For the stocks I own, a headline doesn’t change what a company is worth to me. I look at the business in its yearly numbers: whether it’s still financially stable and whether it’s still growing.
Where does the data come from?
The S&P 500 prices, dividends and consumer prices come from Robert J. Shiller’s data at shillerdata.com, downloaded on October 16, 2026, with prices up to September 2026. Each month’s price is the average of its daily closes. The Treasury bill rates come from Aswath Damodaran at NYU Stern, updated January 5, 2026.