The answer is, of course... it depends. But with gas prices as high as they are these days, it’s good to know when it’s worthwhile to drive a few miles to save five cents a gallon, or when it’s just better to fill up at the station around the corner.

To determine where you should top off your tank, it’s just a matter of running the numbers. You can figure out at exactly what point traveling to the cheap gas goes from saving you money, to wasting your time.

Things you need to consider:
How many gallons of gas do you need? (G)
What is the gas mileage of your car? (MPG)
What is the cost per gallon of the closer (more expensive) gas? (Cc)
What is the cost per gallon of the further (cheaper) gas? (Cf)
How many miles out of the way is the cheaper gas? (M)

Then you just need to take a look at what the total cost is for filling up your tank with the more expensive gas, versus driving across town to fill your car up with the less expensive offering.

Total Cost of Closer (more expensive) Gas (TCc) is essentially the total number of gallons you need, multiplied by the cost per gallon of the closer gas:

TCc = (G * Cc)

Total Cost of Further (cheaper) Gas (TCf) is determined by the total number of gallons you need, multiplied by the cost per gallon of the further gas, PLUS the number of gallons you will burn while driving to the further station, multiplied by the price per gallon of the gas already in your car.

TCf = (G * Cf) + ((M/MPG) * Cc)

(For this equation, it is assumed that the gas already in your car is from the closer, more expensive station. Even if this is not the case, it is the most conservative way to go… because if it’s cheaper to drive across town to fill up even when burning expensive gas, it’s certainly going to be cheaper to drive across town to fill up if you are burning less expensive gas.)

A quick look at the difference between these two totals will let you know whether it’s worth it to make the drive for the cheaper gas.

Cost Savings = TCc – TCf

or
Cost Savings = (G * Cc) – ((G * Cf) + ((M/MPG) * Cc))

Simple as pie, right?
Well, the concept is simple, but it’s a bit convoluted with nothing but a string of variables to look at. Let’s take a look at a real-life example:

Gallons of gas needed (G): 18
Gas mileage of the car (MPG): 20
Cost per gallon of the closer (more expensive) gas (Cc): \$3.049
Cost per gallon of the further (cheaper) gas (Cf): \$3.000
Miles out of the way for the cheaper gas (M): 4.0

Once again, our cost savings is:

CS = (G * Cc) – ((G * Cf) + ((M/MPG) * Cc))

With the numbers above we get:

CS = (18g * \$3.049/g) – ((18g * \$3.000/g) + ((4.0m/20mpg) * \$3.049/g))
CS = \$54.882 – ((\$54.000 + (.20g * \$3.046/g))
CS = \$54.882 – (\$54.000 + \$0.610)
CS = \$0.27

So, in this case, driving four miles out of our way to the other station saved a total of about 27 cents. Not a huge savings, is it? Especially when you consider that the savings may be even less if the drive to the other station is through stop-and-go traffic to and the car is suddenly getting much less than its average 20 miles per gallon.

And not to be a total environmentalist, but there is the carbon emissions factor to consider too. Every gallon of gas burned produces 19.4 pounds of carbon dioxide, so that 4-mile drive in a 20 mpg car would produce 3.88 lbs of CO2.

I’m not saying it’s never worth it to drive a mile or two to save a buck, but it would be nice to know what the break-even point was for some of the variables in this equation. At what point would it make sense to make the drive, all things considered?

Let’s find out…

Solving for the Cost of the Further (cheaper) Gas
Let’s assume that there is a certain station across town that always offers lower prices, but sometimes the price is lower than others. When is the price low enough to offset the cost of driving over there?

To answer this question, we need to find the break-even point. At what price per gallon at the further station, does the money you save exactly offset the cost of making the drive? Once you determine that, you know that any price offered that is lower than that will save you even more money… and a price per gallon substantially lower will probably save you lots of cash.

So our starting “break-even” equation would look like this:

(G * Cc) = (G * Cf) + ((M/MPG) * Cc)

Solving for Cf:

(G * Cc) – ((M/MPG) * Cc) = (G * Cf)
Cc * (G – (M/MPG)) = (G * Cf)

Cf = (Cc * (G - M/MPG))/G

If we use the numbers from above for our other variables, what is the minimum price the gas across town would need to be for it to be worthwhile to make the drive?

Gallons of gas needed (G): 18
Gas mileage of the car (MPG): 20
Cost per gallon of the closer (more expensive) gas (Cc): \$3.049
Miles out of the way for the cheaper gas (M): 4.0

Cf = (\$3.049/g * (18g – 4m/20mpg))/18g
Cf = (\$3.049/g * (18g – 0.20g))/18g

Cf = \$3.015/g

In other words, if the price per gallon across town is \$3.015 or less, according to these calculations you would officially save some money. To see how your cost savings would increase as the price per gallon drops even further, you can take a look at the following graph:

The graph again shows that the break-even point is at \$3.015/g, and any price below this point will save you money, while any prices above this will actually cost you.

Solving for the Gallons of Gas You Need
Let’s say there’s a station a few miles away that always offers gas for a nickel less per gallon than the stations in your neighborhood. You drive an SUV, and every time you go over and fill up your 30-gallon tank, you save a dollar or two. If it saves you money to make the drive when you need to fill your tank, is it still a deal if you only need a few gallons?

Starting with our break-even equation:

(G * Cc) = (G * Cf) + ((M/MPG) * Cc)

Solving for G:

(G * Cc) – (G * Cf) = (M/MPG) * Cc
G * (Cc – Cf) = (M/MPG) * Cc

G = ((M/MPG) * Cc))/(Cc – Cf)

Once again, using the values of our variables from above:

Gas mileage of the car (MPG): 20
Cost per gallon of the closer (more expensive) gas (Cc): \$3.049
Cost per gallon of the further (cheaper) gas (Cf): \$3.000
Miles out of the way for the cheaper gas (M): 4.0

G = ((4.0m/20mpg) * \$3.049/g))/(\$3.049/g - \$3.000/g)
G = (0.20g * \$3.049/g)/(\$0.049/g)

G = 12.44g

So all other things being equal, as long as you need 12.44 gallons (or more), it’s worth it to make your way across town for the cheaper fuel. But how much will you save as you buy even more?

Again the graph confirms the break-even point, and illustrates how the cost savings changes with the amount of gas purchased.

Solving for the Miles You Should Travel
There are several websites out there that you can use to find the price per gallon at gas stations in your area. But if you find some good deals in the next town over, how may miles exactly does it make sense to go to fill up for a cheaper price?

And once again, with our break-even equation:

(G * Cc) = ((G * Cf) + ((M/MPG) * Cc))

Solving for M:

(G * Cc) – (G * Cf) = (M/MPG) * Cc
(G(Cc – Cf))/Cc = M/MPG

M = (MPG)(G)(Cc-Cf)/Cc

Using our same values from above:

Gallons of gas needed (G): 18
Gas mileage of the car (MPG): 20
Cost per gallon of the closer (more expensive) gas (Cc): \$3.049
Cost per gallon of the further (cheaper) gas (Cf): \$3.000

M = (20mpg)(18g)(\$3.049/g - \$3.000/g)/(\$3.049/g)

M = 5.79m

So, if the distance to the cheaper gas station is 5.79 miles or less, then the trip worth it. But once that odometer clicks over to 5.6 miles, it will officially cost more to drive to get the gas than will be saved by paying the lower price.

So what does all of this math mean? Well, if you were under the impression that you were saving several dollars by driving to the cheaper stations, most likely you are saving just a few nickels and dimes – probably not even enough to buy a slushee when you get there. All things considered, your time is probably better spent pulling into the closest station to buy gas, and getting off the road that much sooner. But since there are so many variables involved, if you are curious as to just what the savings would be for you particular scenario, you can download the spreadsheet here and run the numbers yourself. Clearly, I enjoyed the math… so feel free to plunk some numbers in and calculate to your heart’s content.