If you've been to an ATM recently to withdraw cash, you may have noticed the fee has gone up.

Kevork Djansezian, Getty Images

ATM fees have reached an all-time high and many banks are doing away with free checking accounts, according to Bankrate.com.

"It's not only ATM fees and overdraft fees that have gone up. We've also seen monthly service charges on checking accounts and the balance requirements to avoid those fees hit record highs," said Greg McBride, senior financial analyst for Bankrate.com. "Free checking also is declining. Back in 2009, 76 percent of non-interest accounts were available for free. That's down to just 39 percent now."

"Recent regulatory changes have left banks with a big revenue gap that needs to be filled, so they're resorting to higher fees and doing away with free checking accounts in an effort to fill that gap," said McBride. "We also continue to see ATM fees go up year-in and year-out because that cost has typically been born by non-account holders. But, people are getting smarter about their ATM usage and are increasingly using their own banks. So, that cost is being spread over fewer people. As a result, banks are hiking those fees up."

When going an out-of-network ATM, you'll typically pay the ATM owner a fee and then your own bank will charge you a fee for using a competitor. "The average you pay the ATM owner has gone up four percent to $2.50. The fee that you pay your own bank is up 11 percent, averaging $1.57," said McBride. "So, you can very easily spend four dollars or more for one out-of-network ATM withdrawal."

So, what's a customer to do? "ATM fees are completely avoidable. Limit your withdrawals to your own bank. You can scout out the locations of free ATMs, plan ahead so you can go to an in-network ATM. And if you're really in a pinch for cash, you can always get cash back at the point of sale when you use your debit card," said McBride.