Skip to content
miMilemathFuel and electricity, not the car payment

Methodology and sources

The calculator and every comparison page use one set of formulas. Nothing here is a forecast of future prices, and nothing here is a government estimate.

Economy ratings

Vehicle rows come from the FuelEconomy.gov vehicles.csv file published by the U.S. Department of Energy and the EPA. This build keeps model years 2015 through 2027: 16,331 rows. Courtesy of FuelEconomy.gov, U.S. Department of Energy.

Gasoline, diesel, and non-plug-in hybrids use the city and highway mpg on the row. Miles are split by the city percentage you set. Gallons are city miles divided by city mpg, plus highway miles divided by highway mpg. The default mix is 55% city and 45% highway, which is the weighting behind the EPA combined rating. Flex-fuel rows are priced on gasoline, not E85.

Electric vehicles use kilowatt-hours per 100 miles (cityE, highwayE, falling back to combE if a cycle is missing). The rating in MPGe is shown for reference. It is not treated as gallons.

Plug-in hybrids use the EPA utility factor (cityUF and highwayUF). That factor is the share of miles the EPA expects the car to cover in charge-depleting mode if it starts each day with a full battery. Those miles are costed as electricity at the kWh/100 mi rate. The remaining miles use the charge-sustaining gasoline mpg. If the file reports charge-depleting gasoline (cityCD / highwayCD), those gallons are added. Several blended plug-ins in the current file report that gasoline figure as zero; the page says so, because real cost would be higher if the engine runs while the battery depletes.

Prices

Gasoline and diesel week ending 2026-11-30. Residential electricity September 2026. public EIA workbook snapshot. Source: U.S. Energy Information Administration. Weekly retail gasoline, all formulations, week ending 2026-11-30. On-highway ultra-low-sulfur diesel, week ending 2026-11-30. Public EIA workbooks, not a live API call. Residential price by state, September 2026 (preliminary when EIA marks the year preliminary). Public workbook snapshot, not a live API call.

Regular, midgrade, and premium gasoline follow the fuel the EPA row requires. States that have their own weekly series in the EIA workbook — California, Colorado, Florida, Massachusetts, Minnesota, New York, Ohio, Texas, and Washington — use that series. Other states use their PADD region (New England, Central Atlantic, Lower Atlantic, Midwest, Gulf Coast, Rocky Mountain, or West Coast). The West Coast series includes California, so it is a rough stand-in for Oregon, Nevada, Arizona, Alaska, and Hawaii gasoline.

Diesel uses the weekly on-highway ultra-low-sulfur series. California has its own diesel price. Other West Coast states use the West Coast except California series. Everyone else uses the PADD diesel price. Residential electricity is the state figure from EIA Electric Power Monthly Table 5.6.A, in cents per kilowatt-hour, divided by 100 when it is applied to a bill. A custom price replaces the EIA number and is labeled as custom.

The five-year total is five times the annual cost. It holds prices and driving constant. It is there so a small annual gap is visible over a typical ownership stretch, not because anyone knows the 2031 diesel price.

What is left out

  • Purchase price, tax credits, insurance, maintenance, tires, and depreciation.
  • Towing, roof cargo, winter temperatures, and driving faster than the EPA highway cycle.
  • Public fast charging and special overnight EV rates. Use the custom electricity field for those.
  • Hydrogen and natural gas, unless you enter a price per gasoline-gallon equivalent. The EPA figure for those fuels is MPGe.

Sources

Milemath does not use manufacturer photographs. Mention of a brand is a description of an EPA row, not an endorsement, and not a claim that the government endorses this site. Rebuild steps and the price-file date live in the project README.

Back to the calculator

Questions

Does this include the car payment?

No. Milemath is energy only: gallons of gasoline or diesel, and kilowatt-hours. Purchase price, insurance, maintenance, registration, and depreciation are outside the model.

Why can two trims of the same name differ so much?

FuelEconomy.gov files many rows per model name. All-wheel drive, wheel size, a performance tune, and a hybrid system each get their own city and highway numbers. The calculator and the comparison pages name the row.

What if I fast-charge an EV?

The default electricity price is the EIA residential average. Public fast charging is usually more expensive. Enter your own cents per kilowatt-hour if that is the rate you actually pay.