How to use the led resistor calculator
- Enter the supply voltage that powers the circuit.
- Enter the LED forward voltage from its data sheet and the current you want. Enter the number of LEDs if you wire several in series.
- Choose the standard value series, E12 or E24, that matches the resistors you have.
- Use the standard value that is rounded up, check the actual current, and choose a resistor with at least twice the power shown.
Formula
R = (Vs - n x Vf) / I
Vs = supply voltage, Vf = LED forward voltage, n = LEDs in series, I = current in amps
Power in the resistor P = (Vs - n x Vf) x I
Actual current with a standard value = (Vs - n x Vf) / R
The resistor drops the voltage that the LEDs do not use, so Ohm's law gives its value. Rounding up to a standard value gives a current at or below your target.
Worked example
A 5 V supply feeding one red LED with a 2 V drop at 20 mA needs (5 - 2) / 0.02 = 150 ohm, which is a standard E12 and E24 value. The resistor dissipates 3 V x 0.02 A = 60 mW, so a quarter watt resistor is plenty.
From a 9 V supply the exact value is 350 ohm. The next higher E12 value is 390 ohm, which gives 17.95 mA. The E24 series has 360 ohm, which lets about 19.4 mA through. Three LEDs in series from 12 V need exactly 300 ohm.
Why an LED needs a resistor
An LED has almost no resistance once it conducts, and its current rises very fast with a small voltage increase. Without a resistor, the current is limited only by the supply and the LED can burn out. The series resistor sets the current from the voltage left over.
Forward voltage and current
The forward voltage depends on the LED color and type, and it shifts a little with current and temperature. The 2 V in the default is an example for a red LED, so use the figure on your data sheet. Many LEDs are bright at 5 to 10 mA, which also saves power and heat, and the data sheet gives the maximum current.
Choosing standard values
Resistors come in preferred values. E12 has 12 values per decade with 10 percent tolerance, and E24 has 24 values with 5 percent tolerance. The tool rounds up so the LED sees no more than your target current. For more circuit math see the Ohm's law calculator and the resistor color code calculator.
Assumptions and limits
- Forward voltage is a value you enter. The default is an example for a red LED, not a specification.
- The standard values are the E12 and E24 preferred number series. Resistor tolerance moves the current slightly.
- A constant supply voltage is assumed. A battery that runs down will lower the current.
- The power rating suggestion of twice the dissipation is an example safety margin, not a rule.
Frequently asked questions
What size resistor do I need for an LED on 5 volts?
For a 2 V LED at 20 mA, 150 ohm. Use (5 - 2) / 0.02. For a lower current such as 10 mA, use 300 ohm.
What if I choose a resistor that is too small?
The current goes above your target, and the LED gets hotter and may fail early. Always round up to the next standard value.
Can I wire LEDs in parallel with one resistor?
It is better to give each LED its own resistor, because small differences between LEDs make one take more current. Series wiring shares one current.
How much power does the resistor need to handle?
Multiply the voltage across it by the current. The tool shows that value and doubles it as a suggested rating.