# 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).

- Calculator id: `battery-runtime` · Category: Engineering & Automotive (`engineering`) · Tool name: `estimate_battery_runtime`
- Canonical page: https://tttkmbb.com/engineering/battery-runtime · This document: https://tttkmbb.com/engineering/battery-runtime.md · JSON definition: https://tttkmbb.com/engineering/battery-runtime.json

## Purpose

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).

**Use when:** 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).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `capacity_mah` | number | mAh | optional | Rated capacity in milliampere-hours (phones, power banks). Give exactly one of capacity_mah, capacity_ah, capacity_wh. (> 0) |
| `capacity_ah` | number | Ah | optional | Rated capacity in ampere-hours (car, solar and UPS batteries). (> 0) |
| `capacity_wh` | number | Wh | optional | Rated energy in watt-hours (laptop packs, e-bikes). (> 0) |
| `voltage_v` | number | V | optional | 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. (> 0) |
| `load_w` | number | W | optional | Average power drawn by the load in watts. Give either load_w or load_a. (> 0) |
| `load_a` | number | A | optional | Average current drawn by the load in amperes (needs voltage_v). (> 0) |
| `battery_type` | enum: li_ion \| lead_acid |  | optional, 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 | % | optional | Override the usable fraction of capacity (100 = run until empty). (> 0, max 100) |

## Output

| Field | 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. |

## 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.

## Data Sources

- Battery University – BU-501: Basics about Discharging — https://batteryuniversity.com/article/bu-501-basics-about-discharging (reference, retrieved 2026-09-24)
- Wikipedia – Depth of discharge — https://en.wikipedia.org/wiki/Depth_of_discharge (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/battery-runtime?`
- `POST https://tttkmbb.com/api/v1/calculate/battery-runtime` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/battery-runtime · OpenAPI operationId `estimate_battery_runtime` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "battery-runtime", "inputs": {…}}`

## Example

- 10,000 mAh 3.7 V power bank, 5 W load: inputs `{"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: inputs `{"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
```

## Limitations

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). 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. All values are computed from the formula above; no measurement or live data is involved.

## 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

- [Battery Charge Time Calculator](https://tttkmbb.com/engineering/battery-charge-time.md) — Time to recharge the same battery.
- [Solar Panel Output Calculator](https://tttkmbb.com/engineering/solar-panel-output.md) — Daily energy available to recharge from solar panels.
- [Electric Power Calculator](https://tttkmbb.com/physics/electric-power.md) — Find the load in watts from voltage and current.
