Battery life calculator
Divide a cell's milliamp-hour rating by the device's average draw in milliamps to estimate runtime: a 3000 mAh phone cell at 150 mA lasts 20 hours. Made for wearables, sensor nodes and low-power modes as a first upper-bound figure. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Battery capacity in milliamp-hours
- 3,000
- Current ma
- 150
- Capacity ah
- 3 hour
- Current a
- 0.15
- Runtime hours
- 20
- Runtime minutes
- 1,200
Battery life estimates answer a simple product question: if a cell is rated at a given milliamp-hour capacity and a device draws a known average current, how many hours of continuous operation can you expect before the pack is empty? Designers, hobbyists, and support teams use that ratio every day to size wearable batteries, compare low-power modes, and set realistic uptime claims on packaging and datasheets. This battery life calculator accepts a positive capacity in milliamp-hours and a positive average current draw in milliamps, divides capacity by current with deterministic floating-point arithmetic, and returns runtime in hours along with minutes, days, cleaned SI companions in amp-hours and amps, and a short printable expression. Zero current is rejected with a clear validation error because runtime would be undefined or infinite; non-positive capacity and negative draw are likewise rejected.
How battery runtime relates to capacity and current draw
In the ideal linear model used for first-pass estimates, a battery rated at C milliamp-hours that supplies a constant average load of I milliamps lasts C divided by I hours. The units cancel cleanly: milliamp-hours over milliamps leave hours, which is why product teams and lab notebooks almost always stay in mAh and mA rather than converting everything to amp-hours and amperes first.
A three-thousand milliamp-hour phone cell drawing one hundred fifty milliamps on average lasts twenty hours under that model; a two-hundred milliamp-hour coin cell on a ten-microamp sleep rail lasts twenty thousand hours, about two point three years, before you apply real-world derating. The formula assumes constant current, full use of rated capacity, and no voltage cutoff penalty, so it is an upper-bound style estimate rather than a chemistry-accurate discharge simulation.
Real packs lose usable capacity at high C-rates, cold temperatures, and near end-of-life, and Peukert exponents matter for lead-acid and some high-drain cases; those refinements are separate search intents and separate tools so this page stays focused on the mAh over mA question people type first. Series and parallel battery packs change the effective capacity before you divide by load current; this tool takes the already-known usable capacity and the average device current rather than solving a multi-cell network.
Where battery life calculators show up in real work
Introductory electronics and IoT courses constantly assign mAh over mA drills so students can convert datasheet capacity and measured sleep or active current into hours before they move on to duty-cycle averaging and battery chemistry limits. Wearable, sensor-node, and remote-control product teams size cells by estimating continuous runtime at a target average draw, then add margin for temperature and aging when writing marketing claims.
Support and sales engineers answer customer questions about how long a pack will last at a stated load by running the same linear ratio used in the datasheet FAQ. Keep Peukert-only, energy-in-watt-hours, and multi-mode duty-cycle landings separate so each search intent has one clear page rather than an overloaded multi-formula tool that confuses both students and search engines.
What you can do with it
IoT and wearable uptime estimates
Convert a cell’s mAh rating and a measured average load current into hours of continuous operation for first-pass product sizing.
Lab homework and datasheet checks
Verify textbook battery-life drills and datasheet FAQ examples against the linear runtime = capacity_mAh / current_mA model.
FAQ
What formula does this battery life calculator use?
Capacity is in milliamp-hours, current in milliamps, and the result is estimated continuous runtime in hours (also returned as minutes and days).
What happens if current draw is zero?
Zero current would make runtime undefined or infinite; provide a positive load current in milliamps.
Can capacity or current be negative?
No. Capacity must be > 0 mAh and current must be > 0 mA. Negative or zero values are rejected and not charged.
Do I pass amp-hours or milliamp-hours?
Always milliamp-hours for capacity and milliamps for current. For a 3 Ah pack pass 3000 (mAh). Prefix strings like "3Ah" are not parsed.
What does it cost?
The browser tool is free and runs locally.
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/elec/battery-life \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"capacity_mah":3000,"current_ma":150}'const res = await fetch("https://api.kit.forhosting.com/elec/battery-life", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"capacity_mah": 3000,
"current_ma": 150
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/battery-life",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"capacity_mah": 3000,
"current_ma": 150
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/battery-life", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"capacity_mah":3000,"current_ma":150}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"capacity_mah":3000,"current_ma":150}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/battery-life", 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": 3000,
"current_ma": 150
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.battery_life",
"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
What you send and what you get back
Numeric values and numeric strings are both accepted so form widgets and spreadsheet paste stay convenient; unit-prefix strings such as three amp-hours written as text are not parsed, so convert amp-hours to milliamp-hours yourself by multiplying by one thousand. Current must also be greater than zero: zero draw fails with a message that runtime would be undefined or infinite, and negative draw is rejected as non-physical for this linear drain model. Classic classroom checks include three thousand milliamp-hours at one hundred fifty milliamps equaling twenty hours, one thousand milliamp-hours at fifty milliamps equaling twenty hours, and a zero-current request that must fail validation. If you need Peukert-corrected life, multi-rail power budgets, solar harvest duty cycles, or temperature derating curves, treat those as separate tools rather than extending this pure capacity-over-current product. Send a finite positive capacity under the field capacity_mah, expressed in milliamp-hours, and a finite positive current under the field current_ma, expressed in milliamps. The same capacity is accepted under the aliases capacity, mah, mAh, or battery_mah, and current under current, ma, mA, draw, or current_draw, but only one key may appear for each quantity in a request. Capacity must be greater than zero; zero, negative, NaN, and Infinity fail with invalid_input and are not charged. On success the response includes cleaned capacity_mah and capacity_ah, cleaned current_ma and current_a, runtime_hours, runtime_minutes, runtime_days, unit set to hour, a short expression string of the form capacity mAh over current mA equals hours, method capacity_over_current, and the formula string runtime_hours equals capacity_mAh over current_mA. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where battery life calculators show up in real work
Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
CI fixtures and support calculators
Script the same capacity-over-current product used in the browser so support tools and automated graders share one ground truth for hours.