Matching units on B and C
Fuel used = distance ÷ economy, where economy is distance travelled per one unit of fuel (km/L, miles per gallon, etc.). Cost = fuel used × price per that same fuel unit. If economy is 0, the tool returns Invalid.
mpg and L/100 km are not auto-converted — express economy the way your dashboard or sticker shows it, then price fuel in the matching volume unit.
Related length math
Distances in miles versus kilometres can be converted first with the length unit converter if your economy figure uses a different distance unit than your odometer.
Questions
Does it include tolls or wear?
No — only fuel volume implied by economy and the price you enter.