More than half of the children born today in developed countries will live to be 100 years old, according to the Pew Charitable Trusts. By 2050 -- just 31 short years from now -- at least 400,000 Americans will have reached the age of 100.

Couple planning for retirement.

IMAGE SOURCE: GETTY IMAGES.

These figures are vivid reminders of the increasing American life expectancy, which currently stands at 78.6 years (according to the U.S. Centers for Disease Control and Prevention) and has been rising since at least the 1970s

Younger generations are looking forward to long lives; currently, 18% of millennials expect to live to 100 or beyond, according to the Transamerica Center for Retirement Studies. At first, Gen Xers and Baby Boomers seem more pessimistic, with just 13% and 10%, respectively, thinking they'll make it that long. But the median age that all these groups think they will live to is 90, so no matter when we were born, most of us expect to be around awhile.

It's worth remembering that not long ago, retirement wasn't even considered a life stage -- as long as they lived, most people were working. (Social Security was only enacted in 1935!) That's why it's key to make sure you're considering longevity when you do the math on your retirement planning. Whether you, personally, expect to hit the century mark or not, it's important to know how to plan for a retirement that lasts decades -- and keeps you comfortable throughout. Here's how.

1. Maximize your Social Security

More than two-thirds of all American workers fear that Social Security isn't going to be around when they retire, according to the Transamerica Center for Retirement Studies. The younger people are, the greater their concern; 80% of millennials think the program might not last until they leave the workforce.

Making long-term projections about Social Security is tough, because it's impossible to forecast any future adjustments. But despite fears about its financial stability, it's likely that Social Security will be there for you when the time comes. And that means you need to know how it works, so you can maximize your benefits at retirement.

Currently, Social Security pays an average of $1,461 to retirees every month. Social Security benefits are designed to replace 40% of pre-retirement income, and  recipients receive an annual cost-of-living adjustment (COLA); in 2019, for example, benefits were hiked 2.8%. But there are multiple reasons to believe these changes don't reflect the true pace of inflation, especially for senior citizens. For example, prices for Medicare Part B premiums and heating oil have risen by 195% and 181%, respectively, over the past 18 years, while Social Security payments have only gone up 46% over the same period.

All that means it's important to compare your desired income at retirement against what you're likely to receive from Social Security -- and consider how to get the most you can.

Currently, people become eligible to receive Social Security once they reach 62. But the amount is reduced if you draw benefits before your full retirement age (FRA), which is based on birth year. For people born between 1943 and 1954, the FRA is 66. It rises incrementally by months for those born between 1955 and 1959, until it reaches 67 for those born in 1960 and after.

You receive your full benefits if you retire at FRA, but you can increase your benefits by working past it. Currently, Social Security benefits climb 8% annually for each year you work between your FRA and age 70, so working longer will net you more even after you retire.

2. Plan to save for a comfortable retirement

While there are no hard-and-fast laws for how much to save for retirement, one rule of thumb is to determine the annual income you'll need from your investments and multiply it by 25. The resulting figure is your retirement savings target.

How can you determine the income you'll need? There are handy general rules here, too! It's estimated that retirees will need roughly 80% of the income they had before retirement to live comfortably. Why 80%? Because, while some expenses fall once people retire (the cost of a commute to work, perhaps), others stay the same or even rise. Roughly 30% of retirees still have a mortgage, and even if they don't, property taxes, upkeep, and maintenance expenses keep rollin' on. Health-care expenses can increase in retirement, as well; two 65-year-olds today are likely to need $399,000 to pay for health-care needs in retirement.

So start with the assumption that you'll need 80% of your pre-retirement income, and that Social Security will cover roughly 40%. If you're making $65,000 before retirement, in other words, you'll need 40% of that to come from your retirement funds, or $26,000. Using the rule of 25, you'd multiply $26,000 by 25 to arrive at a general number you'd need to save for retirement -- $650,000.

Imagine a 25-year-old who plans to retire at 67. If she saves $230 per month at a return of 7%, which is the historical average for the U.S. stock market, she'll have more than that -- $660,431, to be precise.

Now, a couple of caveats. First, when you're planning for retirement, you need to think about inflation, which eats away at the purchasing power of your money over time (historically at a rate of about 3.22% per year). If our 25-year-old earns $25,000 a year now, she will need $75,703 a year by the time she's 67 to maintain the same standard of living, because of the likely rise in inflation over 42 years. An inflation calculator can help keep you from falling short.

The second caveat? Multiple factors affect retirement savings. Your life situation, the real estate you live in, and your health status are just a few of the things that could alter your course. You might want to work until 70 (or beyond!) but need to retire at 62, for example, because of health or other conditions. It's a good idea to be prepared with a couple of projections and plans in mind, varying your desired year of retirement, projected earnings throughout your working life, and so on.

3. Manage your retirement portfolio to last

The third leg of a prudent plan for a 30-plus-year retirement is managing your portfolio to last. There's a time-tested rule to go by here, as well: the 4% rule, which states that a retirement savings nest egg will last if you withdraw 4% in each year of retirement.

This formula was developed in the 1990s by a financial advisor whose clients wanted to know precisely how much they could withdraw without running out of money, and it assumes a portfolio that's 60% stocks and 40% bonds. It also assumes the bond yields of its era, which were roughly double the levels they reached between 2008 and 2016 when interest rates were very low. With rates starting to climb again, bond yields will eventually start to move up as well. But if you have very low-yielding bonds in your portfolio, you might want to aim for less than 4% to compensate.

People approaching and in retirement need to consider the mix of assets in their portfolio. While stocks have historically shown the highest returns, that's an average over time. The stock market can have down years, and because older people don't have as much time as younger ones to recoup those losses, they need to manage that risk.

To find out how much of your portfolio should be in stocks, there's (you guessed it) a rule of thumb: Subtract your age from 110 and put that percentage in the stock market. The remainder should be devoted to fixed-income investments (like bonds or bank certificates of deposit), which provide stability.

A 30-year-old, then, could invest 80% of a portfolio in stocks and 20% in fixed-income assets. An 80-year-old, though, would invest just 30% in stocks and have 70% of his or her money in fixed-income investments.

Finally, the 4% rule assumes your money needs to last 30 years. That means if you're looking at becoming a centenarian, you'll need to retire no earlier than 70. If you decide to leave working life behind before that, you'll need to adjust the 4% downward to make sure your savings last.

With a smart savings plan and some Social Security savvy, plus the right mix of stocks and fixed-income assets in your portfolio, you should be all set to blow out your first 100 candles when the time comes. Many happy returns!