Skip to content
Electronics

LED Resistor Calculator

Calculate the correct series resistor for any LED circuit. Enter your supply voltage, LED forward voltage, and desired current — get the exact resistance, nearest E12 standard value, and power rating.

5V

Simulated — dashes show current flow, LED glow scales with forward current (red shown for ~2V Vf)

Red/Yellow ≈ 2.0V · Green/Blue/White ≈ 3.0–3.4V

Standard 5mm LEDs typically run at 20mA

Recommended resistor

150.00 Ω

Exact calculated value
150.00 Ω
Voltage across resistor
3.00 V
Power dissipated
60.0 mW
Suggested wattage rating
1/4 W

How to pick an LED resistor

An LED is not a resistor: once the voltage across it reaches its forward voltage (Vf), current rises very steeply. Without something limiting it, the LED (or the GPIO pin driving it) burns out. The series resistor drops the extra voltage so the current settles where you want it:

R = (Vsupply − Vf) ÷ I

For a red LED on an Arduino Uno: (5 V − 2.0 V) ÷ 0.010 A = 300 Ω, so a 330 Ω resistor is the usual choice.

Typical forward voltage by LED colour

LED colourTypical VfResistor at 5 V, 10 mAResistor at 3.3 V, 10 mA
Infrared1.2–1.5 V360 Ω200 Ω
Red1.8–2.1 V300 Ω → 330 Ω130 Ω → 150 Ω
Yellow / orange2.0–2.2 V300 Ω → 330 Ω120 Ω
Green (standard)2.0–2.4 V270 Ω100 Ω
Blue / white / true green2.8–3.4 V180–220 Ω0–47 Ω (marginal)

Check your LED's datasheet if you have one. Blue and white LEDs on a 3.3 V pin (ESP32, Raspberry Pi Pico) have very little headroom: brightness varies a lot between parts, and a 1 mA–5 mA target is more realistic.

How much current should an LED get?

Standard 5 mm indicator LEDs are rated for 20 mA, but modern LEDs are bright at 2–10 mA. Running them below the rating makes them last longer and keeps GPIO current low. An ATmega328P pin is rated 20 mA continuous (40 mA absolute maximum), an ESP32 pin defaults to about 20 mA drive strength, and an RP2040 pin to 4 mA, so 5–10 mA per LED is a sensible design target for microcontroller projects.

Resistor power rating

The resistor dissipates P = I² × R. At 10 mA through 330 Ω that is 33 mW, so a standard ¼ W (250 mW) resistor is fine. Power only becomes a concern with high-current LEDs or high supply voltages, for example 20 mA from 24 V needs a 1.1 kΩ resistor dissipating about 0.44 W, so use a ½ W or 1 W part.

Several LEDs

  • In series: add the forward voltages, then size one resistor: R = (Vsupply − n·Vf) ÷ I. Three red LEDs on 12 V at 15 mA: (12 − 6) ÷ 0.015 = 400 Ω → 390 Ω.
  • In parallel: give each LED its own resistor. LEDs sharing one resistor do not share current evenly; the one with the lowest Vf hogs it and fails first.

For high-power LEDs (350 mA and above) a resistor wastes too much power. Use a constant-current LED driver instead.

Formula, inputs and worked examples

Formula and method

R = (Vsupply − Vf_LED) / I_LED; resistor power P = I_LED²R. Choose a standard value that keeps current within LED and driver ratings.

Worked examples

Red LED on a 5 V Arduino pin

Supply 5 V, forward voltage 2.0 V, target 15 mA. R = (5 − 2.0) / 0.015 = 200 Ω. The next standard E12 value is 220 Ω, which gives I = 3 / 220 = 13.6 mA and dissipates about 41 mW, well inside a ¼ W resistor.

Blue LED on a 3.3 V ESP32 pin

Supply 3.3 V, forward voltage 3.0 V, target 5 mA. R = 0.3 / 0.005 = 60 Ω, so choose 68 Ω (about 4.4 mA). With only 0.3 V across the resistor, a small change in forward voltage swings the current a lot: if the LED is really 3.2 V, the current drops to about 1.5 mA. Expect uneven brightness from blue and white LEDs on 3.3 V, or drive them from a higher rail through a transistor.

Three white LEDs in series from 12 V

Total forward voltage 3 × 3.0 = 9.0 V, target 20 mA. R = (12 − 9.0) / 0.02 = 150 Ω, dissipating 0.02² × 150 = 60 mW.

Inputs

  • Supply voltage — Unit: V
  • LED forward voltage — Unit: V per LED
  • Target LED current — Unit: mA
  • LED count in series — Unit: count

What the result means

  • Ideal series resistance — Unit: Ω
  • Recommended standard resistance — Unit: Ω
  • Resistor power dissipation — Unit: W

Practical tips and common mistakes

  • Round the resistor up to the next standard value. A slightly lower current is safe and barely visible; a higher one shortens LED life.
  • Forward voltage varies by colour: roughly 1.8–2.2 V for red and 3.0–3.4 V for blue and white. Use the datasheet value when you have it.
  • A GPIO pin can only supply limited current. If the LED needs more than the pin's rating, switch it with a transistor instead.
  • Give parallel LEDs their own resistors. Sharing one lets the LED with the lowest forward voltage hog the current.

Assumptions and limitations

  • Use the LED forward voltage at the intended current and temperature.
  • Check resistor power rating with margin and verify the GPIO or driver current limit.
  • For multiple LEDs, calculate each series string and account for supply tolerance.

Frequently asked questions

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

For a red, yellow or green LED at about 10 mA, use 330 Ω (220 Ω for brighter, 1 kΩ for a dim indicator). For blue or white LEDs at 5 V, 180–220 Ω gives about 10 mA.

What resistor for an LED on 3.3 V (ESP32 or Raspberry Pi)?

Red LEDs: 100–150 Ω for 10 mA, or 330 Ω–1 kΩ for a dimmer, lower-current indicator. Blue and white LEDs need about 3 V themselves, so use a small resistor (22–47 Ω) and expect low, variable brightness.

Can I use an LED without a resistor?

Only if something else limits the current, such as a constant-current driver or a coin cell's internal resistance. Connected straight to a GPIO pin or power supply, the current is limited only by the pin or supply and the LED or pin can be damaged.

Does the resistor go on the anode or cathode side?

Either side works. The same current flows through every part of a series circuit, so the resistor can sit between the supply and the anode or between the cathode and ground.

Should I round the resistor value up or down?

Round up to the next standard value. A slightly larger resistor gives slightly less current, which is always safe; rounding down can push the LED or pin past its rating.

Learn more

More Electronics