It’s a debate many people have – should you pay off debt or save money? It’s kind of a case of what came first, the chicken or the egg because paying off debt is important, but so is saving money.

No one likes to stay in debt, but most people don’t like not having a savings account either. It’s a double-edged sword, but we’ve got a few words of advice, especially for those looking to buy a home or refinance.

When Should Save Money?

The answer is always – you should always save money. But, that doesn’t mean you shouldn’t pay off debt either. We’ll get into that in a little bit.

First, you need an emergency fund. Whether you already own a home or you are thinking about it, an emergency fund helps when the water heater breaks, a storm damages your roof, or you need other emergency repairs.

If you don’t own a home yet, you need money for a down payment. You don’t need a lot of money – many programs allow as little as 3% down, but it’s still something.

When Should you Pay off Debt?

You should always make your minimum required debt payments. But, you may need to pay more when you’re about to apply for a mortgage. Your monthly debt requirements may be too high when you add a mortgage payment to it.

Your debt ratio is an important part of the mortgage approval process, so getting your DTI down is crucial. Besides the mortgage, carrying debt means paying excessive interest charges, which takes away from your ability to save.

What’s the Right Answer?

If you’re not sure if you should save money or pay off debt, split the difference.

For example, the 50/30/20 budget recommends that you use 20 percent of your income for savings and paying off debt. Allocate a portion of it for savings and a portion for debt payoff.

If you know your debt-to-income ratio is too high and you won’t qualify for a mortgage, focus your funds on paying some debt off for a while. Once you pay it off, go back to saving.

The key is to find a middle ground. You won’t ever earn as much as you pay in interest, especially with credit cards. For example, if you have a credit card with a 19.99% APR, you’ll never find an investment with a 19.99% rate of return. Focusing on paying that debt off is like saving 19.99% of the balance. When you pay it off, you’ll have much more money to sock away in savings.

If you’re thinking of buying a house relatively soon, you need to save. You’ll need the money for the down payment and an emergency fund. If you’re not ready to buy a house or refinance, split your available funds between the two tasks and build a strong financial foundation so when you are ready, your finances will show it.