The basic formula for gas cost

To find out how much a trip costs in gas, divide the distance you drove by how many miles your car gets per gallon, then multiply by the price per gallon. The formula is: (miles driven ÷ miles per gallon) × price per gallon = gas cost.

For example: if you drove 150 miles, your car gets 25 miles per gallon, and gas costs $3.50 per gallon, the math is (150 ÷ 25) × $3.50 = 6 gallons × $3.50 = $21 for that trip.

You need three pieces of information to make this work: the distance, your car's fuel economy, and the current gas price. Each one affects the answer, and small changes in any of them shift your total cost.

Key Takeaways

  • Gas cost per trip = (miles driven ÷ miles per gallon) × price per gallon.
  • Your car's actual miles per gallon depends on driving conditions, speed, and maintenance — highway driving uses less fuel than city driving.
  • You can find your fuel economy on the window sticker from when the car was new, in the owner's manual, or by calculating it yourself at the pump.
  • Gas prices change daily, so a trip that costs $20 one week might cost $22 the next week at the same distance.
  • Tracking gas cost per mile helps you compare vehicles, plan budgets, and spot when maintenance problems are hurting your fuel economy.

Finding your car's miles per gallon

Your car's fuel economy is listed as miles per gallon (MPG). You need this number to calculate gas cost. The most reliable source is your car's window sticker from the dealership — it shows EPA estimates for city, highway, and combined driving. If you no longer have that sticker, check your owner's manual or search your vehicle's year, make, and model on fueleconomy.gov, which is run by the EPA and has data on nearly every car sold in the United States.

The EPA gives you three numbers: city MPG (stop-and-go driving), highway MPG (steady speeds on interstates), and combined MPG (a blend of both). For most trips, use the combined number. If you drive mostly on highways, use the highway number; if you drive mostly in cities, use the city number.

You can also calculate your own fuel economy by filling your tank completely, driving until you need gas again, then dividing the miles on your odometer by the gallons you pumped. Do this a few times to get an average, because one fill-up might not be typical. This method shows you your real-world MPG, which often differs from EPA estimates because of your driving habits, road conditions, and how well your car is maintained.

Getting the current gas price

Gas prices change daily and vary by location. Check the price at the pump where you actually buy gas, or use GasBuddy, which shows prices reported by drivers at stations near you. If you are planning a trip and want to estimate cost, use the current average price in your area — search "gas prices near me" and your phone will show local stations.

For budgeting over time, use the average price you actually pay. If you fill up at the same station most weeks, that price is more useful than a national average. Some people track their gas receipts for a month and divide total spent by total gallons to find their average cost per gallon.

Calculating cost per mile

Cost per mile tells you how much fuel expense you rack up for every mile driven. This is useful for comparing two cars, budgeting for a long trip, or tracking whether your fuel economy is getting worse. The formula is straightforward: price per gallon ÷ miles per gallon = cost per mile.

If gas is $3.50 per gallon and your car gets 25 MPG, your cost per mile is $3.50 ÷ 25 = $0.14 per mile. A 100-mile trip costs 100 × $0.14 = $14 in gas. If gas rises to $4.00 per gallon, that same trip costs 100 × ($4.00 ÷ 25) = 100 × $0.16 = $16.

Tracking cost per mile over months can show you when your fuel economy drops — a sign that your engine needs service, your tires are underinflated, or your air filter is clogged. If your cost per mile jumps from $0.14 to $0.18, your MPG has fallen, and maintenance may help.

Why your actual fuel economy varies

EPA estimates are averages. Your real MPG depends on how you drive, where you drive, and the condition of your car. Highway driving at steady speeds uses less fuel than city driving with frequent stops and starts. Idling, aggressive acceleration, and high speeds all burn more gas. Cold weather reduces MPG because engines run less efficiently and tire pressure drops.

Maintenance matters too. Underinflated tires, a dirty air filter, worn spark plugs, and low engine oil all hurt fuel economy. A car that is out of alignment or has a dragging brake will use more gas. If your calculated MPG drops noticeably from what it used to be, have a mechanic check these items.

For the most accurate gas cost calculation, use your own measured fuel economy rather than EPA estimates. Track it over several fill-ups to smooth out the variation from one trip to another.

Planning gas cost for a long trip

Before a road trip, multiply the total distance by your cost per mile. If you are driving 500 miles and your cost per mile is $0.14, budget $70 for gas. Add a buffer of 10 to 15 percent because highway driving may differ from your usual mix, and prices might change.

Break the trip into segments and check gas prices along your route. Some regions have higher prices than others. If you know you are entering an expensive area, fill up before you get there. Apps like GasBuddy let you see prices at stations along your planned route.

Remember that towing a trailer, carrying heavy cargo, or driving in mountains increases fuel consumption. If any of these explore to your trip, add another 10 to 20 percent to your estimate.

Using online calculators and spreadsheets

You can do this math by hand, but a spreadsheet or online calculator saves time if you track multiple trips. Create a straightforward spreadsheet with columns for date, miles driven, gallons pumped, price per gallon, and total cost. Divide total cost by miles driven to find your average cost per mile. Over time, this shows trends in your fuel economy and spending.

Many fuel tracking apps exist, though most are designed for business mileage deductions rather than personal budgeting. A basic spreadsheet works just as well and keeps your data private. Some people use the notes app on their phone to jot down odometer and price at each fill-up, then calculate later.

Frequently Asked Questions

Does my car's actual MPG match the EPA sticker?

Rarely. EPA estimates assume ideal conditions and moderate driving. Most people see 10 to 20 percent lower MPG in real life, especially in cities or in winter. Your actual MPG depends on your driving habits, traffic, weather, and how well your car is maintained. Calculate your own MPG at the pump to know what to budget.

How do I know if my fuel economy is getting worse?

Track your cost per mile over several months. If it rises while gas prices stay the same, your MPG has dropped. Common causes are underinflated tires, a clogged air filter, worn spark plugs, or engine problems. Have a mechanic inspect your car if the change is sudden or large.

Should I use city or highway MPG for my calculation?

Use combined MPG for most trips, since most driving mixes both types. If your trip is almost entirely highway, use highway MPG. If it is almost entirely city, use city MPG. For a typical commute with some of each, combined is most accurate.

Does driving faster use more gas?

Yes. Fuel economy drops significantly above 50 mph. Driving at 70 mph instead of 55 mph can reduce your MPG by 15 to 20 percent, which raises your gas cost per mile. Slower, steady driving saves fuel.

Can I improve my fuel economy to lower gas costs?

Yes. Keep tires inflated to the pressure listed on your driver's door jamb, not the maximum on the tire itself. Replace a clogged air filter. Avoid idling and aggressive acceleration. Remove heavy items from your trunk. Drive at steady speeds on highways. These steps can improve MPG by 5 to 15 percent depending on your current habits.