Fuel Refill and Tank Range

Calculate using the labelled inputs: Fuel Refill and Tank Range.

Initial fuel (liters)
11
Fuel after refill (liters)
51
Remaining tank space (liters)
4
Refill cost
71.20
Estimated range before refill (km)
137.5
Estimated range after refill (km)
637.5
Maximum addition from the initial level (liters)
44

Calculation and assumptions

initial_liters=capacity·initial_pct/100; after=initial_liters+added; cost=round(added·price,2); range=100·liters/consumption.

An addition exceeding free capacity is rejected, rather than billed and silently capped. Range assumes constant entered consumption and all fuel usable: no reserve, traffic, weather or dashboard calibration model. Volumes, fill percentage, consumption and price allow six decimals. Cost rounds once to cents, halves away from zero. Zero addition and zero price are valid. Only liters and km are used; no current pump price is supplied. In one chosen two-decimal currency; no taxes or current market rates are supplied.

Frequently asked questions

How is the result calculated?

initial_liters=capacity·initial_pct/100; after=initial_liters+added; cost=round(added·price,2); range=100·liters/consumption.

What assumptions apply?

An addition exceeding free capacity is rejected, rather than billed and silently capped. Range assumes constant entered consumption and all fuel usable: no reserve, traffic, weather or dashboard calibration model. Volumes, fill percentage, consumption and price allow six decimals. Cost rounds once to cents, halves away from zero. Zero addition and zero price are valid. Only liters and km are used; no current pump price is supplied. In one chosen two-decimal currency; no taxes or current market rates are supplied.

How precise are the results?

Monetary totals use two decimal places with the stated rounding rule; other numbers show up to ten significant digits. Display precision does not improve input accuracy.

How we verified this calculator

The calculator is checked against 6 reference cases computed independently of its code. Last passed: .

# Inputs Expected result
1
Tank capacity (liters) = 55
Initial fill (%) = 20
Fuel added (liters) = 40
Entered price per liter = 1.78
Entered consumption (L/100 km) = 8
Initial fuel (liters): 11
Fuel after refill (liters): 51
Remaining tank space (liters): 4
Refill cost: 71.20
2
Tank capacity (liters) = 55
Initial fill (%) = 20
Fuel added (liters) = 44
Entered price per liter = 1.78
Entered consumption (L/100 km) = 8
Initial fuel (liters): 11
Fuel after refill (liters): 55
Remaining tank space (liters): 0
Refill cost: 78.32
3
Tank capacity (liters) = 47.5
Initial fill (%) = 33.3
Fuel added (liters) = 12.34
Entered price per liter = 1.899
Entered consumption (L/100 km) = 6.4
Initial fuel (liters): 15.8175
Fuel after refill (liters): 28.1575
Remaining tank space (liters): 19.3425
Refill cost: 23.43
4
Tank capacity (liters) = 60
Initial fill (%) = 100
Fuel added (liters) = 0
Entered price per liter = 2
Entered consumption (L/100 km) = 5.5
Initial fuel (liters): 60
Fuel after refill (liters): 60
Remaining tank space (liters): 0
Refill cost: 0.00
5
Tank capacity (liters) = 0.5
Initial fill (%) = 0
Fuel added (liters) = 0.5
Entered price per liter = 0
Entered consumption (L/100 km) = 0.1
Initial fuel (liters): 0
Fuel after refill (liters): 0.5
Remaining tank space (liters): 0
Refill cost: 0.00
6
Tank capacity (liters) = 70
Initial fill (%) = 12.5
Fuel added (liters) = 0.005
Entered price per liter = 0.999
Entered consumption (L/100 km) = 9.75
Initial fuel (liters): 8.75
Fuel after refill (liters): 8.755
Remaining tank space (liters): 61.245
Refill cost: 0.00

How we test our calculators →

Also try:

Back to category →