Here's how much members of Generation X have racked up in debt

Kevin O'Leary: Here's the age by which you should have your debt paid off

Those in Generation X who chastise millennials for their avocado toast habits should remember the adage about people who live in glass houses. Americans between the ages of 35 and 49 have only slightly less debt than their older millennial counterparts.

Gen Xers have an average of $39,000 each in personal debt, excluding home mortgages, according to Northwestern Mutual's 2018 Planning & Progress Study, while older millennials (25-34) have an average of $42,000. And younger millennials (18-24) have far less: $22,000. The findings are based on a survey of over 2,000 U.S. adults.

The Gen X total is the second highest level of any generation surveyed. Still, experts say their level of debt is to be expected. "While [those in Gen X] typically still hold some debt on major items, it's not as large a concern," Oklahoma City-based financial planner Amy Hubble tells CNBC Make It.

That's because typical Gen Xers are in their peak earning years, and they've likely got some equity built up in their homes. Plus, those in Gen X have relatively substantial savings. MagnifyMoney calculates that the average Gen X household has $125,560 socked away between bank accounts and retirement savings.

That's not to say Gen Xers are completely in the clear. This part of your life is crunch time, says Kevin O'Leary, personal finance author and co-host of ABC's "Shark Tank." People should aim to have all of their debt paid off — from mortgages to student loans to credit card debt — by age 45, he tells CNBC Make It.

"The reason I say 45 is the turning point, or in your 40s, is because think about a career: Most careers start in early 20s and end in the mid-60s," O'Leary says. "So, when you're 45 years old, the game is more than half over, and you better be out of debt, because you're going to use the rest of the innings in that game to accrue capital."

Don't miss: Members of Gen Z already owe an average of $4,343 each and they can't even legally drink yet

Like this story? Subscribe to CNBC Make It on YouTube!

Cringeworthy money confessions from Shark Tank investor Kevin O'Leary