🚫 Office Closed (Holiday) 📅 We will reopen on Monday 🙏 Thanks for your patience 🚫 Office Closed (Holiday) 📅 We will reopen on Monday 🙏 Thanks for your patience
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Battery Life Calculator

V
Needed when you use Wh or W
%
Converter, regulator and heat losses
%
Share of capacity used before recharge
%/mo
About 1 to 5% for Li ion, higher for NiMH

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.

Battery LifemAh to HoursSleep ModeIoT and ESP32Free Tool

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.

  1. Enter the battery capacity and pick the unit (mAh or Ah). You will find this value printed on the battery or in its datasheet.
  2. 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.
  3. 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.

Measure, don’t guess: measure current with a multimeter in series or a USB power meter if you can. Datasheet figures for a chip leave out LEDs, regulators and sensors on the rest of the board.

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.

UnitMeaningWhere you see itConversion
mAhMilliamp hours of chargeCoin cells, AA, LiPo, 18650, power banks1,000 mAh = 1 Ah
AhAmp hours of chargeLead acid, LiFePO4, car and solar batteries1 Ah = 1,000 mAh
WhWatt hours of energyLaptops, power stations, airline limitsWh = 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:

Battery life (hours) = Battery capacity (mAh) ÷ Load current (mA)Use the same units on both sides: mAh with mA, or Ah with A

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:

Realistic battery life (hours) = Capacity (mAh) ÷ Load current (mA) × 0.80.8 covers typical losses from usable capacity, converters and temperature

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 (hours) = Battery voltage (V) × Capacity (Ah) × Efficiency ÷ Load power (W)Efficiency: about 0.85 to 0.95 for most switching converters and inverters
Battery energy: 12 V × 100 Ah1,200 Wh
Runtime with a 60 W load and a 90% inverter: 1,200 × 0.9 ÷ 6018 hours
Using only 80% of capacity to protect the batteryabout 14.4 hours

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:

Average current = (Ia × ta + Is × ts) ÷ (ta + ts)Ia = active current | ta = active time | Is = sleep current | ts = sleep time

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.

Average current = (120 × 5 + 0.01 × 595) ÷ 600≈ 1.01 mA
Battery life = 2,500 ÷ 1.01≈ 2,475 hours (about 103 days)
With the 0.8 real world factorabout 82 days
In the calculator: Sleep mode with 2,500 mAh, 120 mA for 5 s, 10 µA for 595 s103 days
Check the whole board: this example assumes a bare ESP32 module. Many development boards add a USB to serial chip, a power LED and a voltage regulator that draw several milliamps in sleep. That extra current can cut runtime from months to days, so measure the whole board before you trust the estimate.

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.

BatteryTypical capacityExample loadIdeal runtimeRealistic (×0.8)
CR2032 coin cell220 mAh0.1 mA average (sensor tag)2,200 h (about 92 days)1,760 h (about 73 days)
AA alkaline2,500 mAh50 mA50 h40 h
2,000 mAh LiPo2,000 mAh100 mA20 h16 h
18650 Li ion3,000 mAh200 mA15 h12 h
6,000 mAh power bank6,000 mAh500 mA12 h9.6 h
12 V 7 Ah lead acid7 Ah1 A (12 W router)7 h5.6 h
12 V 100 Ah LiFePO4100 Ah5 A (60 W)20 h16 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.

ChemistryNominal cell voltageUsable capacity (typical)Self dischargeGood for
Li ion (18650)3.6 to 3.7 VAbout 80 to 90%Low (a few % per month)IoT nodes, portable tools
LiPo3.7 VAbout 80 to 90%LowWearables, drones, slim devices
LiFePO43.2 VAbout 80 to 95%LowSolar storage, long cycle life
NiMH1.2 VAbout 80%High (low self discharge types are better)Rechargeable AA devices
Alkaline1.5 VDrops at high currentVery lowLow drain remotes, clocks
Lead acid2 V per cell (12 V pack)About 50% for long lifeModerateBackup 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

  1. Cut sleep current first. In a device that sleeps 99 percent of the time, sleep current often decides battery life more than active current.
  2. Shorten the active time. Send data in batches, lower transmit power and avoid long WiFi connection times.
  3. Pick an efficient regulator. Use a low quiescent current LDO or a switching regulator matched to your load.
  4. Switch off loads that stay on. Power LEDs, USB bridge chips and sensors left powered can drain a battery in days.
  5. Size the battery with margin. Add 20 to 30 percent to your calculated capacity to cover ageing and cold weather.
  6. 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.

Frequently 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.

Disclaimer: this battery life calculator gives estimates based on rated capacity and average current. Real runtime depends on battery chemistry, age, temperature, discharge rate and your circuit. Confirm critical designs with measurements on your own hardware.