LED Resistor Calculator
Get the current-limiting resistor and the power rating it needs from your supply voltage and LED specs.
Formula
R = (Vs − n·Vf)/(I). An exact match is rare, so pick the next standard value up. The current drops a little, which is safer for the LED. Check the LED datasheet for its actual forward voltage.
Try it: where an LED really operates
An LED's current does not follow Ohm's law. The operating point is where its curve crosses the resistor's load line.
- LED current
- 18.3 mA
- LED voltage
- 3.17 V
- Voltage across R
- 1.83 V
- Power in R
- 33.5 mW
- Power in the LED
- 58 mW
- Simple estimate (Vs − Vf) ÷ R
- 18 mA
The resistor allows I = (Vs − V) ÷ R at any LED voltage V: a straight line that falls from Vs ÷ R at 0 V to zero at V = Vs. The LED draws almost nothing below its forward voltage and then its current climbs steeply. The circuit settles where both agree, which is the crossing point.
Because the LED curve is so steep, the LED voltage barely moves, and the simple estimate (Vs − Vf) ÷ R lands close to the real current. It drifts when Vs is only a little above Vf: then a small change in Vf changes the current a lot, which is why a 3.3 V supply drives a white LED unreliably. The curves use typical values, not a datasheet.
Worked example: a red LED on 5 V at 20 mA
- Voltage across the resistor: 5 V − 2.0 V = 3 V
- Resistance: R = (3 V)/(0.02 A) = 150 Ω (a standard E24 value, 150 Ω)
- Power: 3 V × 20 mA = 60 mW → with 2× margin a ¼ W resistor is plenty
LED resistor chart by supply voltage (20 mA)
| Supply | Red (2 V) | Green / blue (3 V) | White (3.2 V) |
|---|---|---|---|
| Supply3.3 V | Red (2 V)68 Ω | Green / blue (3 V)Too little headroom | White (3.2 V)Too little headroom |
| Supply5 V | Red (2 V)150 Ω | Green / blue (3 V)100 Ω | White (3.2 V)91 Ω |
| Supply9 V | Red (2 V)360 Ω | Green / blue (3 V)300 Ω | White (3.2 V)300 Ω |
| Supply12 V | Red (2 V)510 Ω | Green / blue (3 V)470 Ω | White (3.2 V)470 Ω |
| Supply24 V | Red (2 V)1.1 kΩ | Green / blue (3 V)1.1 kΩ | White (3.2 V)1.1 kΩ |
For 20 mA, rounded up to the next E24 value. With less than 0.8 V across the resistor, LED-to-LED forward voltage spread makes brightness unpredictable, so it is not recommended.
LED resistor chart by current (5 V supply)
| LED current | Red (2 V) | Green / blue (3 V) | White (3.2 V) |
|---|---|---|---|
| 2 mA | 1.5 kΩ | 1 kΩ | 910 Ω |
| 5 mA | 620 Ω | 430 Ω | 360 Ω |
| 10 mA | 300 Ω | 200 Ω | 180 Ω |
| 15 mA | 200 Ω | 150 Ω | 120 Ω |
| 20 mA | 150 Ω | 100 Ω | 91 Ω |
For a 5 V supply, rounded up to the next E24 value. Modern high-brightness LEDs are clearly visible at 2 to 5 mA, so indicator LEDs rarely need the full 20 mA.
Checked on our bench: the resistor sets the current
The numbers below are computed from values the site owner recorded in lab classes. Measured values are left exactly as recorded.
LED resistor maths rests on one assumption: the forward voltage Vf barely moves. Here is how well that holds, using a silicon rectifier diode whose voltage and current were measured in the lab. It isn't an LED, but it follows the same exponential law, just at a lower voltage.
| Diode voltage | Current (ammeter) |
|---|---|
| 581.9 mV | 681 µA |
| 647.3 mV | 2.68 mA |
| 700.9 mV | 8.52 mA |
| 739.7 mV | 20.3 mA |
| 759.6 mV | 32.5 mA |
While the current rose 12 times, from 2.68 mA to 32.5 mA, the voltage climbed only 112 mV. The diode can't set its own current, because a small change in voltage multiplies it, so a series resistor has to. The whole curve is in the diode cut-in voltage guide.
What if Vf is a bit off? With this calculator's defaults (5 V, 3.2 V, 20 mA) the standard resistor is 91 Ω, giving 19.8 mA. If the real Vf is 0.1 V lower you get 20.9 mA; 0.1 V higher gives 18.7 mA. That is about ±6%, which looks the same to the eye. The smaller the gap between supply and Vf (a blue LED on 3.3 V, say), the bigger this error gets, so measure your LED's Vf and type it in.
Wiring LEDs
From supply voltage to a resistor
- Enter the supply voltage, choose the LED colour (or type its forward voltage) and the current you want.
- Read the exact resistor value and the next standard value above it.
- Check the power in the resistor and pick a rating with margin.
Current and wiring mistakes
- Running every LED at 20 mA. 20 mA is a common maximum for 5 mm LEDs, not a target. Modern LEDs are bright at 2 to 10 mA, which also saves power and extends life.
- One resistor for several parallel LEDs. Forward voltages differ slightly, so one LED hogs the current. Give each LED its own resistor, or put LEDs in series with one resistor if the supply is high enough.
- Too little headroom. A white LED (about 3 V) on a 3.3 V supply leaves only 0.3 V across the resistor, so small changes in supply or forward voltage swing the current a lot. Use a higher supply or a constant-current driver.
Forward voltages to start from
Typical values at 20 mA are about 1.8 to 2.1 V for red, 2.0 to 2.2 V for yellow and older green, and 2.9 to 3.3 V for blue, white and true green. The datasheet value for your part is better than any table. Always round the resistor up, not down, so the current stays at or below what you planned.
Frequently asked questions
What happens if I connect an LED without a resistor?
Above its forward voltage, an LED's current rises very steeply. Without something limiting the current, it overheats and fails quickly. Always use a resistor or a constant-current driver.
What resistor do I need for an LED on 12 V?
At 20 mA, a red LED (about 2.0 V) needs 510 Ω and a white or blue LED (about 3.0 to 3.2 V) needs 470 Ω, rounded up to the next standard value. Putting two or three LEDs in series on one resistor wastes less power.
Can several LEDs in parallel share one resistor?
Forward voltages vary slightly from LED to LED, so current crowds into one of them. Give each parallel LED its own resistor.