Electricity cost calculator
A 1500 W heater running for 2.5 hours uses 3.75 kWh; multiply by your rate per kilowatt-hour and you have the running cost of that session. Enter watts, hours and your tariff, in any currency. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Appliance power in watts
- 1,500
- Hours
- 2.5
- Price per kwh
- 0.15
- Energy kwh
- 3.75
- Cost
- 0.5625
Household and commercial electricity bills are driven by energy in kilowatt-hours, not by the wattage printed on a nameplate alone. This electricity cost calculator multiplies appliance power in watts by hours of use, divides by one thousand to obtain energy in kWh, then multiplies by your tariff in currency units per kilowatt-hour to return a clear running cost. Negative power is rejected as invalid input so bad sensors and inverted signs never produce a nonsense credit.
How energy and cost are computed from power, hours, and tariff
Electrical energy is power integrated over time. When power is roughly constant over a use window, energy in kilowatt-hours equals power in watts times hours divided by one thousand: a fifteen-hundred-watt heater run for two and a half hours consumes three point seven five kWh. Running cost is that energy times your price per kilowatt-hour; at fifteen cents per kWh the same session costs about fifty-six cents.
Zero power or zero hours correctly yield zero energy and zero cost. Negative power is a hard error under the product contract because nameplate load cannot be negative; negative duration and negative tariff are likewise rejected so the response never pretends a utility pays you for ordinary resistive use.
What you can do with it
Household appliance running-cost estimates
Homeowners enter heater, dryer, or AC wattage, daily hours, and their kWh rate to see session and extrapolated monthly cost before buying a more efficient model.
Energy-audit and property dashboards
Auditors and property apps convert measured average watts and occupancy hours into kWh and currency for reports without scraping live utility APIs.
IoT and budget alerts
Smart-plug pipelines send power and on-time windows with a configured tariff to flag expensive loads and keep spending under a monthly budget.
FAQ
What happens if power is negative?
Negative power is not allowed; validation failures are not charged.
Is power in watts or kilowatts?
Power is in watts (W), the usual nameplate unit. Energy is returned in kilowatt-hours after dividing by 1000.
Is the electricity cost calculator free?
The browser tool runs free on your device.
Does it fetch my utility’s live rate?
The engine is deterministic arithmetic only—no network tariff lookup.
How do I estimate a fridge or heat pump that cycles on and off?
Enter the effective hours at full power, or an average power that already includes the on and off cycles. The calculator does not model thermostats, so it multiplies exactly the power and time you give it.
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/electrical-energy-cost \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"power_w":1500,"hours":2.5,"price_per_kwh":0.15}'const res = await fetch("https://api.kit.forhosting.com/elec/electrical-energy-cost", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"power_w": 1500,
"hours": 2.5,
"price_per_kwh": 0.15
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/electrical-energy-cost",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"power_w": 1500,
"hours": 2.5,
"price_per_kwh": 0.15
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/electrical-energy-cost", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"power_w":1500,"hours":2.5,"price_per_kwh":0.15}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"power_w":1500,"hours":2.5,"price_per_kwh":0.15}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/electrical-energy-cost", 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": 1500,
"hours": 2.5,
"price_per_kwh": 0.15
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.electrical_energy_cost",
"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. |
Technical notes
How energy and cost are computed from power, hours, and tariff
Send required fields power_w, hours, and price_per_kwh as JSON numbers or numeric strings. Aliases power, watts, P, and W map to power_w; time_h, duration_h, and h map to hours; rate, tariff, kwh_price, and price map to the tariff. Magnitude caps keep results finite on the Worker isolate. Identical inputs always produce identical JSON: pure arithmetic, no network, no random seed, and no wall clock.
Reading the response fields and choosing realistic inputs
The formula field is safe to show next to the numbers so users see energy equals watts times hours over one thousand and cost equals energy times tariff. Prefer nameplate or measured average watts rather than peak surge ratings unless you truly run at peak for the whole interval. On success the response echoes power_w, hours, and price_per_kwh after stable rounding, plus energy_kwh, cost, a human-readable formula string, and method equal to energy_kwh_times_tariff. Use energy_kwh when you only need consumption for carbon or usage dashboards; use cost when budgeting or comparing appliances at a stated rate. For intermittent loads such as refrigerators or heat pumps, send effective full-power hours or an average power that already folds in duty cycle—this endpoint does not model thermostats. Currency is whatever unit you use for price_per_kwh; the engine is unit-agnostic and does not convert dollars to euros. Missing required fields, non-finite values, and negative power all fail with invalid_input and are not charged after the engine rejects the request.
API usage, pricing, home-energy workflows, and practical limits
Call the free in-browser electricity cost calculator for quick household estimates, classroom demos, and retail comparisons without installing a spreadsheet. For multi-appliance bills, sum costs client-side or call once per appliance; the capability is intentionally single-load so each line item stays auditable. Send a JSON body with power_w, hours, and price_per_kwh (or the documented aliases). Use the prepaid API when a property-management portal, IoT dashboard, energy-audit tool, or budgeting app needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance. Pair this endpoint with watts-volts-amps tools when you first solve for power from voltage and current, then feed the resulting watts here with a duty window and tariff. Authors shipping SDKs can map energy_kwh and cost into tables that show kWh and money side by side—the same shape households see on a simplified utility breakdown.
Technical questions
How do I calculate electricity cost from appliance power?
Send power_w (watts), hours of use, and price_per_kwh. The response returns energy_kwh = (power_w × hours) / 1000 and cost = energy_kwh × price_per_kwh.