A small correction on this. For ATM withdrawals, purchases and cash advances on debit and credit cards, the actual foreign exchange rate is set by Visa and MasterCard, not the issuing banks. They do the exchange and then bill your home country bank in its own currency.
The rates Visa and Mastercard use can be found at:
https://usa.visa.com/support/consumer/travel-support/exchange-rate-calculator.html
https://www.mastercard.us/en-us/personal/get-support/convert-currency.html
To get the correct rate remember to convert from the currency you withdrew from the ATM to your home currency.... not vice versa.
You may also have to adjust the fee percentage per your card's terms and conditions.