The best time to start saving for retirement is as soon as possible. By saving in your early 20s, you give your nest egg extra time to grow, potentially shaving years off how long you need to work.

But before setting aside money for retirement, most feel the need to retire student loan debt. That’s easy to say but harder to do for millennials exiting college these days. Many are in the same boat as Nolan Grace, a 24-year-old who graduated from Purdue University with “very significant” loans. “It’s the biggest weight on my life right now,” he says.

Luckily, Grace works for an employer -- Austin-based software-services company BP3 Global Inc. -- that helps him with loan payments in an increasingly popular way. BP3 uses a platform called Student Loan Genius to let it match as much as $100 per month in Grace’s debt payments, one of several companies offering similar benefits. Employees who work for Student Loan Genius customers have more than $61,000 in student loan debt on average, and their monthly payments are usually more than $500 a month.

“We really like the effect it has on our ability to recruit,” BP3 Chief Executive Officer Scott Francis says. He explains that the benefit tends to get much more attention from college students than the company’s health-care and retirement offerings. And on Wednesday, Student Loan Genius is unveiling a novel product that may attract even more debt-laden graduates.

CEO Tony Aguilar helped start Student Loan Genius in 2013, building up its customer base to include 45 companies. He’s been pushing for Congress to pass a bill that would allow employer matches to student loan payments to be pretax. But in the meantime, his company came up with a way to sync the existing 401(k) program with college loan bills. That way, young people don’t lose the opportunity for a tax-deferred match if they’ve chosen to pay down debt rather than save for retirement.

“Not only are we helping the student loan problem, we’re helping people save as well,” he says.

Aguilar, 31, graduated from college with more than $100,000 in student loans. He says he knows as well as anyone how the problem is holding back an entire generation. What’s more, helping millennials pay down student debt would have the added benefit of stabilizing, and fueling, the economy, he contends.

More millennials than ever face a barrier to saving. U.S. educational debt rose to $1.2 trillion last year, six times more than in 2003, and the average recent college student has $31,000 in debt. These statistics put at risk the retirement prospects for millions of Americans, according to the Center for Retirement Research at Boston College. In a study last month, the center estimated that recent growth in student debt could increase the number of Americans facing inadequate retirement income by 4.6 percentage points. Such higher debt loads make it harder to buy a home or contribute to retirement plans.

A January report by Facebook Inc., which analyzed public posts and polled thousands of users anonymously, found that only 13 percent of people age 21–34 see being able to retire as the definition of financial success. The No. 1 indicator of financial success to them is being debt-free.

How can you stay focused on the faraway dream of retirement when you’re obsessing over meeting this month’s debt payment? Aguilar says the way is to link the two.

His new benefit platform will let companies sync retirement savings and student debt payments, so employees who make a monthly student loan payment would automatically get a matching, pretax employer contribution to their 401(k).

Since 401(k) contributions are pretax, the money goes further than just matching the employee’s monthly loan payment, which is after-tax. Ultimately, it’s up to employers to decide how to structure the benefit—do they want to encourage retirement planning, or student loan payments? Both? And how much do they want to devote to each?

The 401(k) benefit program would need to navigate the knotty rules the federal government imposes on retirement plans, says Marcia Wagner, managing director of the Wagner Law Group in Boston. So-called nondiscrimination tests prevent highly paid employees from getting too much extra benefit out of 401(k) plans compared with lower-paid workers. Student Loan Genius says such rules won’t be a problem, because those with student loans tend to be closer to the bottom of the pay scale, and the benefit should spur more younger, lower-paid employees to participate in retirement plans.

Alicia Munnell, a Boston College professor who’s the director of the Center for Retirement Research, says linking student loan payments and retirement contributions is a “nice idea.”

“If every company offered this type of benefit, it would help debt-laden college graduates get an earlier start on retirement saving,” she says. “But every company won’t.” The best way to help young people save for retirement would be improving how 401(k) plans are designed, Munnell says, by adding features (which workers can always opt out of) that automatically enroll them and automatically raise the contribution rate over time.