Skip to content
🛠️ToolsShed

Ohm's Law Calculator

Calculate voltage, current, resistance, and power using Ohm's Law.

Enter any two values to calculate the other two

Formulas

V = I × R

P = V × I

P = I² × R

P = V² / R

I = V / R = √(P / R)

R = V / I = V² / P

About this tool

Ohm's Law is one of the fundamental principles of electrical engineering, describing the relationship between voltage, current, resistance, and power in an electrical circuit. This calculator makes it easy to determine any of these four values when you know the other quantities, eliminating the need for manual calculations or memorizing complex formulas.

Simply enter any two known values from your circuit—whether voltage (measured in volts), current (in amperes), resistance (in ohms), or power (in watts)—and the tool instantly calculates the remaining quantities. This is invaluable for designing circuits, troubleshooting electrical problems, sizing components, and understanding how changes in one parameter affect the others in real time.

Engineers, electricians, hobbyists, and students use this calculator daily when working with power supplies, LED circuits, resistor selection, and motor calculations. Whether you're verifying a component's suitability or exploring the behavior of a circuit design, Ohm's Law Calculator saves time and reduces arithmetic errors.

Frequently Asked Questions

Code Implementation

import math

# Ohm's Law: V = I * R,  P = V * I = I^2 * R = V^2 / R

def solve_ohm(V=None, I=None, R=None, P=None):
    """Solve for any two unknowns given two known values.
    Pass exactly two keyword arguments."""
    known = {k: v for k, v in {"V": V, "I": I, "R": R, "P": P}.items() if v is not None}
    if len(known) != 2:
        raise ValueError("Provide exactly 2 known values")

    # Derive missing values
    if V is None:
        if I and R: V = I * R
        elif P and I: V = P / I
        elif P and R: V = math.sqrt(P * R)
    if I is None:
        if V and R: I = V / R
        elif P and V: I = P / V
        elif P and R: I = math.sqrt(P / R)
    if R is None:
        if V and I: R = V / I
        elif P and I: R = P / I**2
        elif P and V: R = V**2 / P
    if P is None:
        if V and I: P = V * I
        elif I and R: P = I**2 * R
        elif V and R: P = V**2 / R

    return {"V": V, "I": I, "R": R, "P": P}

# Examples
print(solve_ohm(V=12, R=4))      # I=3A, P=36W
print(solve_ohm(P=100, R=25))    # V=50V, I=2A
print(solve_ohm(I=0.5, P=10))    # V=20V, R=40Ω

# Series resistors
r_series = sum([100, 220, 470])  # 790 Ω
print(f"Series: {r_series} Ω")

# Parallel resistors (two)
def parallel(r1, r2): return (r1 * r2) / (r1 + r2)
print(f"Parallel 100Ω||100Ω: {parallel(100,100)} Ω")  # 50 Ω

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.