To calculate the cost of gas per mile, or cents per mile, simply divide the total cost of a full tank by the total miles driven. For instance, if it costs $150 to fill your tank and you’ve driven 1,000 miles, then your cents per mile is $0.15.