Battery Life Calculator

Estimate how long a project or device will run on a battery. Enter the battery's capacity in mAh or Wh, the current the device draws and a usable-capacity factor — batteries rarely deliver 100% of their rating — and get the runtime in hours or days. For devices that sleep between bursts, add the active time and sleep current and the calculator averages them. It is an estimate, and it runs in your browser.

Typical capacities

BatteryCapacity
CR2032 coin cell~220 mAh
AAA alkaline~1,000 mAh
AA alkaline~2,500 mAh
18650 Li-ion2,500–3,500 mAh
9 V alkaline~550 mAh

When to use it

  1. Size a battery for an Arduino or ESP32 project.
  2. Estimate how long a sensor node lasts on a coin cell.
  3. Compare two battery capacities.
  4. See how much a sleep mode extends runtime.

How to Use

  1. Enter the battery capacity in mAh.
  2. Enter the device's current draw in mA.
  3. Adjust the usable capacity if needed.
  4. For sleeping devices, set the active time percentage and sleep current.

Features

  1. Runtime from capacity and current
  2. Capacity in mAh or Wh
  3. Usable-capacity factor
  4. Active/sleep duty cycle averaging
  5. Readable output from minutes to years
  6. 100% client-side

FAQs

Why not use 100% of the capacity?

Because you will not get it. The device cuts off before the cell is empty, capacity drops with age and cold, and high currents deliver less than the rating. 70–85% is a realistic planning figure.

How do I account for sleep mode?

Enter the percentage of time the device is active and its sleep current. The calculator works out the average current, which is what sets battery life.

Is the result exact?

No. It assumes a constant average current and ignores the discharge curve, temperature and self-discharge. Treat it as a planning estimate.

My battery is rated in Wh, not mAh. What do I do?

Switch the capacity to Wh and enter the nominal voltage; the calculator converts it. The conversion is watt-hours × 1,000 ÷ voltage, so a 3.7 V, 7.4 Wh battery is 2,000 mAh.

Is my data sent anywhere?

No. It is arithmetic in the page.

Technical Details

Runtime is the charge you can actually draw from the battery divided by the average current the device takes. A capacity given in watt-hours is first converted to milliamp-hours by multiplying by 1,000 and dividing by the nominal voltage. The usable charge is the rated capacity in milliamp-hours multiplied by a usable fraction, defaulting to 80%, because a battery rarely delivers its full rating: the device's cut-off voltage stops it before the cell is truly empty, capacity falls with age and cold, and high discharge rates deliver less than the low rate the rating was measured at. For devices that sleep between bursts of activity — sensors, remotes, data loggers — the average current is the active current weighted by the share of time spent active plus the sleep current weighted by the rest, which is usually what dominates battery life. The result is reported in hours and in the most readable unit, from minutes up to years. It is an estimate built on constant-current arithmetic; it does not model the discharge curve, self-discharge over long periods or temperature, so a figure in years should be read with self-discharge in mind. Everything is computed in the page.

Electronics Tools

Electronics Tools

  • UPS & Inverter Backup Time Calculator
  • Solar System Sizer
  • Voltage Drop & Wire Size Calculator
  • Cable Ampacity and Derating Calculator
  • Conduit Fill Calculator
  • AWG to mm² Wire Gauge Converter
  • Three-Phase Power Calculator
  • Power Factor Correction Calculator