kWh calculator
A 1000 W load running for 2 hours uses 2 kWh, the unit printed on utility bills and appliance labels. Enter watts and hours to get the energy in kilowatt-hours and the power in kilowatts; no tariff is applied. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Electrical power in watts
- 1,000
- Hours
- 2
- Kwh
- 2 kWh
- Energy kwh
- 2
- Power kw
- 1
- Precision
- 10
This kWh calculator converts electrical power in watts and a continuous running time in hours into energy consumed in kilowatt-hours, the unit that appears on utility bills and appliance labels. The definition is fully deterministic: energy in kilowatt-hours equals power in watts times time in hours divided by one thousand, which is the same as converting watts to kilowatts and then multiplying by hours. Zero power or zero running time is valid and yields zero energy; a negative running time is rejected because duration cannot go backward in this model; a negative power is rejected because this page answers consumed load energy rather than generation export. Small checks you may already know include one thousand watts for two hours yielding two kilowatt-hours, one hundred watts for ten hours yielding one kilowatt-hour, and fifteen hundred watts for half an hour yielding zero point seven five kilowatt-hours. The engine uses only finite arithmetic with no network calls, no sampling, and no date-dependent shortcuts.
What a kilowatt-hour measures and what you get
A kilowatt-hour is a unit of energy: one kilowatt of average power sustained for one hour. Electrical power is the rate of energy transfer; integrating a constant power over a running interval gives energy, and dividing watt-hours by one thousand converts to kilowatt-hours. With power given in watts and time in hours, the closed form is E equals P times t divided by one thousand.
That quantity is what residential meters accumulate, what many appliance nameplates imply when they list watts and typical daily use, and what first-order energy budgets use before tariffs and time-of-use rates enter the picture. This calculator is not a bill estimator: it does not multiply by a price per kilowatt-hour, apply demand charges, or model standby cycling. It answers only the energy integral under constant power.
Zero power or zero hours is valid and yields zero energy when the other factor is finite.
Where a kWh calculator fits in study, home energy, and software
Students meet kilowatt-hours when a physics or environmental-science unit introduces energy versus power, when a homework problem lists a device wattage and daily run time, or when a contest problem asks for total energy without calculus. Homeowners and facility staff use the same conversion to compare a heater, pump, or server against a monthly energy budget before applying a local tariff. Teachers can pre-generate answer keys for modest wattages and hours without trusting opaque calculator apps that silently switch units or confuse watts with kilowatt-hours.
Developers call the same contract from scripts to seed deterministic test vectors for energy dashboards, to normalize user-entered load parameters before a bill mock, or to satisfy programming-challenge statements that demand kilowatt-hours rather than a hand-waved sketch. Pair it with electrical power from voltage and current when you first need watts, then convert those watts and a duty cycle into kilowatt-hours here, and with other electronics helpers when you are building a small lab of free, deterministic energy tools.
What you can do with it
Homework and lab energy checks
Convert device wattage and run time into kilowatt-hours before grading worksheets or comparing energy budgets.
Home and facility load estimates
Estimate energy use of heaters, pumps, and appliances from nameplate watts and daily hours without applying a tariff.
FAQ
What does the kWh calculator cost?
It is free in your browser on this page.
What formula is used for kilowatt-hours?
Energy in kilowatt-hours is E = P · t / 1000, where P is power in watts and t is running time in hours. Equivalently, convert watts to kilowatts and multiply by hours.
What happens if running time is negative?
Negative duration is not accepted because energy consumed over a backward time interval is undefined in this calculator.
Can power be zero or can hours be zero?
Yes. Zero power or zero running time yields zero kilowatt-hours when the other input is finite and non-negative.
Does this tool calculate the cost of electricity?
No. It only converts watts and hours into kilowatt-hours. Multiply the result by your local tariff yourself if you need a bill estimate.
Related tools
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/kwh-calculator \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"power":1000,"hours":2}'const res = await fetch("https://api.kit.forhosting.com/elec/kwh-calculator", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"power": 1000,
"hours": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/kwh-calculator",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"power": 1000,
"hours": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/kwh-calculator", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"power":1000,"hours":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"power":1000,"hours":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/kwh-calculator", 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": 1000,
"hours": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.kwh_calculator",
"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.
Limits
max_abs_value | 1000000000000000 |
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. |
Technical notes
What kilowatt-hours mean and what the response contains
The response returns the normalized power in watts, the running time in hours, the energy in kilowatt-hours under both kwh and energy_kwh keys for convenience, the equivalent power in kilowatts, a method tag kwh_from_power_time, a short formula reminder, the precision used, and a unit hint kWh. There is no numerical integration of a varying load profile, no power-factor correction, and no Monte Carlo sampling: the engine either evaluates P times t over one thousand inside the supported numeric range or rejects the input with invalid_input. Rejected cases include a missing power or hours field, non-finite values, magnitudes above the documented ceiling, any negative running time, and any negative power, because this tool models non-negative consumed load.
How power and hours are read and how kilowatt-hours stay reproducible
Zero power is allowed and returns zero energy. Zero hours is allowed and returns zero energy. Optional leading plus signs and scientific notation on numeric strings are allowed when they parse as finite decimals; embedded spaces and non-numeric tokens are rejected. The preferred field for electrical power is power, but aliases P, W, watts, power_w, and load are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. Power must be finite and non-negative: a negative value fails with invalid_input and a message that names the field and explains that consumed energy is computed for non-negative load power, so a bad cell does not become a silent nonsense result. The preferred field for running time is hours, with aliases time, t, duration, running_time, and hours_run. Time must be finite and non-negative: any strictly negative duration is rejected with invalid_input because energy consumed over a backward interval is undefined in this calculator. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for the numeric outputs, defaulting to ten and capped at fifteen so JSON goldens stay stable. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing the watt-to-kilowatt-hour formula yourself.
Where a kWh calculator fits in study, home energy, and software
Product and education tools use the endpoint when a learner types watts and hours and the UI must show kilowatt-hours next to a simple energy formula. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.
Integration use cases
Deterministic test fixtures
Generate reproducible kWh values for unit tests, energy dashboards, and CI assertions on E = P·t/1000.