Older information-technology professionals are being passed over by employers, even as IT job openings soar to record highs and employers say recruiting tech talent is a challenge.

The IT workforce in the U.S. skews young: Workers aged 22 to 44 account for 61% of the IT sector, but only 49% of the workforce across all occupations, according to 2019 data compiled by IT trade group CompTIA.

On the other side, workers aged 45 and older represent 38% of all IT employees at U.S. companies, while the comparable figure for all occupations is 44%, CompTIA said.

The largest gap occurs among workers ages 35 to 44. They make up 29% of the IT workforce, but just 21% of the overall national workforce, said Tim Herbert, CompTIA’s senior vice president for research and market intelligence.

A 2016 analysis of U.S. Census data by the agency’s industry and occupational statistics branch showed similar trends.

Many older tech workers say they are frustrated that they can’t find jobs despite the talent shortage.

One problem is that some older IT workers who get too comfortable with their skills risk falling behind, especially in the era of artificial intelligence, said Michael Solomon, co-founder and managing partner at 10x Ascend, an advisory firm for senior technology job seekers. “These are likely the ones who feel like they are being passed over for younger developers,” Mr. Solomon said.

Another issue is cost. By the time many tech workers are in their 50s and 60s, Mr. Solomon said, they often have top-level compensation packages. “If a company can get someone with a similar skill level who is earlier in their career, they often do,” he said.

The age imbalance between IT and the overall U.S. workforce began roughly a decade ago and has grown over the years, researchers have found.

A 2017 study by Visier Inc., a cloud-based analytics platform for human resources professionals, found that IT job seekers aged 34 to 51 made up 41% of the available enterprise tech talent, but only 27% of new hires. Millennials, aged 20 to 33 at the time the study was conducted, were nearly 50% more likely to land an IT job than their older counterparts, it found. The study was based on an analysis of 330,000 employees from 43 large U.S. enterprises.

“More and more hiring managers associate technology innovation with youth,” said Martha Heller, chief executive of tech recruiting firm Heller Search Associates, for instance by using words such as “hungry.” She added, “Age bias is alive and well in technology recruiting.”

Enterprise tech job postings by U.S. employers in the first half of the year rose 32% from a year earlier, according to federal employment data analyzed by CompTIA. In the three months ended Oct. 31, U.S. employers reported roughly 918,000 unfilled IT jobs, the analysis found.

More than 80% of about 2,800 U.S. employers surveyed this year by staffing company Robert Half International Inc. said recruiting tech talent is one of their biggest business challenges. The toughest positions to fill included business intelligence analysts, cloud architects, cloud systems engineers and data scientists, the firm said.

“In such a candidate-tight market, hiring managers can’t afford to overlook any potential talent pool,” said John Reed, executive vice president at Robert Half.

Many companies are retraining their IT teams to fill internal skills gaps, Mr. Reed said. “There’s often a strong desire from more tenured workers to take on these opportunities in order to stay current in the industry,” keeping them competitive in the job market, he said.

By targeting younger workers, employers risk losing the advantages of building a technology team with varying levels of experience to tackle a range of tech issues—such as keeping older IT systems working while companies transition to new tools, Mr. Reed said.

“A multigenerational technology team has often proven to be extremely valuable, as varying levels of experience only enhance their ability to problem solve and innovate,” he said.

Write to Angus Loten at angus.loten@wsj.com