Home › Engineering & Automotive › Battery Runtime Calculator
Battery Runtime Calculator
Estimates how long a battery runs a load from its capacity (mAh, Ah or Wh), nominal voltage, the load in watts or amperes, and the usable depth of discharge (80 % for lithium-ion, 50 % for lead-acid by default).
When to use
You want to know how many hours a power bank, UPS, solar or vehicle battery will supply a given load, or size a battery for a required runtime.
Do not use when: The load is intermittent or very high-rate (Peukert losses reduce lead-acid capacity above the 20-hour rate), or you need charging time (use battery-charge-time).
Formula
battery_energy_wh = capacity_ah × voltage_v (capacity_mah / 1000 × voltage_v) or capacity_wh; load_power_w = load_a × voltage_v; runtime_hours = battery_energy_wh × depth_of_discharge_percent / 100 / load_power_w
Linear estimate at the nominal voltage; real capacity falls at high discharge rates (Peukert effect, mainly lead-acid), low temperatures and with age. Inverter or converter losses (typically 10–15 %) are not included: divide the runtime by the efficiency if the load runs through an inverter.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
capacity_mah | number | mAh | no | Rated capacity in milliampere-hours (phones, power banks). Give exactly one of capacity_mah, capacity_ah, capacity_wh. Range: > 0 |
capacity_ah | number | Ah | no | Rated capacity in ampere-hours (car, solar and UPS batteries). Range: > 0 |
capacity_wh | number | Wh | no | Rated energy in watt-hours (laptop packs, e-bikes). Range: > 0 |
voltage_v | number | V | no | Nominal voltage: 3.7 for a single lithium-ion cell or power bank rating, 12 / 24 / 48 for lead-acid and LiFePO4 banks. Needed to convert between Ah and W. Range: > 0 |
load_w | number | W | no | Average power drawn by the load in watts. Give either load_w or load_a. Range: > 0 |
load_a | number | A | no | Average current drawn by the load in amperes (needs voltage_v). Range: > 0 |
battery_type | enum: li_ion | lead_acid | default li_ion | Sets the default depth of discharge: 80 % for lithium chemistries, 50 % for lead-acid (deeper cycling shortens life). | |
depth_of_discharge_percent | number | % | no | Override the usable fraction of capacity (100 = run until empty). Range: > 0, ≤ 100 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
battery_energy_wh | number | Wh | Rated energy: Ah × voltage_v, or capacity_wh as given. |
battery_capacity_ah | number | Ah | Rated charge in ampere-hours (only when voltage_v is known or capacity was given in Ah/mAh). |
depth_of_discharge_percent | number | % | Usable fraction applied. |
usable_energy_wh | number | Wh | battery_energy_wh × depth_of_discharge / 100. |
load_power_w | number | W | Load in watts (load_a × voltage_v when current was given). |
load_current_a | number | A | Load in amperes (load_w / voltage_v when power was given and voltage is known). |
runtime_hours | number | h | usable_energy_wh / load_power_w. |
runtime_formatted | string | Runtime as hours:minutes:seconds. | |
runtime_to_empty_hours | number | h | battery_energy_wh / load_power_w, ignoring the depth-of-discharge limit. |
Example
10,000 mAh 3.7 V power bank, 5 W load: {"capacity_mah":10000,"voltage_v":3.7,"load_w":5} → {"battery_energy_wh":37,"battery_capacity_ah":10,"depth_of_discharge_percent":80,"usable_energy_wh":29.6,"load_power_w":5,"load_current_a":1.3514,"runtime_hours":5.92,"runtime_formatted":"5:55:12","runtime_to_empty_hours":7.4}
100 Ah 12 V lead-acid, 10 A load: {"capacity_ah":100,"voltage_v":12,"load_a":10,"battery_type":"lead_acid"} → {"battery_energy_wh":1200,"depth_of_discharge_percent":50,"usable_energy_wh":600,"load_power_w":120,"runtime_hours":5,"runtime_to_empty_hours":10}
GET https://tttkmbb.com/api/v1/calculate/battery-runtime?capacity_mah=10000&voltage_v=3.7&load_w=5
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/battery-runtime(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/battery-runtime · Markdown: https://tttkmbb.com/engineering/battery-runtime.md · JSON definition: https://tttkmbb.com/engineering/battery-runtime.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="battery-runtime" - OpenAPI operationId:
estimate_battery_runtime - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Battery University – BU-501: Basics about Discharging (reference)
- Wikipedia – Depth of discharge (reference)
FAQ
Why is a power bank's mAh rating misleading?
It is quoted at the 3.7 V cell voltage. Boosting to 5 V USB output costs about 10–15 %, so a 10,000 mAh bank delivers roughly 6,000–6,500 mAh at 5 V; enter the load in watts to avoid the confusion.
Why only 50 % for lead-acid?
Lead-acid cycle life drops sharply with deeper discharge; 50 % is the common design limit for deep-cycle use, while lithium chemistries tolerate 80–90 %.
Related calculators
- Battery Charge Time Calculator — Time to recharge the same battery.
- Solar Panel Output Calculator — Daily energy available to recharge from solar panels.
- Electric Power Calculator — Find the load in watts from voltage and current.