Methodology
How DollarsPerGallon sources, refreshes, and calculates everything on the site.
Data source
All prices come from the U.S. Energy Information Administration (EIA) Open Data API, version 2. The EIA is the statistical agency of the U.S. Department of Energy and its data is in the public domain. This site requests data from the API on the server; it never scrapes EIA web pages.
Series used
| Series ID | Description | Frequency | Unit |
|---|---|---|---|
| EMM_EPMR_PTE_NUS_DPG | U.S. average retail price for regular gasoline, all formulations, including taxes | Weekly | U.S. dollars per gallon |
Update frequency
The EIA publishes the weekly national average on Mondays (Tuesdays after federal holidays), typically in the afternoon Eastern time. This site checks for new data roughly every six hours. Every price on the site is labeled with its published data date, and the chart shows when the data was last checked. Weekends and market holidays have no new survey data, so the latest published figure can be a few days old without anything being wrong.
Calculations
- Gallons used per month = monthly miles ÷ vehicle MPG.
- Monthly fuel cost = monthly gallons × price per gallon.
- Annual fuel cost = monthly cost × 12.
- Road-trip gallons = trip distance (doubled for round trips) ÷ vehicle MPG.
- Price-change impact compares monthly cost at your price, at $0.25 more, and at $0.25 less. The reduced price never drops below $0.00.
- Weekly change = latest weekly average minus the prior week. Year-over-year change compares against the closest published week to one year earlier (within three weeks).
Currency and rounding
All figures are U.S. dollars, formatted in U.S. conventions. Gasoline prices are displayed with three decimal places, matching how the EIA publishes them. Calculated costs are rounded to cents. Calculator outputs are estimates; rounding happens at display time, not inside the math.
Missing or revised data
Rows the EIA marks as unavailable, non-numeric values, and malformed records are discarded rather than shown as zeros. If the EIA API cannot be reached, the site shows a clear “data temporarily unavailable” notice instead of stale or placeholder numbers, and the calculators keep working with manually entered prices. The EIA can revise previously published figures; this site always reflects the current published series.
Published data, not real-time quotes
The weekly figure is a national survey average published by the EIA, not a live feed from gas stations. It is the standard reference number for U.S. retail gasoline. For decisions that depend on up-to-the-minute market prices, consult a licensed data provider or exchange.
National average versus local prices
The displayed price is a national average across the United States, including taxes. State taxes, regional fuel formulations, and local competition mean prices in your area can differ from the average by a dollar or more in either direction.