HomeEngineering & 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

ParameterTypeUnitRequiredDescription
capacity_mahnumbermAhnoRated capacity in milliampere-hours (phones, power banks). Give exactly one of capacity_mah, capacity_ah, capacity_wh. Range: > 0
capacity_ahnumberAhnoRated capacity in ampere-hours (car, solar and UPS batteries). Range: > 0
capacity_whnumberWhnoRated energy in watt-hours (laptop packs, e-bikes). Range: > 0
voltage_vnumberVnoNominal 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_wnumberWnoAverage power drawn by the load in watts. Give either load_w or load_a. Range: > 0
load_anumberAnoAverage current drawn by the load in amperes (needs voltage_v). Range: > 0
battery_typeenum: li_ion | lead_aciddefault li_ionSets the default depth of discharge: 80 % for lithium chemistries, 50 % for lead-acid (deeper cycling shortens life).
depth_of_discharge_percentnumber%noOverride the usable fraction of capacity (100 = run until empty). Range: > 0, ≤ 100

Outputs

OutputTypeUnitDescription
battery_energy_whnumberWhRated energy: Ah × voltage_v, or capacity_wh as given.
battery_capacity_ahnumberAhRated charge in ampere-hours (only when voltage_v is known or capacity was given in Ah/mAh).
depth_of_discharge_percentnumber%Usable fraction applied.
usable_energy_whnumberWhbattery_energy_wh × depth_of_discharge / 100.
load_power_wnumberWLoad in watts (load_a × voltage_v when current was given).
load_current_anumberALoad in amperes (load_w / voltage_v when power was given and voltage is known).
runtime_hoursnumberhusable_energy_wh / load_power_w.
runtime_formattedstringRuntime as hours:minutes:seconds.
runtime_to_empty_hoursnumberhbattery_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

Sources

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