LED Resistor Calculator

An LED needs a resistor in series to limit its current. The value is R = (Vs − Vf) ÷ I: the supply voltage minus the LED forward voltage, divided by the current. For a red LED (about 2 V) on a 9 V battery at 20 mA, that is (9 − 2) ÷ 0.02 = 350 Ω, so you use the next standard value up, 360 Ω or 390 Ω. This free LED resistor calculator does the maths for any colour, supply and number of LEDs, and shows the wattage you need.

LED resistor calculator

Find the resistor that keeps an LED at a safe current. Pick the LED colour, type your supply voltage and press Calculate.

Battery, USB, adapter or pin voltage.

Sets a typical forward voltage. Change it below if you have the datasheet.

20 mA suits most 3 mm and 5 mm LEDs.

For LEDs in parallel, give each one its own resistor and keep this at 1.

Try:

LED Resistor Formula

SymbolMeaningExample
VsSupply voltage9 V battery
VfLED forward voltage (from the colour or the datasheet)2.0 V for red
ILED current in amps (20 mA = 0.02 A)0.02 A
nNumber of LEDs in series1
RResistor value: R = (Vs − n × Vf) ÷ I350 Ω
PResistor power: P = (Vs − n × Vf) × I0.14 W
The LED resistor formula. Use volts, amps and ohms.

Worked Example: Red LED on a 9 V Battery

  1. Subtract the LED voltage from the supply: 9 V − 2 V = 7 V. This is the voltage the resistor has to drop.
  2. Divide by the current in amps: 7 V ÷ 0.02 A = 350 Ω.
  3. 350 Ω is not a standard value, so go up to 360 Ω (E24) or 390 Ω (E12). With 390 Ω the current is 7 ÷ 390 = 18 mA.
  4. Resistor power: 7 V × 0.018 A = 0.126 W. A 1/4 W resistor works; a 1/2 W one runs cooler.

The same formula is Ohm’s law applied to the resistor. The Ohm’s law calculator handles any other resistor sum.

LED Forward Voltage by Colour

The forward voltage (Vf) depends mainly on the colour, because different colours use different semiconductor materials. These are typical values for standard 3 mm and 5 mm LEDs at 20 mA.

LED colourTypical VfUsual rangeNotes
Infrared (850 to 940 nm)1.3 V1.2 to 1.6 VInvisible. Many phone cameras show it glowing.
Red2.0 V1.8 to 2.2 VThe most common indicator LED
Orange and amber2.1 V2.0 to 2.2 V
Yellow2.1 V2.0 to 2.2 V
Yellow-green (older type)2.2 V2.0 to 2.4 VDim, pale green
Bright green3.2 V2.8 to 3.6 VModern, strong pure green
Blue3.2 V2.8 to 3.6 V
White3.2 V2.8 to 3.6 VA blue LED with a yellow phosphor coating
UV (395 to 405 nm)3.4 V3.1 to 3.8 VDo not look straight into it
Typical LED forward voltages. If you have the datasheet, use its value.

If you do not know the colour family of a green LED, look at the light: a pale, yellowish green is usually the 2.2 V type, and a strong, pure green is usually the 3.2 V type. You can also check it with diode mode on your multimeter (see below).

LED Resistor Chart for Common Voltages

These values are for one LED at 20 mA, rounded up to the next E12 value. The number in brackets is the heat in the resistor.

SupplyRed LED (2.0 V)White or blue LED (3.2 V)
3.3 V (board pin or regulator)68 Ω (25 mW)Not reliable (only 0.1 V left for the resistor)
5 V (USB)150 Ω (60 mW)100 Ω (32 mW)
6 V (4 × AA)220 Ω (73 mW)150 Ω (52 mW)
9 V battery390 Ω (126 mW)330 Ω (102 mW)
12 V adapter560 Ω (179 mW)470 Ω (165 mW)
24 V1.2 kΩ (403 mW)1.2 kΩ (361 mW)
LED resistor values at 20 mA, next E12 value up.

Pick a resistor rated at least twice the heat shown: 1/8 W covers up to about 60 mW, 1/4 W up to about 125 mW, 1/2 W up to about 250 mW, and 1 W up to about 500 mW. A white LED on 3.3 V has too little voltage left over for a resistor to control the current well, so use 5 V for white and blue LEDs.

Wiring Several LEDs: Series or Parallel?

LEDs in Series

Chain the LEDs (the negative leg of one to the positive leg of the next) and use one resistor for the whole chain. The same current flows through every LED. The forward voltages add up, so the supply has to be higher than the total. Leave at least 1 V to 2 V for the resistor. On 12 V, three white LEDs (9.6 V) with a 120 Ω resistor give 20 mA, but four (12.8 V) will not light properly.

LEDs in Parallel

Give every LED its own resistor, and calculate each one as a single LED. Do not share one resistor between parallel LEDs. No two LEDs have exactly the same forward voltage, so the one with the lowest voltage takes most of the current. It runs bright and hot, may fail, and then the others take even more current. If you are combining resistors to reach a value, the series and parallel resistor calculator helps.

How Much Current Should an LED Get?

  • Standard 3 mm and 5 mm LEDs: 20 mA is the usual rating. Some allow 25 to 30 mA. Check the datasheet before going higher.
  • Indicator lights: modern LEDs are bright, and 5 to 10 mA is often enough for a power or status light.
  • Microcontroller pins: on an Arduino or ESP32, 5 to 10 mA per LED is safe and bright enough. Raspberry Pi pins are weaker, so keep their LEDs to a few mA, for example with a 330 Ω to 1 kΩ resistor on 3.3 V.
  • Small SMD LEDs: many are rated 5 to 20 mA. The datasheet value matters more here.
  • High-power LEDs (1 W and up): they run at 350 mA or more and need a constant-current driver and a heatsink. A resistor alone is not enough.

How to Test an LED with a Multimeter

  1. Set your multimeter to diode test mode (the diode symbol).
  2. Touch the red probe to the longer leg of the LED (the anode, positive) and the black probe to the shorter leg (the cathode, negative).
  3. A good red, yellow or green LED shows about 1.6 to 2.2 V, and it often glows faintly.
  4. Swap the probes. A good LED shows OL, which means no current flows in that direction.
  5. Blue, white and UV LEDs need about 3 V. Many meters do not supply that much in diode mode, so they may read OL both ways even when the LED is fine. Test them with a 3 V coin cell instead.

More detail is in my guide on how to test a diode with a multimeter, which also covers LEDs. To check the real current in your finished circuit, put the meter in series on the mA range, as shown in how to measure amps with a multimeter. Move the red lead back to the V socket afterwards.

Common LED Resistor Mistakes

  • No resistor at all. The LED takes as much current as the supply can give and burns out, sometimes instantly.
  • Wrong forward voltage. Using 2 V for a white LED gives too small a resistor and too much current. Pick the right colour.
  • LED in backwards. It will not light. Most LEDs only survive about 5 V in reverse, so do not leave them reversed on a higher supply.
  • Resistor too small in watts. On 12 V and 24 V the resistor gets warm. Check the power and choose a rating about twice that.
  • One resistor for parallel LEDs. Give each LED its own resistor.
  • Wrong colour bands. A 390 Ω resistor is orange, white, brown. Check yours with the resistor color code calculator.

Frequently Asked Questions

What resistor do I need for an LED on 5 V?

At 20 mA, a red LED needs 150 Ω and a white or blue LED needs about 90 Ω, so use 100 Ω. If the LED is only an indicator, 330 Ω to 1 kΩ gives a dimmer light and saves current.

What resistor do I need for an LED on 12 V?

At 20 mA, a red LED needs 500 Ω, so use 510 Ω or 560 Ω. A white or blue LED needs 440 Ω, so use 470 Ω. Use a 1/2 W resistor. In a car, calculate with 14.4 V, because that is what the system reaches with the engine running.

What resistor do I need for an LED on a 9 V battery?

A red LED at 20 mA needs 350 Ω, so use 360 Ω or 390 Ω. A white or blue LED needs 290 Ω, so use 300 Ω or 330 Ω.

Can I connect an LED without a resistor?

Not to a normal supply or battery. An LED does not limit its own current, so it can burn out in seconds. The exceptions are LEDs with a built-in resistor (sold for 5 V or 12 V) and LEDs driven by a constant-current driver.

Does the resistor go on the positive or negative side of the LED?

Either side works. The LED and resistor are in series, so the same current flows through both no matter which comes first.

Why pick the next resistor value up instead of the nearest?

A slightly higher resistor keeps the current at or a little below your target. The LED is only a tiny bit dimmer, and it runs safely inside its rating.

What wattage resistor do I need for an LED?

Work out P = (supply voltage − LED voltage) × current, then pick a resistor rated about twice that. For one LED at 20 mA, a 1/4 W resistor is plenty up to about 6 V and still works at 9 V, though it runs warm. At 12 V and above, use 1/2 W or more.

Can several LEDs share one resistor?

Only if they are in series. LEDs in parallel should each have their own resistor, because the LED with the lowest forward voltage would take most of the current.

Related Guides and Tools