Understanding the battery life calculator — concept and principle
This calculator estimates how long a battery will power a device from its rated capacity in milliamp-hours (mAh) and the device's average current draw. It is useful for sizing batteries for sensors, remote controls, IoT nodes, flashlights and portable gadgets, or for comparing two battery options before you buy.
How it is calculated
- Run time (hours): t = capacity (mAh) × usable fraction ÷ average current (mA).
- Days: t ÷ 24.
The usable fraction (for example 85%) discounts the rated capacity for real-world losses: cut-off voltage, temperature, ageing and the fact that rated capacity is measured under gentle test conditions. Capacity and current must use the same unit (mAh with mA, or Ah with A).
The principle
A milliamp-hour is a quantity of electric charge: 1 mAh is a current of 1 mA flowing for one hour (3.6 coulombs). If a battery can deliver a certain charge and the device takes charge at a steady average rate, the time it lasts is simply charge divided by rate. For devices that sleep and wake, use the time-weighted average current: (I_active × t_active + I_sleep × t_sleep) ÷ total time.
Worked example
- Inputs: capacity 2000 mAh, average current 50 mA, usable fraction 85%.
- Usable charge = 2000 × 0.85 = 1700 mAh.
- Run time = 1700 ÷ 50 = 34 h.
- Days = 34 ÷ 24 = 1.416666667 days.
| Average current (mA) | Run time (h) |
|---|---|
| 12.5 | 136 |
| 25 | 68 |
| 37.5 | 45.33333333 |
| 50 | 34 |
| 62.5 | 27.2 |
| 75 | 22.66666667 |
| 100 | 17 |
How to read the result
Treat the result as an estimate. For high currents relative to capacity, real run time is often shorter because internal resistance causes voltage to sag to the cut-off earlier; alkaline cells are especially affected. Cold temperatures reduce available capacity, and self-discharge matters for devices that run for months or years. If the result is close to your requirement, choose a larger battery or reduce the average current; cutting sleep current is usually the biggest win for low-power devices.
Common mistakes
- Using peak current instead of the average current over a full operating cycle.
- Mixing units, such as Ah capacity with mA current.
- Adding capacities of cells in series; in series the voltage adds but the mAh stays the same, while in parallel the mAh adds.
- Ignoring the regulator's own quiescent current and conversion losses.
Frequently asked questions
How long will a 5000 mAh power bank last with a 500 mA load?
Ideally 10 hours, but power banks list cell capacity at about 3.7 V; after conversion to 5 V and losses, usable output is often around 60–70% of that rating.
Why does my battery run out faster than calculated?
Common reasons are a higher real average current, cold weather, an aged battery, or a device that shuts off at a higher voltage than expected.
What usable fraction should I use?
There is no single value; 80–90% is a reasonable starting assumption for a new battery at moderate load and room temperature.
Sources: K. W. Beard (ed.), Linden's Handbook of Batteries, 5th ed., McGraw-Hill