DevTools Logo

Ohm's Law Calculator

Ohm's Law Calculator

Solve V = IR and P = VI from any two values, or size an LED series resistor.

Runs in your browser
Mode
Try an example

Known values

2 of 2 filled

Exactly two values are used. Focusing a dimmed field replaces the oldest value.

Results

Idealized DC circuits only. AC impedance, RMS and peak values are out of scope.
Derived values
I = 50 mA · P = 250 mW
Voltage (V)
5 V (known)
Current (I)
50 mA
I = V / R = 5 V / 100 Ω = 50 mA
Resistance (R)
100 Ω (known)
Power (P)
250 mW
P = V² / R = 5 V² / 100 Ω = 250 mW

Use at least 1/2 W (2× headroom).

Examples

5 V across a 100 Ω resistor

Input
V = 5 V, R = 100 Ω
Output
I = 50 mA · P = 250 mW · use at least 1/2 W

The 250 mW dissipation is doubled to 500 mW for headroom, so a quarter-watt resistor is not enough for a comfortable design.

LED on a 5 V supply

Input
Vs = 5 V, Vf = 2.0 V, If = 20 mA, E12
Output
R = 150 Ω (exact and E12) · I = 20 mA · P = 60 mW

The classic Arduino LED case lands exactly on an E12 value, so snapping neither raises nor lowers the target current.

Snapping a tight LED budget

Input
Vs = 5 V, Vf = 2.8 V, If = 25 mA, E12
Output
R = 88 Ω exact → 100 Ω chosen · I = 22 mA · P = 48.4 mW

The exact 88 Ω would become 82 Ω if you rounded to the nearest E12 part, overdriving the LED. The calculator snaps upward to 100 Ω and reports the resulting current.

About this tool

Ohm's law relates voltage, current and resistance through V = IR. The power law adds a fourth quantity: P = VI, which can be rewritten as P = I²R or P = V²/R depending on what you already know. Between them, these equations form the 'power wheel' every electronics student learns. This calculator takes any two of V, I, R and P, solves the remaining pair, and prints each formula with the substituted values so you can follow the work rather than trusting a single number.

Values are handled in SI base units internally — volts, amperes, ohms and watts — while the interface lets you pick mV, mA, kΩ, mW and friends. You can also type engineering notation directly: 470m means 470 milliohms, 4.7k means 4.7 kiloohms, and embedded forms like 1M2 or 4k7 mean 1.2 MΩ and 4.7 kΩ. Lowercase m (milli) and uppercase M (mega) are deliberately different; when a typed inline prefix appears, it wins over the unit selector for that field and a warning says so.

A solved circuit is only half the story in practice. The tool compares the dissipated power with common resistor ratings — 1/8, 1/4, 1/2, 1, 2 and 5 W — and recommends at least twice the dissipation as a rule-of-thumb headroom. If even 5 W is not enough, it says so and points toward power resistors with heatsinking instead of quietly producing an impossible recommendation. You can change the headroom factor to 1.5× or 3× for a different design margin.

LED mode answers the other question hobbyists ask constantly: what series resistor does this LED need? Enter the supply voltage, the LED's forward voltage and the target current; the tool computes R = (Vs − Vf) / If, then optionally snaps up to the next E12 or E24 value and recomputes the actual current and dissipation using that real part. A tolerance option shows how far the current can drift with ±1%, ±5% or ±10% resistors. Everything runs in your browser with no uploads. The model is idealized DC: real LEDs, mains circuits and thermal design need their own safety review.

What this tool does not do

  • DC and ideal linear components only; AC impedance, power factor and RMS/peak conversions are not modelled.
  • LED forward voltage is treated as a fixed input. Real Vf shifts with current, temperature and device batch, so the calculated resistor is a starting point.
  • Resistor ratings are common through-hole values up to 5 W; anything larger gets a qualitative note rather than a part number.
  • The tolerance view covers the resistor only. It does not include supply regulation, LED Vf spread or ageing.

How to use this tool

  1. Pick a mode

    Use Solver for a generic V/I/R/P problem or LED resistor for a single LED on a DC supply. The derating selector sets the safety margin for the power-rating advice.

  2. Enter exactly two known values

    Fill any two of voltage, current, resistance and power with a plain number or engineering notation such as 20m or 4.7k, then choose a unit for each field. Focusing a third, dimmed field clears the oldest value so you can swap pairs.

  3. Read the derived values and formulas

    The output shows the two computed quantities with the formula and substituted values used. A rating verdict below them states the minimum resistor wattage with the selected headroom.

  4. Check the practical details

    For LEDs, select Exact or an E12/E24 snap-up value and a tolerance; the tool then shows actual current, dissipation and the tolerance range. Copy or download the result as plain text for notes or a parts list.

Use cases

Homework and exam practice

Work through any V/I/R/P pair, see the formula and substituted numbers, and check a textbook answer without guessing which rearrangement applies.

Checking a resistor before you solder

Find the dissipation in a real circuit and compare it with the wattage of the part in your drawer. The 2× headroom rule flags the cases where a quarter-watt resistor would run too hot.

Sizing an LED series resistor

Turn a supply voltage and an LED forward voltage into a concrete resistor value, then confirm the current with the nearest E12/E24 part and its tolerance spread.

Formula reference (DC, ideal components)

Known pairWhat the calculator derives
Voltage + current (V, I)R = V / I and P = V × I
Voltage + resistance (V, R)I = V / R and P = V² / R
Voltage + power (V, P)I = P / V and R = V² / P
Current + resistance (I, R)V = I × R and P = I² × R
Current + power (I, P)V = P / I and R = P / I²
Resistance + power (R, P)V = √(P × R) and I = √(P / R)
LED helper (Vs, Vf, If)R = (Vs − Vf) / If, then P = I² × R for the chosen resistor

Prefixes: m = 10⁻³, µ/u = 10⁻⁶, k/K = 10³, M = 10⁶. An inline prefix in a typed value overrides that field's unit selector. All maths is DC; AC impedance and RMS/peak conversions are not supported.

Common mistakes

Mistake:Rounding the LED resistor to the nearest E-series value.

Fix:A protection resistor should be snapped up, not to the nearest part: 88 Ω rounded to 82 Ω raises the LED current by about 7%. This tool offers E12/E24 snap-up and shows the resulting current.

Mistake:Treating lowercase m and uppercase M as the same prefix.

Fix:470m is 0.47 and 1M2 is 1,200,000, a factor of more than two billion apart. The parser is case-sensitive for m, k/K and M; an inline prefix wins over the unit selector, with a warning.

Mistake:Choosing a resistor rated only for the calculated dissipation.

Fix:Use the stated headroom (2× by default): 250 mW of dissipation calls for a 1/2 W part, not a 1/4 W one. Real resistors derate as ambient temperature rises, so leave margin.

Mistake:Applying DC Ohm's law directly to a mains or RF circuit.

Fix:For AC, impedance replaces resistance and RMS versus peak matters. This tool is DC only; do not use its output for mains wiring or antenna matching without a proper AC analysis.

Frequently asked questions

What two values do I need for Ohm's law?

Any two of voltage (V), current (I), resistance (R) and power (P) are enough. For example, voltage plus resistance gives current from I = V / R and power from P = V² / R; current plus power gives V = P / I and R = P / I². The calculator covers all six possible pairs and prints each formula with your numbers substituted, so you can check the working as well as the answer.

How do I calculate power dissipation?

Use whichever form fits the values you know: P = V × I, P = I² × R or P = V² / R. The result is in watts; 250 mW, for instance, is a quarter of a watt. Dissipation matters because the resistor must be able to shed that heat — pick a rating with headroom above the calculated value, not merely equal to it.

What resistor do I need for an LED?

Subtract the LED's forward voltage from your supply voltage, then divide by the target current in amperes: R = (Vs − Vf) / If. For a 5 V supply, a 2.0 V red LED and 20 mA, that is (5 − 2) / 0.02 = 150 Ω. If 150 Ω is not a part you have, snap upward to the next E12 or E24 value — never downward, because a smaller resistor overdrives the LED — and check the resulting current and power.

Why recommend a higher wattage resistor?

Resistors are rated for the power they can dissipate safely at a specified ambient temperature. Running at the limit leaves no margin for tolerance, supply variation or a warm enclosure, so the rule of thumb is to choose at least twice the calculated dissipation: 250 mW calls for 1/2 W. You can change the headroom factor in the tool; for 3× margin the same circuit calls for 1 W. If the required rating exceeds 5 W, use a power resistor with heatsinking and verify the thermal design.

Does it work for AC circuits?

No. The calculator assumes DC and ideal linear components. In AC circuits resistance is replaced by impedance, which includes reactance and phase angle, and voltage and current may be quoted as RMS, peak or peak-to-peak values. Do not use the DC output for mains wiring, motor windings or antenna matching; perform an AC analysis with the correct phasors instead.

What do notations like 470m, 4.7k and 1M2 mean?

They are engineering prefixes written directly into the number. 470m is 470 milli, or 0.47 in base units; 4.7k is 4.7 kilo, or 4700; 1M2 means 1.2 mega, with the digit after the prefix acting as a decimal place. Case matters: lowercase m is milli (10⁻³) while uppercase M is mega (10⁶). If you type an inline prefix, it takes precedence over the unit selector for that field and the tool shows a warning so there is no double scaling.

Why does the LED resistor snap upward instead of to the nearest value?

A series resistor protects the LED, so rounding down removes protection. An exact 88 Ω requirement rounded to the nearest E12 part would become 82 Ω and push the current about 7% above target; snapping up to 100 Ω lowers the current slightly instead. The tool shows the exact value, the chosen value and the actual current and dissipation after snapping, plus the current range from resistor tolerance.

References & standards