Millennials are often stereotyped as the internet generation, looking for immediate gratification and unable to take the long-term view. This suggests that members of that generation are not thinking about retirement. But a new study from J.D. Power shows that's not the case, at least among those with access to a group retirement plan.

It turns out that millennials, whom the survey defines as people born between 1982 and 1994, are the most prepared for retirement among all generations of group retirement-plan members. Over half of millennials (51%) have set specific retirement goals, compared with readings of just 44% for both Generation X members (1965-1976) and baby boomers (1946-1964). In addition, 83% of the millennials who have set goals said they are on track to meet them.

"The fact that many in the youngest generation of plan participants are actively preparing for retirement now sends a clear message to providers," said J.D. Power senior director Mike Foy in a press release. "They need to be focused on upping their game on their digital and mobile offerings to meet the expectations of this digitally engaged customer segment."

A person drops a coin into a piggy bank.

A study shows that millennials' retirement piggy banks are the best fed. Image source: Getty Images.

Baby boomers are lagging

While 75% of baby boomers have $100,000 in savings, the age group averages just 3.4 years of current income saved with an average of three years until retirement. And while there's no hard and fast rule for how much you need to save for retirement, the number is certainly closer to 10 years of current income than it is to five.

Millennials are actually in better shape in this area as well, according to the study of 9,500 group retirement-plan members. Nearly two-thirds of the younger generation have at least $25,000 in a retirement account, while 27% have more than $100,000 saved. That's impressive when you consider that the average millennial is 30 to 35 years away from retirement.

What can you do?

You can't properly save for retirement without understanding how much money you will need to retire. That number depends on the lifestyle you expect to live when retired. If you plan to downsize, move someplace cheaper, and generally downgrade your lifestyle, you will need less than if you plan to mostly maintain the standard set during your working days.

To know where you stand when it comes to retirement savings, it's important to do an honest budget for your planned retirement. If, for example, you expect to travel a lot, then you have to factor in the cost of that.

As is the case with any financial planning, it's always best to assume that things won't go as planned. Nobody has ever been upset by having extra money in retirement, so it's better to err on the side of too much savings if at all possible.

The Motley Fool has a disclosure policy.