Battery Life Calculator
Ideal estimate, no losses applied
Estimated battery life
Table of Contents
This free battery life calculator estimates how long a battery will run your device. Enter the battery capacity in mAh, Ah or Wh and the current or power your device draws, and the tool shows the runtime in hours, minutes and days. Switch to Advanced mode to include efficiency, depth of discharge and self discharge, or use Sleep mode for devices that sleep between tasks, such as an ESP32, Arduino or IoT sensor node.
Below the calculator you will find the battery life formula, a worked sleep mode example, a runtime table for common batteries, a chemistry comparison and the real world factors that make a battery run out sooner than the maths predicts.
How to Use the Battery Life Calculator
Simple mode
Use Simple mode when your device draws a steady current.
- Enter the battery capacity and pick the unit (mAh or Ah). You will find this value printed on the battery or in its datasheet.
- Enter the average current your device draws and pick the unit (mA or A). If you pick Wh or W, a battery voltage field appears so the tool can convert units.
- Click Calculate Battery Life to see the estimated runtime.
Advanced mode
Advanced mode adds four inputs that bring the estimate closer to real life:
- Battery voltage: needed when you enter capacity in Wh or load in W, so the tool can convert between energy and current.
- Efficiency factor: covers converter, regulator and heat losses. The default is 85 percent.
- Depth of discharge: the share of capacity you use before recharging. The default is 80 percent.
- Self discharge rate: charge the battery loses each month on its own, around 1 to 5 percent for Li ion and higher for NiMH.
The tool multiplies the capacity by the efficiency and depth of discharge, treats self discharge as a small extra current, and shows the runtime with a full breakdown table.
Sleep mode
Use Sleep mode when your device spends most of its time asleep and wakes up for short bursts of work. Enter the active current, the active time, the sleep current (in µA or mA) and the sleep time for one cycle. The calculator works out the average current and the resulting battery life.
mAh, Ah and Wh: Battery Capacity Units Explained
Battery capacity appears in three units, and mixing them up is the most common source of wrong estimates.
| Unit | Meaning | Where you see it | Conversion |
|---|---|---|---|
| mAh | Milliamp hours of charge | Coin cells, AA, LiPo, 18650, power banks | 1,000 mAh = 1 Ah |
| Ah | Amp hours of charge | Lead acid, LiFePO4, car and solar batteries | 1 Ah = 1,000 mAh |
| Wh | Watt hours of energy | Laptops, power stations, airline limits | Wh = V × Ah |
mAh and Ah tell you charge, while Wh tells you energy. Two batteries with the same mAh rating store different energy if their voltages differ. A 3,000 mAh cell at 3.7 V stores about 11.1 Wh, while a 3,000 mAh pack at 7.4 V stores about 22.2 Wh. Compare batteries in Wh when their voltages differ.
How to Calculate Battery Life
The basic battery life formula divides capacity by load current:
A 2,000 mAh battery powering a 100 mA load gives 2,000 ÷ 100 = 20 hours in theory.
Real batteries deliver less than their rated capacity, so multiply the result by about 0.7 to 0.8 for a realistic estimate:
For the same example, 20 hours × 0.8 = 16 hours.
Battery life calculation in watt hours
When your load is rated in watts, or it runs through an inverter or DC to DC converter, work in watt hours instead:
Battery Life Calculation With Sleep Mode
Most battery powered IoT devices sleep most of the time, so their current changes from moment to moment. The Sleep mode tab in the calculator above does this maths for you. Here is the formula it uses:
Worked example: ESP32 sensor on an 18650 cell
An ESP32 wakes every 10 minutes, reads a sensor and sends data over WiFi for 5 seconds at 120 mA. It then sleeps for 595 seconds at 10 µA (0.01 mA). The battery is a 2,500 mAh 18650 cell.
Our low power circuit design guide shows how to bring sleep current down, and our ESP32 selection guide compares modules for battery projects.
Battery Runtime Table for Common Batteries
The table uses typical rated capacities and an example load. The realistic column applies the 0.8 factor.
| Battery | Typical capacity | Example load | Ideal runtime | Realistic (×0.8) |
|---|---|---|---|---|
| CR2032 coin cell | 220 mAh | 0.1 mA average (sensor tag) | 2,200 h (about 92 days) | 1,760 h (about 73 days) |
| AA alkaline | 2,500 mAh | 50 mA | 50 h | 40 h |
| 2,000 mAh LiPo | 2,000 mAh | 100 mA | 20 h | 16 h |
| 18650 Li ion | 3,000 mAh | 200 mA | 15 h | 12 h |
| 6,000 mAh power bank | 6,000 mAh | 500 mA | 12 h | 9.6 h |
| 12 V 7 Ah lead acid | 7 Ah | 1 A (12 W router) | 7 h | 5.6 h |
| 12 V 100 Ah LiFePO4 | 100 Ah | 5 A (60 W) | 20 h | 16 h |
Use the calculator above with your own capacity and current for an exact figure.
Battery Chemistry Comparison
Chemistry changes the voltage, how much capacity you can use and how fast the battery loses charge on the shelf. The values below are typical figures; check your cell’s datasheet for exact numbers.
| Chemistry | Nominal cell voltage | Usable capacity (typical) | Self discharge | Good for |
|---|---|---|---|---|
| Li ion (18650) | 3.6 to 3.7 V | About 80 to 90% | Low (a few % per month) | IoT nodes, portable tools |
| LiPo | 3.7 V | About 80 to 90% | Low | Wearables, drones, slim devices |
| LiFePO4 | 3.2 V | About 80 to 95% | Low | Solar storage, long cycle life |
| NiMH | 1.2 V | About 80% | High (low self discharge types are better) | Rechargeable AA devices |
| Alkaline | 1.5 V | Drops at high current | Very low | Low drain remotes, clocks |
| Lead acid | 2 V per cell (12 V pack) | About 50% for long life | Moderate | Backup power, UPS, vehicles |
Real World Factors That Shorten Battery Life
Usable capacity and depth of discharge
Draining a battery to zero shortens its life. Lithium cells are often cut off before they are empty, and lead acid batteries last longer when you use around half of their capacity. Plan on 50 to 80 percent of the rated capacity depending on the chemistry.
High discharge current
Batteries deliver less total energy at high currents because of internal resistance. Alkaline cells and coin cells lose a large share of their capacity under heavy or pulsed loads, and lead acid batteries follow Peukert’s law, where higher current means lower usable capacity.
Converter and regulator losses
A linear regulator wastes the voltage difference as heat, and a switching converter loses around 5 to 15 percent. Our DC to DC converter design guide explains how to choose an efficient power stage.
Temperature
Cold weather reduces available capacity, and heat speeds up ageing. A battery that lasts a week indoors may last a few days outdoors in winter.
Self discharge and ageing
Batteries lose charge on the shelf and lose capacity with each charge cycle. For devices meant to run for months or years, add self discharge to your sleep current and expect capacity to fall over time.
How to Extend Battery Life in Your Design
- Cut sleep current first. In a device that sleeps 99 percent of the time, sleep current often decides battery life more than active current.
- Shorten the active time. Send data in batches, lower transmit power and avoid long WiFi connection times.
- Pick an efficient regulator. Use a low quiescent current LDO or a switching regulator matched to your load.
- Switch off loads that stay on. Power LEDs, USB bridge chips and sensors left powered can drain a battery in days.
- Size the battery with margin. Add 20 to 30 percent to your calculated capacity to cover ageing and cold weather.
- Test a full discharge. Run one prototype from a full charge until it shuts down and log the time. Compare the result with this battery life calculator and adjust your current figures until the estimate matches the real device. One real test beats any number of datasheet assumptions.
Related calculators on Prototype Guru
Voltage Divider Calculator Ohm’s Law Calculator DC to DC Circuit Calculator Energy Conversion CalculatorFrequently Asked Questions
What is the formula for calculating battery life?
Battery life in hours equals battery capacity in mAh divided by load current in mA. Multiply the result by about 0.8 to allow for real world losses. For devices that sleep, use the average current: (active current × active time + sleep current × sleep time) divided by total time.
How many hours will a 3,000 mAh battery last?
It depends on the load. At 100 mA, a 3,000 mAh battery lasts about 30 hours in theory and around 24 hours in practice. At 500 mA, expect about 6 hours in theory and close to 5 hours in practice.
How long will a 6000 mAh battery last?
At 100 mA, a 6,000 mAh battery lasts about 60 hours in theory and around 48 hours in practice. At 1 A, it lasts about 6 hours in theory and close to 5 hours in practice.
How long does 2000mAh last?
A 2,000 mAh battery lasts about 20 hours at 100 mA, or around 16 hours with real world losses. At a light 20 mA load, it can run for about 100 hours in theory and 80 hours in practice.
Building a battery powered product?
Prototype Guru designs low power electronics, PCBs and embedded firmware for IoT devices that need to run for months on one battery.
Get a Quote →Prototype Guru designs electronics prototypes, PCBs and embedded systems, and builds free engineering tools like this battery life calculator. Explore more tools on our calculators page, read our IoT prototyping guide, or learn more about our team.