Gas Calculator
Auto & TravelEnter the miles, your car's miles per gallon and the price of gas to see how many gallons you need and what they cost, for one trip or for a month of driving. You can also split the bill between riders or find your gas mileage (mpg) from a fill-up.
Step by step
250 mi / 25 mpg × $3.50 = $35.00
- Distance: 250 miles one way, 250 miles in total.
- Gas needed = miles / mpg = 250 / 25 = 10 gallons.
- Cost = gallons × price per gallon = 10 × $3.50 = $35.00.
- Cost per person = $35.00 / 1 = $35.00.
- Cost per mile = $3.50 / 25 mpg = $0.140.
Once every entry is valid, you’ll see each step of the calculation here.
Formula
- miles
- the distance driven, counted twice for a round trip
- mpg
- miles per gallon, how many miles the car goes on one gallon of gas
- price per gallon
- the price on the pump sign, in dollars per US gallon
- people
- the number of riders who share the cost equally
- 52 and 12
- weeks in a year and months in a year, to turn a week of driving into a month
- gallons added
- the gallons the pump shows when you fill the tank to the same level as before
- 235.2146
- liters per 100 km for a car that gets 1 mpg, from the definitions of the gallon and the mile
How it works
Figuring out the gas cost of a trip takes two steps. First find the gallons: gallons = miles ÷ miles per gallon. Then price them: cost = gallons × price per gallon. A 250-mile drive in a car that gets 25 mpg uses 10 gallons, and at $3.50 a gallon that costs $35.00, or $0.14 for every mile. Turn on the round-trip option to count the drive back, which doubles the miles, and enter the number of riders to divide the bill: split between two people, the $35.00 is $17.50 each.
For a month of driving, switch to the monthly option and enter the miles you drive on a driving day and the days a week you drive. The calculator turns that into miles per month (miles per day × days per week × 52 weeks ÷ 12 months), then into gallons and cost, and it shows the yearly cost too. A commute of 15 miles each way, five days a week, is 30 miles a day and 650 miles a month, which is 26 gallons at 25 mpg. For comparison, the EPA assumes that the average gasoline vehicle on the road gets about 22.2 mpg and drives around 11,500 miles a year, which is roughly 960 miles a month.
If you do not know your mpg, the third option finds it from a fill-up. Fill the tank, reset the trip meter, drive as usual, then fill the tank to the same level again: mpg = miles driven ÷ gallons added. A figure from your own driving is usually closer than a sticker figure, because real-world mpg changes with speed, traffic, load and weather. The estimate leaves out tolls, parking, wear and tear and any change in the price of gas along the way. For distances in kilometers use the km to miles converter, and for pump prices per liter the gallons to liters converter.
The formula
The cost per mile is the price per gallon divided by the mpg, so it does not depend on the distance: $3.50 at 25 mpg is $0.14 a mile. That makes it the simplest way to compare two cars or two fuels. A car that gets 40 mpg on $4.00 gas costs $0.10 a mile, and a car that gets 20 mpg on $3.00 gas costs $0.15 a mile, so the cheaper gas does not make the thirstier car cheaper to drive.
The metric figure uses the exact definitions. A US gallon is 3.785411784 liters and a mile is 1.609344 km, so L/100 km = 100 × 3.785411784 / (1.609344 × mpg), which is 235.2146 / mpg. NIST rounds that constant to 235.215. A car that gets 25 mpg uses 9.41 liters per 100 km.
Example
Two friends drive 250 miles to a lake in a car that gets 25 mpg. Gas costs $3.50 a gallon. What does the gas cost, and what is each share?
- Gallons needed: 250 miles / 25 mpg = 10 gallons.
- Cost: 10 gallons × $3.50 = $35.00, which is $0.140 per mile.
- Each share: $35.00 / 2 people = $17.50. The drive back would double the miles, the gallons and the cost.
To drive 250 miles at 25 mpg you need 10 gallons of gas, which costs $35.00 at $3.50 a gallon, or $17.50 each when 2 people share it.
Load this example into the calculatorFrequently asked questions
How do I calculate fuel cost for my car?
Divide the miles you will drive by your car's miles per gallon to get the gallons, then multiply the gallons by the price of a gallon. For 250 miles at 25 mpg and $3.50 a gallon, that is 250 ÷ 25 = 10 gallons and 10 × $3.50 = $35.00. Another way to see it: the cost per mile is the price divided by the mpg, here $0.14, so any distance costs that rate times the miles.
How many gallons of gas do I need for a trip?
Divide the total miles by your mpg. A 500-mile drive needs 20 gallons at 25 mpg, 16.7 gallons at 30 mpg and 25 gallons at 20 mpg. Count the drive back if you are returning, and leave some margin if you expect hills, heavy traffic or a full load.
How accurate are the fuel prices?
This calculator does not load prices, so it uses exactly the price per gallon you type. The result is only as accurate as that price and your mpg. Prices differ between stations and move over time, so use the price on the sign where you plan to buy, and look at the price chart under the calculator to see what the same gallons cost at higher prices.
How often are fuel prices updated?
Never, because the page keeps no price list. You enter the price yourself, so the result is as current as the number you type. Check the pump sign or a price comparison app before you leave, and change the price field if it moves. The price chart shows the cost of the same gallons at prices from $2.50 to $7.00.
Can I calculate fuel costs for international trips?
Yes, once you convert to miles, mpg and a price per US gallon. Divide kilometers by 1.609 to get miles, divide 235.215 by a L/100 km figure to get mpg (7.84 L/100 km is 30 mpg) and multiply a price per liter by 3.785 (1.50 per liter is 5.68 per gallon). UK mpg figures count imperial gallons of 4.546 liters, so the same car shows a number about 20% higher in UK mpg than in US mpg.
Which fuel types are supported?
Any fuel you buy by the gallon: regular, midgrade or premium gasoline, or diesel. Enter the price per gallon of the fuel you use and the mpg you get on it. Electric cars use kilowatt-hours instead of gallons, so they need the calculation in the electric vehicle answer below.
What is the best fuel efficiency for long trips?
The highest mpg your car actually gets at steady highway speeds, since a higher mpg means fewer gallons for the same miles: 500 miles take 25 gallons at 20 mpg but only 16.7 gallons at 30 mpg. For the estimate, use the highway estimate on the EPA label of a new car, or your own mpg from a fill-up on a similar drive, rather than the city figure.
How do I find the cheapest fuel prices near me?
This calculator cannot look up local prices because it has no location data. Read the price signs along your route or use a price comparison app, then type the prices into the calculator. To see what a cheaper station saves, run both prices: on a 12-gallon fill-up, a price that is 20 cents lower saves $2.40.
Can I plan a road trip with multiple stops?
Yes. Gas depends only on the total miles, not on the stops, so add up every leg, including the drive home, and enter the sum as the distance. If the legs have very different mpg, such as city streets and highway, run each leg on its own and add the costs. If gas prices differ along the route, enter an average price.
How accurate is the mileage calculation?
The arithmetic is exact, so the estimate is as good as the mpg you enter. Real-world mpg changes with speed, hills, traffic, weather, load and how you drive, so a label figure can be off. For a better number, use the fill-up option to measure your own mpg over a few tanks and enter that figure. Tolls and parking are not included.
What is the difference between petrol and diesel costs?
Petrol is the British word for gasoline. The two fuels have their own price per gallon, and a car has its own mpg on each, so the fair comparison is the cost per mile, which is the price per gallon divided by the mpg. Run the calculator once with the gasoline price and mpg and once with the diesel price and mpg, then compare the cost per mile.
How do I calculate electric vehicle charging costs?
An electric car uses kilowatt-hours instead of gallons. Multiply the kWh the car uses per mile by the price of a kWh. For example, a car that uses 0.3 kWh per mile on electricity at $0.17 per kWh costs about $0.05 a mile, so 250 miles cost about $12.75. This calculator is built for gallons, so it does not do that math for you.
What factors affect fuel consumption?
The main ones are how fast and how smoothly you drive, hills and traffic, the weight you carry, tire pressure, the weather and the fuel itself. The EPA notes that gasoline with up to 10% ethanol (E10) gives slightly lower fuel economy than gasoline without ethanol. Because these change from trip to trip, treat the result as an estimate and measure your own mpg over several tanks.
How do I calculate my car's gas mileage?
The easiest way is the fill-up option in this calculator. Fill the tank, reset the trip meter, drive as you normally do, then fill the tank to the same level and note the gallons. Miles divided by gallons is your gas mileage in miles per gallon (mpg). For a new car, the fuel economy label lists EPA city and highway estimates, which you can use until you have a figure of your own.
How much does it cost per mile to drive?
The gas part of the cost per mile is the price per gallon divided by the mpg: $3.50 at 25 mpg is $0.14 a mile, $3.50 at 35 mpg is $0.10 and $4.50 at 18 mpg is $0.25. The chart of mpg values shows the cost per mile at your gas price. Gas is only part of the cost of driving, which also includes insurance, maintenance, tires and depreciation.
How do I split gas costs between passengers?
Enter the number of people sharing the cost, including the driver, and the calculator divides the total by that number. Two people sharing a $35.00 trip pay $17.50 each, and four people pay $8.75 each. The cost per mile in the results helps if a rider joins for only part of the route.
How do I calculate monthly gas cost?
Choose the monthly option. Enter the miles you drive on a driving day, the driving days per week, your mpg and the gas price. The calculator multiplies the miles by the days and by 52 weeks, divides by 12 months, divides by the mpg to get gallons and multiplies by the price. Driving 30 miles a day, five days a week, at 25 mpg and $3.50 a gallon comes to 26 gallons and $91.00 a month.
- NIST Guide to the SI, Appendix B.8: Factors for Units Listed Alphabetically (gallon, mile, miles per gallon to liters per 100 kilometers) (National Institute of Standards and Technology)
- Greenhouse Gas Emissions from a Typical Passenger Vehicle (average fuel economy of about 22.2 mpg, about 11,500 miles a year, E10 gasoline) (U.S. Environmental Protection Agency)
- Basic Information on Fuel Economy Labeling (city and highway estimates on the label of new cars and light trucks) (U.S. Environmental Protection Agency)