Philadelphia-area consumers are paying some of the highest overdraft and ATM fees in the country, according to a survey released Wednesday.

The Philadelphia region had the highest average overdraft fee — $35.50 — among the 25 largest metropolitan markets in the country, according to a survey of 250 banks and thrifts by Bankrate.com, a personal finance website. That is up slightly from the region’s average of $35.30 last year. Nationwide, the average overdraft fee was $33.36, up slightly from a year ago and just shy of the record $33.38 set in 2017.

The Philly region also had the fifth-highest average out-of-network ATM withdrawal fee ($5.11), which reflects surcharges from the ATM operator and the consumer’s financial institution. Last year, the region’s average was $4.91, which was the eighth-highest in the country. The nationwide average this year was a record high of $4.72, according to the report. The all-in fee is up 33 percent over the last decade nationwide, Bankrate.com said.

While banks are charging non-customers more than ever to use their ATMs ($3.09), fees charged by consumers’ own banks for using another institution’s ATM dropped 3 cents to $1.63, the report said. In addition, the number of accounts allowing free out-of-network withdrawals is at a record high, but that still represents less than one-third of the accounts surveyed.

To avoid overdraft fees, consumers should link their checking and savings accounts at the same bank, so money can immediately be transferred to the checking account if it’s overdrawn, said Greg McBride, Bankrate.com’s chief financial analyst.

As for out-of-network ATM fees, McBride said many smaller banks and credit unions belong to nationwide fee-free alliances that have large ATM networks.

“One other option to withdraw money for free is to get cash back at the point of sale when using a debit card. Banks don’t charge for that, and very few merchants do either,” he said.

Bankrate.com surveyed 10 banks and thrifts in each of the 25 large U.S. markets during the month of July.