Skip to content

Free calculator

Battery life calculator

How long a battery lasts comes down to one sum: its capacity, in milliamp-hours, divided by the current your device draws. Type both, or the currents for a device that wakes and sleeps, and this gives the runtime, the energy in watt-hours, and how hard you're pulling on the cell.

Printed on the battery. For Ah, times 1000.

400m = 400 mA = 0.4 A.

Real cells give less than the label: try 80 for a safe plan.

For the energy in watt-hours.

Runtime = capacity ÷ current

10 h
C-rate
0.1C
Energy in the battery
14.8 Wh
Power drawn
1.48 W

That's the most it could last. Cold, age and cut-off voltage take their share, so plan on 70–80%: 8 h at 80%.

The formula

runtime (h) = capacity (mAh) over current (mA)

Halve the current and it lasts twice as long. To compare batteries of different voltages, use the energy instead:

Wh = Ah × V

A worked example

A phone's 3.7 V cell holds 4000 mAh, and the phone draws about 400 mA:

runtime = 4000 mAh over 400 mA = 10 h

It holds 4 Ah × 3.7 V = 14.8 Wh, and 400 mA is 0.1C: a gentle pull. Plan on 80% of the label and it's 8 hours.

Devices that sleep

Most battery gadgets don't draw a steady current. Average it over one cycle, then divide as before:

Iavg = Iawake × tawake + Iasleep × tasleep over tawake + tasleep

A sensor awake for 1 s a minute at 20 mA, asleep at 0.1 mA, averages about 0.43 mA. On 2000 mAh that's about 4,600 hours, over six months. The sleep current is nearly a quarter of the total, so shaving it matters.

Free lesson

Now build it yourself

Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.

Try it yourself: free lesson

“How long will it last?” is lesson 1 of 6 in Solar Sound, Power & Energy World 3. Free with an account. Lessons unlock in order, so you’ll do the 14 before it first.

Or start from the very first lesson, no account needed

The ideas behind it

Questions people ask

How do you calculate battery life from mAh?

Divide the capacity by the current: hours = mAh ÷ mA. A 4000 mAh battery running a 400 mA load lasts 4000 ÷ 400 = 10 hours. Real batteries give a little less, so plan on 70–80% of the label.

How long will a battery last on a device that sleeps?

Work out its average current first. A sensor that draws 20 mA for 1 s each minute and 0.1 mA the rest averages (20 × 1 + 0.1 × 59) ÷ 60 ≈ 0.43 mA, so 2000 mAh lasts about 4,600 hours, over six months.

What is the difference between mAh and Wh?

mAh counts charge; watt-hours count energy. Multiply amp-hours by the voltage: 4000 mAh at 3.7 V is 4 × 3.7 = 14.8 Wh. Compare batteries of different voltages in watt-hours.

What does C-rate mean?

The current in battery sizes: 1C empties it in an hour. For a 2500 mAh cell, 1C is 2.5 A and 0.5C is 1.25 A. Pull much over 1C and most cells heat up and give less.

More calculators

Every calculator