ForHosting KIT · Engineering & construction

Ohm's law calculator

Give any two of voltage, current, resistance and power and the other two are worked out: 12 V at 2 A means 6 ohms and 24 watts. All six pairings are covered, from sizing a resistor to checking how much heat a part must handle. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Voltage (V)
12
Current (A)
2
You get
Resistance (Ω)
6
Power (W)
24
Known values
i, v

Takes exactly two of v (volts), i (amps), r (ohms) and p (watts) and solves for the remaining two using Ohm's law V=I*R and the power relation P=V*I, returning all four values plus the pair you supplied.

Ohm's law and power from any two values

The calculator works from the two identities V = I*R (Ohm's law) and P = V*I (electrical power), which together let any two of the four quantities determine the other two. You provide exactly two of v, i, r and p, and the tool solves the remaining pair, returning an object with all four fields v, i, r and p plus given, an alphabetically sorted list of the two inputs you supplied.

The reference example passes v 12 and i 2 and returns r 6 and p 24, with given set to i and v, showing a 12-volt, 2-amp load resolving to 6 ohms and 24 watts. Because it always echoes the full set, downstream code never has to remember which two it sent; it can read every quantity of the circuit from one consistent response.

The six input combinations

There are six ways to choose two of the four unknowns, and each has its own closed-form solution. Given v and i: r = v/i and p = v*i. Given v and r: i = v/r and p = v*v/r.

Given v and p: i = p/v and r = v*v/p. Given i and r: v = i*r and p = i*i*r. Given i and p: v = p/i and r = p/(i*i).

Given r and p: i = sqrt(p/r) and v = i*r. The square-root branch for the resistance-and-power case is the only one that is not a simple product or quotient, and it works because power dissipated in a resistor is I squared times R. Every branch is pure arithmetic on your two inputs, so the result depends only on the numbers you send, never on any hidden state.

Electronics design

Size a series resistor from a supply voltage and target current, or check the power a component must dissipate before choosing its rating.

LED and load calculations

From a known voltage and current, read back resistance and wattage to pick a resistor and confirm it stays within safe power limits.

Teaching and lab work

Demonstrate how V, I, R and P interrelate, using the deterministic 12 V / 2 A example returning 6 ohms and 24 watts as a reference answer.

How many values do I provide?

Exactly two of v, i, r and p. The tool solves the remaining two and returns all four plus the given pair.

What do v 12 and i 2 return?

r 6 and p 24, with given set to i and v, following r = v/i and p = v*i.

Which combinations are supported?

All six pairings of v, i, r and p, including r and p, which solves i = sqrt(p/r) then v = i*r.

How do I check the power a resistor has to handle?

Enter the voltage across it and its resistance. Power is the voltage squared divided by the resistance, so you can compare the result with the resistor's rating before you pick one.

Can I enter zero or a negative value?

No. Each of the two values must be greater than zero, so zero and negative numbers are refused. That keeps every division and the square root in the formulas meaningful.

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.

POSThttps://api.kit.forhosting.com/dev/ohm-law

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.

curl -X POST https://api.kit.forhosting.com/dev/ohm-law \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"v":12,"i":2}'
{
  "v": 12,
  "i": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "dev.ohm_law",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Validation, precision and determinism

Each supplied value must be a finite number strictly greater than zero, so zero, negatives, NaN and non-numbers are rejected with a message identifying the field, which also keeps the sqrt and division branches well defined. The decimals parameter is an integer from 0 to 10 and defaults to 6; a value outside that range is rejected rather than clamped. The tool counts how many of v, i, r and p are present and requires exactly two; sending one, three or four throws a typed invalid_input error naming the rule.

Can I use negative or zero values?

No. Each supplied value must be a finite number greater than zero, otherwise a typed invalid_input error is returned.

Is the browser tool free?

Yes, the widget is free (tier A). The API runs on prepaid KIT balance from $0.002 and charges only successful tasks.

Read the full KIT documentation →