Estimate Gas Cost
In this lesson, you will learn
- What an MPG rating such as 20 CITY / 30 HWY means
- How the gas cost formula is built from a ratio
- How to estimate the cost of gas for city and highway driving
What Does an MPG Rating Like 20 CITY / 30 HWY Mean?
To estimate gas cost, we will derive a simple formula. To improve accuracy and practicality, the formula and the calculator below will include city miles and highway miles.
Usually, you will see MPG (miles per gallon) rating as 20 CITY / 30 HWY.
This means that your vehicle will give you 20 miles per gallon driving in the city and 30 miles per gallon driving on the highway.

A car is rated 25 CITY / 35 HWY. How many miles can it drive on the highway with 1 gallon?
Show answer
35 miles. HWY is the highway rating: 35 miles per gallon.
Building the Gas Cost Formula Step by Step
To derive our formula, the strategy we will use is to see how much money you spend on gas per mile. This situation can be expressed as dollars per mile.
Say the cost of gas is 3 dollars per gallon and the efficiency of your vehicle is 20 CITY / 30 HWY.
Let us just work with the efficiency on the highway for now.
Look at the following ratio. It is a ratio of the cost of gas to the fuel efficiency of your specific vehicle.
3 dollars per gallon30 miles per gallon
3 dollars30 miles
Since gallon is on top and at the bottom, it will cancel in the ratio.
Now the ratio gives you the money spent per 30 miles.
To calculate money spent on gas for driving 90 miles, just multiply the ratio immediately above by 90.
3 dollars30 miles × 90 miles (equation 1)
We get
3 dollars × 90 miles30 miles
We get
270 dollars30 = 9 dollars
330 = 0.10, so this car spends $0.10 on gas for every mile on the highway. 90 miles cost 90 × $0.10 = $9.
The Gas Cost Formula for City and Highway Driving
Let us make a generalization of equation 1 above.
Suppose gas price is x and the efficiency of your vehicle is c CITY / h HWY.
Notice that in c CITY / h HWY, c is city efficiency and h is highway efficiency.
In our example above c = 20 miles per gallon and h = 30 miles per gallon.
D is the distance you drive your car on the highway.
The cost of gas on the highway is xh × D
If d is the distance you drive in the city,
The cost of gas in the city is xc × d
Example:
Estimate gas cost if gas price is 3 dollars, your vehicle efficiency is 20 CITY / 30 HWY, and you drive 30 miles on the highway and 10 miles in the city.
Just plug in the numbers in the formula.
Total cost of gas = 330 × 30 + 320 × 10
Total cost of gas = 9030 + 3020
Total cost of gas = 3 + 1.5 = 4.5 dollars
Using the wrong rating. Highway miles go with the highway rating h, and city miles go with the city rating c. Dividing the city miles by the highway rating makes the city part too cheap.
- Highway: x = 4, h = 40, D = 120. Cost = 440 × 120 = 0.10 × 120 = $12.
- City: x = 4, c = 25, d = 50. Cost = 425 × 50 = 0.16 × 50 = $8.
- Add the two parts: 12 + 8 = 20.
Total cost of gas = $20
Gas costs $3.50 a gallon and the car gets 30 MPG on the highway. What does a 60-mile highway trip cost?
Show answer
$7. 3.5030 × 60 = 3.50 × 2 = 7.
Interactive Gas Cost Calculator: Plan Your Trip
The following calculator will estimate the cost of gas for any trip. You can use it as a trip planner. It shows every step of the formula.
Highway
City
Summary
- An MPG rating such as 20 CITY / 30 HWY gives the miles per gallon in the city and on the highway.
- Gas price ÷ MPG gives the cost per mile, because the gallons cancel: 330 = $0.10 per mile.
- Total cost of gas = xh × D + xc × d, with highway miles D and city miles d.
- Always pair highway miles with the highway rating and city miles with the city rating.
Test Yourself: Interactive 10-Question Quiz
Now check what you learned. Every answer is explained, and each time you play you get new questions.
Quiz Complete!