Skip to content
Electronics

Battery Life Calculator

Estimate runtime for any battery-powered project. Enter battery capacity (mAh) and average current draw to get hours of runtime. Includes efficiency factor for real-world derating.

Battery Runtime Estimation

Calculates how long a battery will last under a given average current draw. Accounts for regulator/conversion efficiency, battery chemistry voltage drop, and usable capacity. Works for any battery chemistry (alkaline, Li-ion, NiMH). Remember: actual runtime depends on current profile and temperature.

mAhRuntime = (Cap × Eff) / Current

Estimated runtime: 17.0 hours

Common: 18650 = 2000–3500 mAh · AA = 2500 mAh · LiPo 1S = 1000–5000 mAh

ESP32 active ≈ 160–240 mA · deep sleep ≈ 0.01 mA · Arduino Uno ≈ 50 mA

Accounts for voltage regulator loss and battery chemistry derating (80–90% typical)

Estimated Runtime

17.0 hours

Hours
17.00 h
Days
0.71 d
Weeks
0.10 wk
Usable capacity
1700 mAh

Runtime = (Capacity × Efficiency) / Current

The basic formula

Battery life (hours) = capacity (mAh) ÷ load current (mA)

A 2000 mAh battery powering a 100 mA load lasts about 20 hours in theory. In practice you should derate it.

Why real batteries last less

FactorTypical loss
Usable capacity before the device's cutoff voltage10–20 %
High discharge current (Peukert effect, mainly alkaline and lead-acid)10–50 %
Cold temperatures (below 10 °C)10–40 %
Regulator efficiency (linear regulator from 4.2 V to 3.3 V ≈ 78 %)10–30 %
Ageing and self-discharge2–5 % per month

Multiplying the ideal figure by 0.7–0.8 gives a realistic estimate for most hobby projects.

Typical battery capacities

BatteryNominal voltageTypical capacity
CR2032 coin cell3 V220 mAh (at < 1 mA)
AA alkaline1.5 V2000–2800 mAh (at low current)
AA NiMH1.2 V1900–2500 mAh
18650 Li-ion3.6–3.7 V2500–3500 mAh
LiPo pouch (small)3.7 V150–2000 mAh
9 V alkaline9 V400–550 mAh

Be wary of 18650 cells advertised above about 3600 mAh; genuine cells top out there.

Devices that sleep

If your project spends most of its time asleep, calculate the average current first:

Iavg = (Iactive × tactive + Isleep × tsleep) ÷ (tactive + tsleep)

An ESP32 drawing 120 mA for 5 s and 10 µA for the rest of a 10-minute cycle averages about 1.0 mA, so a 2500 mAh cell lasts roughly 2500 × 0.8 ÷ 1.0 ≈ 2000 hours (83 days). The battery runtime calculator handles this duty-cycle maths for you, including the regulator's quiescent current, which often dominates.

Formula, inputs and worked examples

Formula and method

Ideal runtime (hours) = capacity (mAh) / average current (mA); estimate usable runtime by multiplying by the efficiency/usable-capacity factor.

Worked examples

Arduino Uno on a 9 V battery

An Uno idles at about 45 mA. A 9 V alkaline (~500 mAh) gives 500 ÷ 45 × 0.8 ≈ 9 hours, which is why 9 V batteries are a poor fit for Arduino projects.

ESP32 sensor on an 18650

Averaging 1 mA with deep sleep, a 3000 mAh cell lasts about 3000 × 0.8 ÷ 1 = 2400 hours, roughly 100 days.

LED torch on AA cells

Two AA alkalines (2500 mAh) driving 100 mA last about 20 hours to empty, but brightness drops noticeably after 12–15.

Inputs

  • Battery capacity — Unit: mAh
  • Average load current — Unit: mA
  • Usable-capacity factor — Unit: fraction

What the result means

  • Ideal runtime — Unit: hours / days

Practical tips and common mistakes

  • Measure the real current with a multimeter in series; datasheet figures are often best-case.
  • Remove power LEDs and use low-quiescent regulators on battery projects.
  • Check the device's cutoff voltage: a 3.3 V regulator stops working well before a Li-ion cell is empty.

Assumptions and limitations

  • Use average current measured over a representative workload, not only peak or sleep current.
  • Battery capacity varies with discharge rate, temperature, age, cutoff voltage, and chemistry.
  • Include regulator losses and reserve capacity in the usable-capacity factor.

Frequently asked questions

How do I calculate battery life in hours?

Divide the battery capacity in mAh by the device's current in mA, then multiply by about 0.8 for real-world losses. 3000 mAh at 150 mA gives 3000 ÷ 150 × 0.8 = 16 hours.

How long will a 2000 mAh battery last?

At 100 mA about 16–20 hours, at 500 mA about 3–4 hours, and at 10 mA about 160–200 hours, depending on temperature and the battery chemistry.

How do I convert mAh to Wh?

Multiply mAh by the nominal voltage and divide by 1000. A 3400 mAh 3.6 V 18650 cell stores 3400 × 3.6 ÷ 1000 ≈ 12.2 Wh.

Why does my battery die faster than calculated?

Common causes are a higher real current than measured (Wi-Fi bursts, LEDs left on), regulator quiescent current, cold temperatures, and the device shutting off before the battery is truly empty.

Learn more

More Electronics