Calculate cost per gallon from a total price and volume, find what a number of gallons costs at a given price, or convert price per gallon to per liter.

Optional settings

Calculator Functions

FunctionWhat it doesWhat it requires
Cost per gallonFinds the price per US or Imperial gallon from a total price and a volumeRequires the total cost, the liquid volume and the gallon standard
Total costFinds what a volume of liquid costs at a known price per gallon or per literRequires the price per US gallon, Imperial gallon or liter and the liquid volume
Liquid volumeFinds how much liquid an amount of money buys at a known priceRequires the total cost, the price per US gallon, Imperial gallon or liter and the unit for the answer
Compare two packagesFinds which of two packages has the lower price per gallonRequires the price and volume of each package and the gallon standard

Volumes can be entered in US gallons, Imperial gallons, liters, milliliters, US quarts, US pints, US cups or US fluid ounces. Prices are in US dollars. Each single-price result also lists the cost per US gallon, per Imperial gallon and per liter.

Cost Per Gallon Formulas

CPG = C ÷ V
CPGCost per gallon ($ per gallon)
CTotal cost ($)
VLiquid volume, in gallons of the chosen standard

A volume in another unit is converted to gallons first. One US gallon is 3.785412 liters and one Imperial gallon is 4.54609 liters [1], so a price per Imperial gallon is about 20% higher than the price per US gallon for the same liquid. A US fluid ounce is 29.57353 mL [1], which makes 128 fluid ounces to the US gallon.

Cost per gallon

The main formula applies directly. If 100 US gallons cost $50.00, the cost is 50 ÷ 100 = $0.50 per US gallon, which is $0.60 per Imperial gallon and $0.132 per liter. Seven gallons of milk for $24.50 cost $3.50 per gallon.

Total cost

C = CPG × V

The price is multiplied by the volume, with both put on the same unit. Ten gallons at $3.50 per gallon cost $35.00.

Liquid volume

V = C ÷ CPG

The total cost is divided by the price, and the answer is converted to the chosen unit. At $3.49 per US gallon, $60.00 buys 60 ÷ 3.49 = 17.19 US gallons, or 65.08 liters. The price must be greater than zero.

Compare two packages

Each package price is divided by its volume in gallons, and the lower result wins. A 16.9 fl oz bottle at $1.29 costs 1.29 ÷ 16.9 × 128 = $9.77 per US gallon. A 1 gallon jug at $4.99 costs $4.99 per gallon, so the jug is $4.78 per gallon cheaper, a saving of 48.9% against the bottle.

Limits of This Estimate

  • US and Imperial gallons differ by about 20%. A price per gallon can mean either one, so the gallon standard has to match the price being compared.
  • The comparison looks at unit price only. Quality, package waste, deposits and sales tax are not part of it.
  • Results are shown to the cent or, for small unit prices, to three decimal places. Fuel prices that end in nine-tenths of a cent are entered as decimals, such as 3.499.

Sources

  1. NIST, Guide to the SI (SP 811), Appendix B.8: liters in a US gallon and an Imperial gallon, and the size of a US fluid ounce