Gas Cost Calculator

Estimate gasoline needed and fuel cost for a distance you enter. The calculator also shows the cost-per-mile rate implied by your MPG and gasoline price.

Inputs

Result

Gasoline needed
10.0000 US gal
Trip gasoline cost
$35.00
Gasoline cost per mile
0.116667 $/mi

How it is calculated

  1. Trip distance ÷ miles per US gallon
  2. Gasoline needed × price per US gallon
  3. Price per US gallon ÷ miles per US gallon

Resources for your next step

Helpful downloads

View all auto & transportation downloads
Store coming soon

We are preparing practical spreadsheets, planners, and guides. Explore the store page for what is next.

Price the complete distance you intend to drive

Enter the total distance for the trip you want to estimate. The calculator does not assume that a distance is one way and does not add a return journey automatically. If your question concerns a round trip, include both legs in the miles field. Include a planned detour when you deliberately want its fuel cost counted.

This is a manual trip estimate. It does not accept addresses, choose a route or obtain distance from a map. A mileage figure from your own route planning can serve as an input, but the calculation cannot confirm it. For several different driving segments, calculate them individually if you want to apply different fuel-economy or price assumptions.

Keep gallons, MPG and price consistent

MPG here means miles per US gallon. Use that same gallon basis for the entered price. A value stated in miles per Imperial gallon or liters per hundred kilometers needs conversion before it belongs in this field. Enter gasoline price as dollars per US gallon, without a dollar sign or other text in the numeric box.

Use an economy assumption suited to the journey you are studying. If you use a recorded MPG figure, note which driving period it represents. If you use a vehicle rating, treat it as the assumption being tested rather than a measurement of this particular trip. The calculator holds that figure constant throughout the entered distance; it does not adjust it automatically for driving conditions.

Worked example for a 300-mile trip

The example enters 300 miles, 30 miles per US gallon and a gasoline price of $3.50 per gallon. The estimated fuel quantity is 10.0000 US gallons, and the trip's gasoline cost is $35.00. The implied cost-per-mile rate is displayed as $0.116667 per mile, or approximately 11.67 cents per mile.

At the same MPG and price, changing the trip to 600 miles gives 20.0000 gallons and $70.00 of gasoline cost. The cost-per-mile rate stays the same because it depends on MPG and price, not the number of miles being priced. The example price is an editable demonstration value; it is not a statement of today's pump price or a national average.

Distinguish a trip total from a unit rate

The gasoline quantity describes how much fuel the entered distance uses under the MPG assumption. Trip gasoline cost prices that quantity. Cost per mile is a different kind of result: it describes the fuel-price rate implied by the supplied price and economy. Keeping the rate visible helps compare two vehicle or price assumptions without needing to enter the same longer trip repeatedly.

A zero-distance scenario therefore has zero gallons and zero trip cost, while retaining the per-mile rate associated with your MPG and price. That rate is not an extra charge on the zero-mile trip. Likewise, a zero gasoline price gives zero dollar results while still showing the fuel quantity needed for a positive distance. MPG must remain positive in either case.

Keep the fuel estimate separate from other costs

The dollar total covers gasoline only. It does not include tolls, parking, vehicle rental, maintenance, tires, insurance, financing or depreciation. It also does not divide a bill among travelers or make a reimbursement calculation. Use the carpooling tool for a simple shared-fuel-and-fees scenario, and evaluate ownership costs separately when the decision is broader than one trip's gasoline.

The estimated gallons are fuel consumed over the scenario, not necessarily the amount you must purchase at the next stop. Fuel already in the tank and your planned reserve are outside this calculation. There is no tank-capacity, remaining-range or fueling-stop planner, so the result should not be read as a verified statement about how far the current tank can travel.

Check precision and correct invalid entries

Distance may range from zero to 1,000,000 miles. MPG must be greater than zero and no more than 1,000, while gasoline price accepts zero to $100 per US gallon. These broad input limits define the numeric domain, not typical travel or consumption. Blank, nonnumeric, negative or out-of-range values show an input message and clear all three results.

Calculations retain full intermediate precision. Gallons are displayed to four decimal places, trip dollars to two, and the dollar-per-mile rate to six. Multiplying a rounded display value can differ slightly from the calculation that used the original numbers. Valid edits update the results, Calculate requests the calculation explicitly, and Reset to example restores the three demonstration inputs.

Frequently asked questions

Does the distance field include a return trip?

Only when you include those miles yourself. The tool uses exactly the total distance entered and never doubles it automatically. For a round-trip estimate, add the outbound and return distances before calculating.

Which MPG units should I use?

Enter miles per US gallon, paired with a dollar price per US gallon. Imperial MPG and liters per hundred kilometers are different measures. Convert them first rather than entering their numeric values unchanged in the US MPG field.

Why does cost per mile stay positive at zero distance?

It is the implied fuel-cost rate from your entered price and MPG. A zero-mile trip still has zero gallons and zero trip cost. The positive rate simply describes what each mile would cost under those assumptions; it is not a charge added to the trip.

Is the example gasoline price current?

No. The $3.50 example is an editable value used to demonstrate the arithmetic. The calculator does not retrieve a current pump price, national average or vehicle database. Enter the price you want to use for your scenario.

Is this the full cost of driving?

No. It estimates gasoline quantity and gasoline cost only. Parking, tolls, maintenance, insurance, depreciation, payments and other costs are outside the result. Keep those items separate when preparing a complete travel or vehicle budget.

Can I calculate how much fuel to buy?

The gallons result estimates fuel consumed for the entered distance and MPG. It does not consider fuel already in the tank, tank capacity, a reserve or possible stops. Account for those separately when planning purchases rather than treating estimated consumption as an automatic fill-up amount.

Sources

Fuel-only scenario estimate using your supplied distance, US MPG and gasoline price. Other driving costs, current prices, tank contents, routes and actual future consumption are not calculated.

All auto & transportation tools