LED Resistor Calculator Formula

Understand the math behind the led resistor calculator. Each variable explained with a worked example.

Formulas Used

Required Resistance

resistor_ohm = (supply_voltage - led_forward_voltage) / led_current_a

Resistor Power Dissipation

resistor_power_mw = (supply_voltage - led_forward_voltage) * led_current_a * 1000

Variables

VariableDescriptionDefault
supply_voltageSupply Voltage(V)5
led_forward_voltageLED Forward Voltage(V)2
led_current_maLED Current(mA)20
led_current_aDerived value= led_current_ma / 1000calculated

How It Works

How to Size a Resistor for an LED

An LED needs a series resistor to limit current.

Formula

R = (V_supply - V_led) / I_led

Where:

  • V_supply = Source voltage
  • V_led = LED forward voltage drop
  • I_led = Desired LED current (commonly 20 mA)
  • Power dissipated in the resistor is P = (V_supply - V_led) x I_led.

    Worked Example

    Drive a red LED (2.0 V forward) at 20 mA from a 5 V supply.

    supply_voltage = 5led_forward_voltage = 2led_current_ma = 20
    1. 01Voltage across resistor = 5 - 2.0 = 3.0 V
    2. 02Current in amps = 20 / 1000 = 0.02 A
    3. 03R = 3.0 / 0.02 = 150 ohms
    4. 04Power = 3.0 x 0.02 = 0.06 W = 60 mW

    When to Use This Formula

    • Wiring an LED to a battery or power supply and needing to know which resistor to place in series so the LED gets the right current without burning out.
    • Designing a circuit with multiple LEDs in series where you need to subtract all forward voltage drops before calculating the resistor value.
    • Prototyping on a breadboard and selecting the nearest standard resistor value (E12 or E24 series) from your parts bin.
    • Powering indicator LEDs from a 5V Arduino or 3.3V microcontroller GPIO pin, where the source voltage and LED color determine the required resistance.
    • Replacing a burned-out LED in an existing circuit and recalculating the resistor because the new LED has a different forward voltage or current rating.

    Common Mistakes to Avoid

    • Forgetting to subtract the LED forward voltage from the supply voltage — the resistor only drops the difference (Vs - Vf), not the full supply voltage. Using Vs alone makes the resistor too large and the LED too dim.
    • Using the wrong forward voltage for the LED color — red LEDs typically drop about 1.8-2.0V, while blue and white LEDs drop 3.0-3.4V. Using a generic 2V for a blue LED underestimates the needed voltage headroom.
    • Not checking the resistor power rating — a resistor that is technically the correct ohm value may overheat if the power dissipation (P = I²R) exceeds its wattage rating, typically 0.25W for standard resistors.
    • Wiring multiple LEDs in parallel with a single shared resistor — each LED has slightly different forward voltage, so the one with the lowest Vf hogs the current and the others may be dim or off. Use one resistor per LED or wire LEDs in series.

    Frequently Asked Questions

    What happens without the resistor?

    The LED draws excessive current and burns out within seconds.

    How do I know my LED forward voltage?

    Check the datasheet. Typical: red 1.8-2.0 V, green 2.0-2.2 V, blue/white 3.0-3.3 V.

    What if the exact resistor is unavailable?

    Round up to the next standard value. Slightly higher resistance is safe for the LED.

    Learn More

    Guide

    LED Resistor Calculator Guide

    Learn how to calculate the correct resistor value for an LED circuit. Covers forward voltage, forward current, single and series LEDs, and common mistakes to avoid.

    Ready to run the numbers?

    Open LED Resistor Calculator