LED Resistor Calculator
Work out the current-limiting resistor for one LED or a string of LEDs in series. Get the nearest standard value, the actual current and the wattage to buy.
Why an LED needs a resistor
An LED is not like a light bulb. Once the voltage across it reaches its forward voltage, a small rise in voltage causes a big rise in current. Connected straight to a battery or a 5 V pin, it draws far more current than it can handle and burns out, sometimes in less than a second. A resistor in series limits the current to a safe level.
LED resistor formula
The resistor takes whatever voltage the LED does not use. Divide that by the current you want:
R = (Vsupply − Vf × number of LEDs) / ILED
Use the current in amps: 20 mA is 0.02 A. The power in the resistor is P = I² × R, and it is good practice to choose a resistor rated for at least twice that.
Worked example: a red LED on 5 V
A red LED with a forward voltage of 2.0 V at 20 mA, on a 5 V supply:
- Voltage across the resistor: 5 − 2.0 = 3.0 V
- Resistance: 3.0 / 0.02 = 150 Ω
- Power: 0.02² × 150 = 0.06 W, so a common 1/4 W resistor is plenty
The calculator rounds up to the next standard (E24) value, so the current ends up at or slightly below your target, never above it.
Typical LED forward voltages
| LED color | Typical Vf |
|---|---|
| Infrared | 1.2–1.5 V |
| Red | 1.8–2.2 V |
| Orange, yellow | 2.0–2.2 V |
| Yellow-green (older green) | 2.0–2.4 V |
| True green, blue, white | 2.8–3.4 V |
| Ultraviolet | 3.2–3.8 V |
These are typical figures at 20 mA. The datasheet for your exact LED is always more reliable. If you do not have one, using the lower end of the range gives a slightly larger resistor and a safer, slightly dimmer LED.
How much current should an LED get?
Standard 3 mm and 5 mm indicator LEDs are usually rated for 20 mA continuous, but modern LEDs are bright, and 5 to 10 mA is often plenty for a status light. Lower current means longer life and less load on a microcontroller pin. Many microcontroller pins should not supply more than about 10 to 20 mA each, so check yours. High-power LEDs (350 mA and up) should use a constant-current driver rather than a resistor.
Several LEDs
LEDs in series
Set LEDs in series to the number in the string. Their forward voltages add up, so three white LEDs need about 9.6 V before any current flows. The supply must be higher than the total, with a few volts left over for the resistor to regulate the current properly.
LEDs in parallel
Give each LED (or each series string) its own resistor. Sharing one resistor between parallel LEDs looks tidy, but small differences in forward voltage mean one LED takes most of the current.
Frequently asked questions
What resistor do I need for an LED on 5 V?
For a red LED at 20 mA, 150 Ω. For blue or white (about 3.2 V) at 20 mA, 90 Ω works out, so use the next standard value up, 91 Ω or 100 Ω. For a dimmer 10 mA, double those values.
What resistor do I need for an LED on 12 V?
A single red LED at 20 mA needs (12 − 2) / 0.02 = 500 Ω, so use 510 Ω, which dissipates about 0.2 W. A 1/2 W resistor gives a comfortable margin.
Does the resistor go before or after the LED?
Either side works. In a series circuit the same current flows everywhere, so the resistor limits it wherever it sits.
More calculators
-
Resistor Color Code Calculator
Decode 3, 4, 5 and 6-band resistors, or find the bands for a value.
-
Parallel Resistor Calculator
Total resistance of up to 20 resistors in parallel.
-
Series Resistor Calculator
Add up resistors in series, in any mix of units.
-
Ohm's Law Calculator
Enter any two of voltage, current, resistance and power.
-
Voltage Divider Calculator
Output voltage, or the resistor needed for a target voltage.
-
Voltage Drop Calculator
Voltage across each resistor in a series circuit.
-
Resistor Power Calculator
Power dissipated in a resistor and the wattage rating to buy.
-
SMD Resistor Code Calculator
Decode 3-digit, 4-digit, R and EIA-96 SMD markings.
-
Standard Resistor Values
Nearest E6 to E192 value for any resistance.