A financial expert says deciding whether to save or pay off debt comes down to a basic math question

Prioritize the higher rate of return.
SewCream/Shutterstock
It's hard to overstate the importance of saving money. But if you have debt of any kind, you know saving can often feel all but impossible.

Luckily, there's a simple way to balance the two, according to Jean Chatzky, the financial editor of NBC's "Today" show and the author of several books, including most recently "Age Proof."

"When we're choosing between any sort of either-or when it comes to finances, you have to look at the return on your money," Chatzky, who is also a senior editor at The Balance, told Business Insider in a Facebook Live interview. "So the way you have to look at retirement accounts are: What am I getting on that money?"

For example, Chatzky explained, if you're weighing the return of putting extra cash toward paying off student loans ahead of schedule versus contributing that extra money to your 401(k), you need to check out the rate of return.

"If you are getting matching dollars [on your 401(k)], that is a no-brainer. Because that's a guaranteed return that is going to be very, very tough to beat in any other way," she said. "If you're not getting matching dollars but you haven't quite finished maxing out or putting in as much as you possibly can, I would probably just continue to invest for retirement and pay off my student loans on the schedule that I was given."

In other words, if the interest rate on your student loans is lower than the amount you could earn by investing for retirement, you should save rather than pay down your student loans more quickly.

While student loans typically have low interest rates, that's not case with all types of debt. In fact, you'll almost always want to pay off high-interest credit card debt before saving more money.

All it takes is a simple calculation: Compare the average rate of return on your savings accounts to the interest rate you pay on your debt, and prioritize whichever is higher.