Inputs
Capacity Rating of Battery
mAH
Consumption of device (Load Current)
mA
Output
Battery Life
Capacity: Measured in ampere-hours, the capacity of a battery can usually be found printed on the battery casing.
Consumption: The average current draw of the electronic device, expressed in amperes.
Discharge Safety: The percentage of the battery that is not utilized.
Equations
$$Battery life = Capacity / consumption X (1 - discharge safety)$$
Application
This calculator computes the amount of time for which a battery can supply power to a given circuit.