---
title: "Calculates battery runtime and energy capacity given cell capacity in mAh, nominal voltage, and average current draw. Accounts for real-world discharge efficiency (Peukert-adjacent derating) to produce effective capacity, total energy in Wh, and runtime in hours and days. Useful for IoT sensor node planning, portable device design, UPS hold-up estimation, and solar battery bank cycling analysis. Outputs feed into solar_sizing (battery_kwh) and ups_runtime (battery_wh) for system-level calculations."
method: POST
path: "/api/battery_life"
tags: ["power"]
---

# Calculates battery runtime and energy capacity given cell capacity in mAh, nominal voltage, and average current draw. Accounts for real-world discharge efficiency (Peukert-adjacent derating) to produce effective capacity, total energy in Wh, and runtime in hours and days. Useful for IoT sensor node planning, portable device design, UPS hold-up estimation, and solar battery bank cycling analysis. Outputs feed into solar_sizing (battery_kwh) and ups_runtime (battery_wh) for system-level calculations.

`POST /api/battery_life`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/battery_life`
- Auth: none declared

## Request body

- object
  - `capacity_mah` number, required: Battery capacity in milliamp-hours (mAh)
  - `voltage` number: Nominal battery voltage (V), default 3.7 for Li-ion
  - `current_draw_ma` number, required: Average current draw in milliamps (mA)
  - `efficiency` number: Discharge efficiency factor (0-1), accounts for conversion losses and derating, default 0.85

## Response `200`

Computed result for battery_life

- object
  - `result` object, required
    - `runtime_hours` number, required: Estimated runtime in hours
    - `runtime_days` number, required: Estimated runtime in days
    - `energy_wh` number, required: Total battery energy in watt-hours (capacity_mah * voltage / 1000)
    - `effective_capacity_mah` number, required: Effective usable capacity after efficiency derating (mAh)
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
