Younger employees now entering their prime working years are so far proving as loyal to employers as the generation before them, despite a hot job market.

In January 2018, 70% of workers between the ages of 22 and 37, commonly known as the millennial generation, had worked for their current employer for 13 months or more, according to an analysis of federal data by the Pew Research Center. By comparison, that number was 69% for workers who were in the same age group in 2002 and are known as Generation X.

“When you look at millennials, they have no shorter job tenures with their current employers than Generation X did back in 2002,” said Richard Fry, senior researcher at Pew. “Ten years after the great recession, it’s still the case.”

Even when looking at longer tenures, data suggest younger workers may be more loyal than their predecessors were as they were getting their careers under way. According to the Bureau of Labor Statistics, in January 2018, 28.8% of workers ages 25 to 34 had worked for the same employer for at least five years. The share of workers in that age group with equal tenure in 2000 was 21.8%.

The stability among younger workers comes as unemployment rates hover near 50-year lows and companies are drawing from a larger pool of job seekers. In January, the share of Americans aged 25 to 54 working or looking for work was at 83.1%, the highest rate since 2008.

“You have this phenomenon today of high employment, and yet this very high level of anxiety that we’re seeing amongst employees about job security,” said Robert Falzon, vice chair of Prudential Financial Inc. “I don’t think millennials are insulated from that.”

A survey conducted last year by Prudential found nearly 60% of millennials had worked for their current employer for three or more years, and 49% wanted to work for their employer for at least another four years.

The loyalty among younger workers contradicts a persistent myth among some job recruiters that millennials are more eager to switch jobs.

“It was sort of understood that during the depths of the recession, when the labor market was in very dire straits, especially for young adults, the job hopping would be suppressed,” Pew’s Mr. Fry said. But as the economic recovery began building momentum, he said, the idea that millennials were bouncing wildly from one employer to another took hold—even without the data to bear it out.

Information on worker tenure has been collected as part of the Current Population Survey since the 1950s, but the job-switching question wasn’t asked in a consistent format until 1996, which is why Pew wasn’t able to evaluate how millennials and Gen X workers compare to baby boomers when they were the same age.

SHARE YOUR THOUGHTS In your experience, what is the most common reason people leave their jobs? Join the conversation below.

Laura Mazzullo, a New York-based recruiter, said entering the workforce during or soon after the recession may have rendered many millennials more submissive job candidates at first. But as economic prospects improved several years into their professional lives, they became more assertive in seeking promotions and raises, and many employers were taken aback, she said.

Mr. Falzon said younger workers also may feel they need to move jobs to continue building essential skills because today’s careers need to be reinvented roughly every four years. Some people may assume, “if I don’t move around, I won’t continue to learn, and if I don’t continue to learn I’ll be vulnerable,” he said.

That was the case for Margo Tercy, 35 years old, who left a job she had held for five years to join Google. In her old role, she said she felt there was a ceiling she couldn’t breach. But a supportive team and managers on Google’s campus in Sunnyvale, Calif., are keeping her happy, she said.

Ms. Tercy is an administrative business partner on Google’s Cloud team, a role she has held for three of her five years there, supporting executives, training new hires and more recently branching into project management. Ms. Tercy asked to learn to code and was taught. She said she has since built a project management tool to boost collaboration on her team. While she has continued to earn more money, she said it isn’t the primary reason she has stayed at Google.

“The job is constantly evolving and changing,” she said. “I’m constantly expanding my scope within projects.”

Write to Kathryn Dill at Kathryn.Dill@wsj.com