You'll often hear that if you were to give up your morning coffee, you'd have enough money to pay for retirement. Well, that may not be quite true, especially if you're not the fancy caffeinated-beverage type and tend to favor cheaper coffeeshop purchases. But if the amount of money you spend on restaurants each year is comparable to that of the average American, you could be missing out on a key opportunity to build a solid nest egg for the future.

The typical American spends $3,459 a year dining out, according to the Bureau of Labor Statistics. And if you generally do the same and are on track for retirement, then there's really no need to stop. But if you can't remember the last time you contributed to your IRA or 401(k) plan, it may be time to stop throwing your money away on restaurants and instead start using it to secure your financial future.

Man and woman eating dinner at restaurant table with wine glasses in their hands.

IMAGE SOURCE: GETTY IMAGES.

What could $3,459 a year in retirement-plan contributions do for you?

Spending close to $300 a month on restaurant meals may not seem like such a big deal. But actually, it could be the one habit that's keeping you from building a solid nest egg.

Imagine that, instead of spending $3,459 annually to dine out, you put that cash into retirement savings. Let's also imagine that you do so over a 40-year period and you invest your savings at an average annual 7% return, which is a few percentage points below the stock market's average. At that point, you'd be looking at just over $690,000 in your retirement plan. That's a nice chunk of cash, and certainly enough to buy your senior self a comfortable post-career lifestyle.

You could argue that the above numbers are skewed because they don't account for the replacement cost of the meals purchased with that $3,459 annually. That's a fair point, though it's also conceivable that you could learn to grocery shop more efficiently and eke out enough leftovers to replace those meals without incurring added costs.

But for the sake of addressing that argument, let's say that, instead of spending $3,459 a year to dine out, you buy groceries to make comparable meals at home. Food establishments typically charge a 300% markup on the items they serve, so $3,459 in restaurant meals would likely cost you around $865 in supermarket bills. As such, you're still saving a good $2,594 a year.

If you were to contribute that $2,549 a year to a retirement plan over 40 years and invest it at an average annual 7% return, you'd wind up with around $518,000. That's a nice nest egg, too.

The point? If your restaurant habit is keeping you from funding your nest egg, you should, at the very least, consider cutting back. If you normally dine out three nights a week, scale back to one or two. Or make restaurant meals a real treat by limiting yourself to just one a month, at least until your nest egg looks like it's in better shape.

Of course, if dining out is one of your favorite things to do and you can free up similar amounts of cash by cutting back on other expenses, do that instead. As stated earlier, there's nothing wrong with spending money on restaurants if you enjoy it and you're meeting your financial goals. But if you're behind on retirement savings, you will need to make some sacrifices -- and dining out is a good place to start.