Do you really need $2.5 million for a good retirement?

You can't feel secure in retirement if you don't have a good idea of how much money you'll need.

But if you believe a new Legg Mason survey, you may have to save far more than you think. Investors surveyed by the global investment management firm said they will require an average of $2.5 million in retirement to enjoy the quality of life they have today.

That's about $2.2 million more than the average balance of $385,000 those investors actually had in 401(k)s and similar retirement plans, which might help explain why only 40 percent of the 458 investors surveyed said they are "very confident" in their ability to "retire at the age I want to." (And the investors surveyed have set more aside than the average retirement saver. At Fidelity, the nation's largest retirement plan provider, the average 401(k) balance was $91,300 at the end of 2014.)

Despite their above-average savings rate, these investors are worrywarts. On average, they told Legg Mason they spend an hour and 18 minutes worrying about money each day. That's 475 hours, or nearly 20 full days, of financial hand-wringing a year.

Read MoreIt's not too late to save for retirement

All that anxiety has generated some resolve to change savings habits. Some 72 percent of investors surveyed said they would make sacrifices now to have more money in retirement and 42 percent expect to cut expenses so they don't outlive their assets.

Boomer woman working
Image Source | Getty Images

How much do you really need to retire?

Of course, most people won't need to save $2.5 million to have a comfortable retirement. But figuring out how much you should squirrel away can be challenging.

Fidelity estimates most investors require about eight times their ending salary to increase the chances that their savings will last during a 25-year retirement. But every retirement is different. People also tend to spend lavishly in their first years of retirement before their spending declines in later years.

Health care is the wild card in retirement planning, especially as Americans live longer. Fidelity projects a 65-year-old couple retiring will need an average of $220,000 to cover medical expenses in retirement.

Read MoreHow to (safely) draw down you retirement savings

A financial plan will help you estimate how much you will need to save. "Without a plan, it's like being in dense fog. You can't see the end goal and there is no clear path how to get to your goal," said Andy Tilp, a certified financial planner and president of Trillium Valley Financial Planning near Portland, Oregon.

Tilp also recommends those close to retirement factor in the potential costs of long-term care. "Not everyone will require long-term care, but it is good to know the impact of the addition expenses. We look at whether they can afford to self-fund, or whether they should consider long-term care insurance," he said.

CORRECTION: This version updated with Legg Mason correcting data from its survey about how much time investors spend worrying about their money.