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
- 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
Halve the current and it lasts twice as long. To compare batteries of different voltages, use the energy instead:
A worked example
A phone's 3.7 V cell holds 4000 mAh, and the phone draws about 400 mA:
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:
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.
“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 neededThe ideas behind it
- How to calculate battery life from mAhRuntime = capacity ÷ current: mAh, watt-hours, C-rate, and why real batteries give a little less.
- Batteries in series vs parallelChain cells for more volts, put them side by side for more hours, and never mix a tired one with a fresh one.
- How to charge a lithium-ion batteryConstant current, then constant voltage at 4.2 V: the two-stage curve every lithium charger follows.
- Electrical power explained: P = V × IP = V × I: how fast energy turns into heat, and why a resistor has a power rating.
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
- Capacitor energy calculatorJoules and charge in a capacitor, and how much your circuit can use.
- Wire voltage drop calculatorVolts and watts lost in a cable, out and back, and the size that keeps it under 3%.
- Buck converter calculatorDuty cycle, ripple current, output ripple and the coil a step-down converter needs.
- Ohm's law calculatorAny two of V, I and R give the third, and the power.
- Electrical power calculatorWatts from any two of V, I and R, and the resistor rating that stays cool.
- LED resistor calculatorThe resistor for one LED or a string, rounded to a value you can buy.