LED resistor calculator
Enter the supply voltage, the LED forward voltage and the current you want. The calculator gives the exact series resistor, the next stock value up, the current you will actually get with it and the power rating it needs. For several LEDs in one string, set how many are in series.
Example: use a 150 Ω resistor
The resistor drops 3 V, so the exact value is 150 Ω. The next E12 value at or above it is 150 Ω, which passes 20 mA and needs at least a 1/8 W part.
| Voltage across the resistor | 3 V |
|---|---|
| Exact resistance | 150 Ω |
| Power at the exact value | 60 mW |
| Next E12 value up | 150 Ω |
| Current with it | 20 mA |
| Power in it | 60 mW |
| Power rating (2× margin) | 1/8 W |
Worked from the formula shown for low-voltage DC circuits. Part values vary within their tolerance, so confirm with a multimeter and the parts' datasheets before you rely on a figure.
The answer is only as good as the forward voltage you entered. Take it, and the LED's maximum current, from its datasheet.
The formula, with a worked example
- Series resistor: R = (Vs − n × Vf) ÷ I, with the current I in amps (20 mA = 0.02 A) and n LEDs in the string.
- Power in the resistor: P = I² × R.
- Worked example: a 2 V red LED at 20 mA from a 5 V supply. The resistor has to drop 5 − 2 = 3 V, so R = 3 ÷ 0.02 = 150 Ω, which happens to be an E12 value.
- It turns 0.02² × 150 = 0.06 W (60 mW) into heat. Doubled for margin that is 0.12 W, so a 1/8 W part is enough and the usual 1/4 W one has room to spare.
- Between stock values, round up: 9 V with the same LED needs 350 Ω, the next E12 value is 390 Ω, and the current becomes 7 ÷ 390 = 17.9 mA.
Why an LED needs a series resistor
An LED is not a bulb. Below its forward voltage it barely conducts, and once past it the current climbs steeply for a tiny rise in voltage. Connect one straight across a supply that is even slightly too high and the current runs away until the chip overheats.
The resistor turns that steep curve into a gentle one. It drops whatever voltage the LED does not use, and because its drop rises in step with current, it holds the current near the value you designed for. That is why the formula starts from the voltage left over after the LED takes its share.
Finding the forward voltage and current
The datasheet lists a typical forward voltage at a test current, usually 20 mA for 5 mm indicator LEDs. Red, orange and yellow parts sit around 1.8 to 2.2 V. Blue, white and bright green parts are built differently and need about 2.9 to 3.4 V. The table below lists typical figures if the datasheet is missing.
For current, 20 mA is the usual maximum continuous rating for a small through-hole LED, and many run happily at 5 to 10 mA, especially modern high-efficiency parts that are already bright at a few milliamps. Running below the maximum also extends the LED's life.
If you have no datasheet at all, measure: put the LED in series with a 1 kΩ resistor on a known supply, then read the voltage across the LED. That is close to its forward voltage at the low current you used.
Rounding to a value you can buy
The exact answer is rarely a stock value, so the calculator rounds up to the next E12 value, the series every starter kit carries. Rounding up lowers the current a little, which is the direction you want: slightly dimmer is fine, slightly over the maximum is not.
The result shows the current and power with the stock part, so you can see the real figures you are building with. If the next value up dims the LED too much, try the nearest E24 value instead, or put two resistors in series to land closer.
Several LEDs: series strings and parallel branches
LEDs in series share one current, so one resistor serves the whole string. Add their forward voltages: three white LEDs at 3.2 V need 9.6 V before the resistor gets any, which is why a 12 V supply suits three of them and a 5 V supply suits only one.
Leave the resistor a healthy share of the supply, ideally a volt or more. When the string uses up almost all of the supply, small differences between LEDs swing the current a lot, and the calculation stops predicting what you will see.
For parallel LEDs, give each branch its own resistor. Two LEDs sharing one resistor do not split the current evenly, because the one with the lower forward voltage takes more, warms up, drops its voltage further and takes more still.
Power rating and heat
The resistor turns its voltage drop times the current into heat. On 5 V that is a few tens of milliwatts, but on 12 V or 24 V a single LED can make a resistor dissipate more than a quarter watt. The calculator picks the smallest common rating with at least twice the power, which keeps the part from running hot.
If the rating comes out large, the supply is much higher than the LEDs need. Add more LEDs to the string to use up the voltage, or switch to a constant-current driver, which wastes far less energy than a resistor on a high supply.
Typical LED forward voltages, with the resistor at 20 mA
| LED | Typical Vf | Usual range | Resistor at 5 V | Resistor at 12 V |
|---|---|---|---|---|
| Infrared | 1.3 V | 1.2 to 1.5 V | 220 Ω | 560 Ω |
| Red | 2 V | 1.8 to 2.2 V | 150 Ω | 560 Ω |
| Orange | 2.1 V | 1.9 to 2.2 V | 150 Ω | 560 Ω |
| Yellow | 2.1 V | 2.0 to 2.2 V | 150 Ω | 560 Ω |
| Yellow-green (older green) | 2.1 V | 1.9 to 2.4 V | 150 Ω | 560 Ω |
| Bright green | 3.2 V | 2.9 to 3.4 V | 100 Ω | 470 Ω |
| Blue | 3.2 V | 2.9 to 3.4 V | 100 Ω | 470 Ω |
| White | 3.2 V | 2.9 to 3.4 V | 100 Ω | 470 Ω |
One LED per resistor, rounded up to the next E12 value. Datasheets vary, so use your LED's own figure when you have it.
Frequently asked questions
What resistor do I need for an LED on 5 V?
For a 2 V red, yellow or orange LED at 20 mA, 150 Ω. For a 3.2 V blue or white LED the exact answer is 90 Ω, so use 100 Ω, which gives 18 mA.
What resistor do I need for an LED on 12 V?
For one 2 V red LED at 20 mA, the exact answer is 500 Ω, so use 560 Ω. The current is then 17.9 mA and the resistor dissipates about 0.18 W, so pick a 1/2 W part.
Can I run a white LED from 3.3 V?
Only with care. A 3.2 V LED at 20 mA works out at 5 Ω, but the same resistor gives 60 mA if the LED turns out to need 3.0 V. With so little headroom, use a lower current, a higher supply, or a constant-current driver.
Can several LEDs in parallel share one resistor?
It is a poor idea. The LEDs never match exactly, so one takes most of the current and burns out early, then the next one takes the lot. Give every parallel branch its own resistor.
Does the resistor go before or after the LED?
Either side works. In a series circuit the same current flows through every part, so the resistor limits it from the anode side or the cathode side equally.
What happens if I use a larger resistor than calculated?
The LED gets less current and is dimmer, and nothing else changes. A larger value is the forgiving direction, which is why the calculator rounds up.
Need a value that is not in the drawer? Combine two or more parts in series or parallel with the Parallel and series resistor calculator.
Other calculators on this site
-
Resistor color code calculator
Read 4, 5 and 6-band resistors: value, tolerance and the range a meter should show.
-
Voltage divider calculator
Output voltage, current and power of a two-resistor divider, with the R2 for a target voltage.
-
Parallel and series resistor calculator
Total resistance of two to six resistors in parallel and in series, with each one's current and power.
-
Ohm's law calculator
Enter any two of voltage, current, resistance and power to get the other two.
-
Resistor voltage drop calculator
The voltage across a resistor from the current, or from the supply and the rest of the circuit.
-
SMD resistor code calculator
Decode 3-digit, 4-digit, R and EIA-96 codes on surface-mount resistors.
-
RC time constant calculator
τ = RC, the capacitor voltage at each time constant, and the filter cutoff.