An LED is not a lamp you can connect straight to a battery. Once the voltage across it passes its forward voltage , the current rises almost vertically, and a few extra tenths of a volt are enough to burn it out. The simplest and most common way to set a safe current is a series resistor that takes up the voltage the LEDs do not use.
This LED resistor calculator works out that resistor for a single LED or a string of LEDs in series. Enter the supply voltage, choose a colour (which sets a typical forward voltage) or type the value from your datasheet, set the number of LEDs and the current you want. You get the exact resistance, the next standard value up in the E12 or E24 series (rounding up keeps the current at or below your target), the real current with that resistor, the power the resistor turns into heat and a wattage rating with a twofold safety margin.
If the supply is not higher than the sum of the forward voltages, no resistor can work and the calculator tells you so. To read the colour bands of the resistor you pick, use the resistor colour code calculator; to combine two resistors into an odd value, see the parallel resistor calculator.
How to use this calculator
- Enter the supply voltage (battery, USB 5 V, 12 V adapter…).
- Choose the LED colour, or “Custom” to type the forward voltage from the datasheet.
- Enter the number of LEDs in series in one string and the current you want (often 10–20 mA).
- Pick the E12 or E24 series, depending on the resistors you have.
- Read the resistor to use, the actual current, the power in the resistor and the recommended wattage.
The formula
The supply voltage is shared between the LEDs and the resistor. With identical LEDs in series, each dropping , Ohm’s law gives:
The chosen standard resistor sets the real current, and the resistor dissipates:
A resistor rated at least runs cool and lasts. The share of the input power that reaches the LEDs is .
Worked example
Two red LEDs on a 9 V battery at 15 mA. The LEDs take V, so the resistor sees 5 V:
The next E24 value is 360 Ω (390 Ω in E12). With 360 Ω the current is 13.9 mA and the resistor dissipates 69.4 mW, so a 0.25 W resistor is fine.
Three white LEDs on 12 V at 20 mA. V, = 120 Ω exactly, dissipating 48 mW: a 0.125 W part has the twofold margin.
Typical forward voltages
Forward voltage depends on the semiconductor, and therefore on the colour. The presets are typical values at about 20 mA; a real part can differ by a few tenths of a volt, so the datasheet always wins.
| Colour | Material | Typical |
|---|---|---|
| Infrared | GaAs | 1.2 V |
| Red, orange | AlGaAs, AlInGaP | 1.8 – 2.2 V |
| Yellow, yellow-green | AlInGaP, GaP | 2.0 – 2.4 V |
| True green, blue, white | InGaN | 2.8 – 3.6 V |
| Ultraviolet | InGaN | 3.2 – 3.8 V |
Several LEDs: series strings, not shared resistors
Putting LEDs in series with one resistor is efficient, because the same current flows through all of them. Putting LEDs in parallel on a single resistor is a classic mistake: small differences in forward voltage make one LED hog the current and fail first. Give every parallel string its own resistor. When the voltage left for the resistor is very small, or the resistor would dissipate watts, a constant-current driver is the better choice.
Frequently asked questions
What resistor do I need for an LED on 5 V?
For a red LED at 20 mA: (5 − 2.0) / 0.02 = 150 Ω. For a white or blue LED at 20 mA: (5 − 3.2) / 0.02 = 90 Ω, so use 91 Ω (E24) or 100 Ω (E12).
What resistor do I need for a 12 V LED?
One red LED at 20 mA needs (12 − 2.0) / 0.02 = 500 Ω, so 510 Ω in E24, dissipating about 0.2 W: choose a 0.5 W resistor. Three white LEDs in series need only 120 Ω and waste far less power.
Why round the resistor up rather than to the nearest value?
A larger resistor gives slightly less current than your target, which is always safe. Rounding down could push the LED above its rating. The loss of brightness from a few percent less current is not visible.
Can I run an LED without a resistor?
Only from a constant-current driver or a source whose internal resistance limits the current, such as some coin cells. From a voltage source, the current is set only by the steep LED curve and can rise far above the rating.
How many LEDs can I put in series?
As many as keep the total forward voltage below the supply with some headroom, ideally leaving at least 10–20 % of the voltage for the resistor so the current stays stable when the LEDs warm up.
Sources
- Horowitz & Hill — The Art of Electronics, 3rd ed. (LEDs and current limiting, ch. 1 and 12)
- Kingbright WP7113SRD/D datasheet — forward voltage 1.85 V typ., 2.5 V max. at 20 mA
- IEC 60063 — Preferred number series for resistors and capacitors (E12, E24)
Last updated: