US stations sell the US gallon (3.785 litres). UK and many EU apps store litres. Import a British log without converting and every MPG figure is wrong, even if the miles are right.
MPG = miles ÷ US gallons. Trip cost = gallons × price per gallon. Cost per mile is the number that makes two vehicles comparable when one is a hybrid and one is a truck.
Full tanks only
Partial fill-ups smear the average. Two consecutive full tanks and the miles between them are the clean method. Use the US MPG calculator, then set miles and gallons in CarDiary so the app labels consumption as MPG, not L/100km.