Battery size calculator
This battery size calculator converts a device's power draw and desired operating time into the energy capacity a battery must provide.
Run — free
Enter power in watts and runtime in hours, and it returns the required capacity in watt-hours using a direct energy calculation. It is useful for early product planning, portable electronics, backup systems, field equipment, and other constant-load estimates where you need a clear minimum energy figure before selecting a battery or power station.
Turn a power requirement into battery energy
Battery labels and device specifications often describe different quantities. A device usually lists power in watts, while a battery or portable power station commonly lists stored energy in watt-hours. This calculator connects those specifications. It multiplies the device power draw by the number of hours the device must operate: capacity in watt-hours equals power in watts times runtime in hours. For example, a device drawing 25 watts for 8 hours requires 200 watt-hours of delivered energy in the ideal calculation. Use the average continuous draw when the load changes over time, or calculate separate operating stages and add their watt-hour requirements. The result is a minimum energy requirement for the stated load and duration. It does not assume a battery voltage, because watt-hours already describe energy independently of voltage. That makes the result convenient for comparing batteries with different voltage ratings, provided their advertised watt-hour capacities are measured on a comparable basis and can actually be delivered to the device.
Choose inputs that match real operation
The quality of a battery estimate depends on the power and runtime entered. Prefer a measured average power draw under representative use instead of relying only on a device's maximum adapter rating. A laptop, radio, pump, or sensor may alternate between active, idle, and sleep states, so a single peak number can oversize the result while an idle number can dangerously undersize it. If you know the duration and power of each state, compute each state's watt-hours and total them. Runtime must be entered in hours: thirty minutes is 0.5 hours, ninety minutes is 1.5 hours, and a full day is 24 hours. Both fields must be positive finite numbers; zero, negative, missing, infinite, and non-numeric values are rejected rather than producing a misleading capacity. The returned watt-hour value describes the energy the load consumes. It is not automatically the nameplate capacity you should purchase, because conversion losses, battery aging, temperature, discharge limits, and reserve requirements can reduce usable energy.
Move from the ideal result to a practical selection
Treat the calculated capacity as the ideal minimum delivered to the device, then apply engineering margins appropriate to the complete system. If an inverter or voltage converter is 90 percent efficient, divide the ideal watt-hours by 0.90 before choosing a battery. If only 80 percent of the battery's nameplate energy should be used, divide again by 0.80. You may also add reserve for cold weather, cell aging, uncertain workloads, or a longer emergency window. Those adjustments are intentionally not hidden inside this calculator: returning the direct power-times-time result keeps the method transparent and lets you document each margin separately. Finally, confirm that the candidate battery can supply the required voltage, continuous power, surge power, and connector or protection requirements. Watt-hour capacity answers how much energy is needed, but it does not prove that a battery can safely deliver the load. For automated calculations, each API request costs $0.002; the deterministic response is suitable for sizing worksheets, quoting tools, monitoring dashboards, and reproducible design checks.
What you can do with it
Size a portable electronics battery
Convert a measured device wattage and a field runtime target into the minimum watt-hour capacity needed for a battery pack.
Plan backup power
Estimate the ideal stored energy needed to keep a router, controller, or other constant load operating through an outage.
Compare power stations
Create a common watt-hour requirement before comparing products, then separately account for inverter efficiency and usable capacity.
FAQ
What formula does the calculator use?
It uses capacity_wh = power_w × runtime_hours. Watts multiplied by hours produce watt-hours.
Does the result include efficiency losses?
No. The result is the ideal energy consumed by the stated load. Divide by your system efficiency and usable battery fraction when selecting practical nameplate capacity.
Can I enter minutes for runtime?
Convert minutes to hours first by dividing by 60. For example, 30 minutes is 0.5 hours.
Why are zero and negative inputs rejected?
Battery sizing for a consuming device requires positive power and positive operating time. Non-positive inputs do not describe the supported physical calculation.
How much does the API calculation cost?
Each request costs $0.002. The calculation is also available in the browser experience.
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-size \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"power_w":25,"runtime_hours":8}'const res = await fetch("https://api.kit.forhosting.com/elec/battery-size", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"power_w": 25,
"runtime_hours": 8
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/battery-size",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"power_w": 25,
"runtime_hours": 8
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/battery-size", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"power_w":25,"runtime_hours":8}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"power_w":25,"runtime_hours":8}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/battery-size", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"power_w": 25,
"runtime_hours": 8
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.battery_size",
"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. |