Estimate device battery life from battery capacity and current draw
A 2400 mAh battery feeding a device that averages 120 mA lasts about 20 hours: capacity divided by average current gives the ideal runtime. Use it to compare batteries or check a prototype's power budget. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Capacity mah
- 2,400
- Current ma
- 120
- Runtime hours
- 20
This device battery life estimator turns two common electrical specifications into a practical runtime figure. Enter the battery capacity in milliamp-hours and the device’s average current draw in milliamps, and the calculator returns an estimated operating time in hours. It is useful for quick planning when comparing batteries, checking a prototype’s power budget, or communicating expected runtime. The calculation is deterministic and uses the ideal capacity-over-current relationship. It does not attempt to model battery chemistry, temperature, aging, regulator losses, or changing loads, so its result should be treated as a clear first estimate rather than a guaranteed field measurement.
Understand the battery life formula
The estimate uses a direct relationship: runtime in hours equals battery capacity in milliamp-hours divided by average current draw in milliamps. The matching milliamp units cancel, leaving hours. For example, a 2400 mAh battery supporting a device that averages 120 mA produces an ideal estimate of 20 hours.
Average current is important because many devices switch between active, idle, radio-transmit, display, and sleep states. If you enter only the peak current, the estimated runtime may be much shorter than normal use; if you enter only deep-sleep current, it may be unrealistically long. Measure or calculate a time-weighted average across the expected duty cycle whenever possible.
The formula also assumes that the full rated battery capacity is usable at the device’s required voltage. Actual equipment often stops operating before a cell is completely discharged because of a cutoff voltage, converter behavior, or protection circuitry. Temperature, battery age, discharge rate, manufacturing variation, and self-discharge can reduce usable capacity as well.
This calculator intentionally leaves those factors outside the algorithm so the result remains transparent, repeatable, and easy to audit. Apply an appropriate safety margin after receiving the ideal estimate when planning a real product, maintenance interval, or customer-facing promise.
Choose and enter reliable input values
A label showing 2.4 Ah corresponds to 2400 mAh, because one amp-hour equals one thousand milliamp-hours. Both fields accept finite numeric values, but current must be greater than zero. Capacity may be zero, which produces zero hours, but it cannot be negative.
For a device with several modes, calculate average current by multiplying each mode’s current by the fraction of time spent in that mode and adding the results. For instance, a sensor drawing 80 mA for ten percent of the time and 2 mA for ninety percent averages 9.8 mA before other losses are included. Use measurements taken at the battery side of the power system if converters or regulators materially affect the load.
Avoid mixing units: values in microamps must be divided by one thousand to obtain milliamps, while values in amps must be multiplied by one thousand. Careful unit conversion and a representative average usually improve the estimate more than adding false decimal precision to the final answer.
Interpret the result and plan with margin
A result of 20 means twenty ideal hours under the supplied average load; it does not mean the device is guaranteed to run for exactly twenty hours in every environment. Compare the estimate with bench measurements and field trials before committing to service intervals or product claims. Many teams derate nominal capacity to reflect cold weather, aging, high discharge rates, voltage conversion losses, and the reserve needed for reliable shutdown.
One simple workflow is to multiply rated capacity by a conservative usable-capacity factor, then send that reduced mAh value to this estimator. Another is to calculate the ideal result first and apply a documented runtime margin afterward. Use the same policy consistently when comparing design alternatives.
Because the algorithm has no network access, randomness, stored state, or clock dependency, identical inputs always return identical results. Recalculate whenever firmware, radio schedules, display brightness, sensor sampling, or power hardware changes, since even modest changes in average current directly change expected runtime.
What you can do with it
Prototype power budgeting
Turn a measured average load and candidate battery capacity into an initial runtime estimate before ordering hardware.
Portable device comparison
Compare how different battery sizes or firmware power profiles affect ideal operating hours using one consistent formula.
Maintenance planning
Estimate a starting battery replacement interval for sensors and other remote devices, then apply a field-tested safety margin.
FAQ
Why must current draw be positive?
Zero current would require division by zero and imply an unbounded runtime, while negative draw is not valid for this discharge model.
Should I use peak or average current?
Use a representative time-weighted average current. Peak current alone usually underestimates runtime, while sleep current alone usually overestimates it.
Does the estimate include battery aging or temperature?
No. Derate the usable capacity or apply a documented margin to account for chemistry, temperature, aging, conversion loss, and cutoff voltage.
How do I convert a battery label in Ah to mAh?
Multiply by one thousand, because one amp-hour equals one thousand milliamp-hours. A label showing 2.4 Ah means 2400 mAh, which is the value to enter as the capacity.
How do I find the average current of a device with several modes?
Multiply each mode's current by the share of time spent in it and add the results. A sensor drawing 80 mA ten percent of the time and 2 mA the other ninety percent averages 9.8 mA.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/misc2/battery-life-estimate \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"capacity_mah":2400,"current_ma":120}'const res = await fetch("https://api.kit.forhosting.com/misc2/battery-life-estimate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"capacity_mah": 2400,
"current_ma": 120
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/misc2/battery-life-estimate",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"capacity_mah": 2400,
"current_ma": 120
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/misc2/battery-life-estimate", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"capacity_mah":2400,"current_ma":120}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"capacity_mah":2400,"current_ma":120}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/misc2/battery-life-estimate", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"capacity_mah": 2400,
"current_ma": 120
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "misc2.battery_life_estimate",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Choose and enter reliable input values
Enter capacity_mah as the battery’s relevant usable capacity in milliamp-hours. Enter current_ma as the device’s average current in milliamps over a representative operating cycle. A zero or negative current cannot produce a meaningful finite discharge estimate, so the capability returns an invalid_input error instead of reporting infinity or a misleading negative runtime.
Interpret the result and plan with margin
The response returns the normalized capacity and current together with runtime_hours, making the calculation easy to inspect in logs, worksheets, and automated tests. Successful API requests use the published base price of $0.002 per item, while the browser experience can support quick interactive checks.
Technical questions
What formula is used?
Runtime in hours equals capacity_mah divided by current_ma. The result is an ideal first estimate.
How much does the API request cost?
A successful API request uses the published base price of $0.002 per item.