LED Resistor Calculator

Size the current-limiting resistor for any LED. Rounds up to the nearest E24 value, because rounding down overdrives the LED.

Inputs

V

The rail driving the LED. Accepts 3v3, 5, 12.

Typical indicator-LED values. Always prefer the datasheet figure.

V

Voltage dropped across one LED at the operating current.

A

Accepts 20m for 20 mA. Indicator LEDs are typically 5–20 mA.

Series LEDs share one resistor. Never parallel them on a single resistor.

Results

Ideal resistance150 ΩR = (Vs − n·Vf) / If
Use this E24 value
150 Ω
Actual LED current
20 mA
Resistor dissipation
60 mW
Power into the LED
40 mW
Efficiency
40 %

Resistor dissipates 60.0 mW — a 0.125 W part gives the usual 2× margin.

Diagram

Supply, series resistor and 1 LED5 V through a 150 Ω resistor gives 20 mA through the LED string.Vs5 VR150 ΩLED20 mA60 mW in R · 40% to LEDs

Worked examples

Red LED on 5 V

The default indicator LED on a 5 V logic board.

R = 150 Ω exactly — an E24 value with no compromise

Blue LED on 3.3 V

Blue and white LEDs drop over 3 V, leaving very little headroom on a 3.3 V rail.

Only 0.1 V across the resistor — this design is marginal

Three white LEDs in series on 12 V

Stacking LEDs in series is how you stop wasting most of the supply in the resistor.

9.6 V into the LEDs, only 2.4 V wasted — 80% efficient

Indicator on a 24 V industrial rail

High supply, one small LED. Watch what happens to the resistor dissipation and efficiency.

R = 1.1 kΩ dissipating 440 mW — and only 8% of the power reaches the LED

How to size an LED resistor

When to use this: any time an LED is connected to a voltage source. Panel indicators, status lights on a board, backlights, illuminated switches — all of them need a resistor, and this is how you pick it.

An LED is not a resistor. Its current rises exponentially with the voltage across it, so a tenth of a volt too much can double the current. Connect one directly across a supply and the only thing limiting the current is the LED’s own bulk resistance and whatever the supply can deliver — usually enough to destroy the part before you let go of the switch.

The series resistor solves this by taking up the difference between the supply and the LED’s forward voltage, and setting the current by Ohm’s law:

R = (Vsupply − Vf) / If

A red LED drops about 2 V and is happy at 20 mA. From a 5 V supply the resistor has to absorb 3 V, so R = 3 / 0.02 = 150 Ω. That happens to be an exact E24 value, which is why it turns up in every beginner tutorial.

Round up, not to nearest

This is the detail most calculators get wrong. When the ideal value is not a standard one, you round up to the next E24 value, never to the nearest.

Take a 12 V supply and a 2 V LED at 20 mA: R = 500 Ω. The E24 neighbours are 470 Ω and 510 Ω. Rounding to nearest picks 470 Ω, which gives 21.3 mA — above the target. Rounding up picks 510 Ω, giving 19.6 mA, comfortably under.

The 6% difference sounds trivial, and for one LED at room temperature it usually is. It stops being trivial when the supply is at the top of its tolerance, the LED is a low-Vf sample, and the part is in a warm enclosure. All three stack in the same direction, and the resistor is the only thing standing between the LED and its absolute maximum rating.

Typical forward voltages

ColourTypical VfChemistryNotes
Infrared1.2 – 1.6 VGaAsRemote controls, optocouplers
Red1.8 – 2.2 VAlGaAsThe classic indicator
Amber / Yellow2.0 – 2.2 VAlGaInPSimilar to red
Green2.0 – 3.4 VGaP or InGaNOld green is 2.2 V, modern pure green is over 3 V
Blue3.0 – 3.4 VInGaNLittle headroom on a 3.3 V rail
White3.0 – 3.4 VBlue + phosphorElectrically a blue LED

These are starting points, not specifications. Vf varies between manufacturing batches of the same part number, and it rises with current — a datasheet quoting 3.2 V at 20 mA might show 2.9 V at 5 mA. Use the datasheet figure at your operating current.

The efficiency problem

The resistor does not just set the current; it burns the excess voltage as heat. On a 5 V supply driving a 2 V LED, 60% of the power goes into the resistor. On a 24 V industrial rail driving the same LED, 92% is wasted.

SupplyLEDs in seriesPower to LEDsWasted in resistor
5 V1 red (2 V)40%60%
5 V2 red (4 V)80%20%
12 V1 white (3.2 V)27%73%
12 V3 white (9.6 V)80%20%

For a single indicator LED drawing 20 mA, wasting 60% of 100 mW is irrelevant. For anything with real light output — a lamp, a backlight, a strip — it matters enormously, and the two fixes are stacking LEDs in series or using a constant-current driver that switches rather than dissipates.

Series and parallel

Series works. LEDs in series carry identical current by definition, so one resistor sets the current for the whole string. The only constraint is that the supply must exceed the sum of the forward voltages with enough headroom left for the resistor to do its job — aim for at least 15–20% of the supply across the resistor, or current regulation gets poor.

Parallel does not. Two LEDs across one resistor look symmetric but are not. Whichever has the lower forward voltage takes more current, heats up, drops further in voltage, and takes more still. The result is one bright LED, one dim one, and an early failure. Give each parallel branch its own resistor.

Worked examples

Status LED on a 3.3 V microcontroller pin

A green LED (Vf ≈ 2.1 V) driven directly from a GPIO pin at 5 mA — low enough that the pin’s drive limit is not a concern:

R = (3.3 − 2.1) / 0.005 = 240 Ω
Dissipation = 1.2 × 0.005 = 6 mW

240 Ω is an E24 value. At 5 mA a modern green LED is still clearly visible indoors, and the GPIO pin is nowhere near its 20 mA limit.

Three white LEDs from 12 V

Total Vf = 3 × 3.2 = 9.6 V
R = (12 − 9.6) / 0.02 = 120 Ω
Dissipation = 2.4 × 0.02 = 48 mW

80% of the power reaches the LEDs. But note the fragility: if the supply sags to 11 V, the resistor only has 1.4 V across it and the current drops to 12 mA — a 40% reduction in brightness from an 8% supply change. Series strings with little headroom are very sensitive to supply variation, which is the argument for a constant-current driver.

When to stop using a resistor

  • High-power LEDs. Anything above about 100 mA should have a constant-current driver. The resistor would dissipate watts, and the LED’s forward voltage shifts enough with temperature to make resistor-set current unstable.
  • Wide supply range. If the supply varies — a battery over its discharge curve, for instance — resistor-set current varies with it. A driver holds current constant.
  • Dimming. Changing brightness by changing the resistor is crude. PWM at a few hundred hertz gives linear perceived dimming at constant colour, because the LED runs at its designed current whenever it is on.
  • Precision colour. LED colour shifts slightly with current. Applications that care use a driver to hold the operating point.

How to use this calculator

  1. Enter the supply voltage

    The rail the LED and resistor will be connected across.

  2. Set the forward voltage

    Pick a colour for a typical value, or enter the figure from your datasheet. Vf varies between parts of the same colour, so the datasheet always wins.

  3. Choose the forward current

    Standard indicator LEDs run at 20 mA, but modern high-brightness parts are often uncomfortably bright at that. 5–10 mA is frequently plenty.

  4. Use the rounded-up standard value

    Fit the E24 value shown, not the ideal one. It is the next value up, so the actual current stays below your target rather than above it.

Frequently asked questions

What resistor do I need for an LED?

R = (supply voltage − LED forward voltage) / forward current. A red LED with a 2 V drop running at 20 mA from a 5 V supply needs (5 − 2) / 0.02 = 150 Ω. Always round the result up to the next standard value.

Why round the resistor up rather than to the nearest value?

A larger resistor means less current, which is the safe direction. Rounding down pushes the current above the figure you designed for, which shortens LED life or destroys the part. The difference between rounding to nearest and rounding up is small in ohms and large in consequences.

What happens if I connect an LED without a resistor?

An LED is not ohmic — its current rises exponentially with voltage. Connected directly across a supply, the current is limited only by the LED’s own bulk resistance and the supply’s ability to deliver, which is usually enough to destroy it in milliseconds. The resistor is what sets the operating point.

Can I put several LEDs on one resistor?

In series, yes — they carry the same current, so one resistor controls all of them. In parallel, no. Small differences in forward voltage mean one LED takes most of the current, runs hot, drops further in voltage, and takes even more. Each parallel branch needs its own resistor.

What forward voltage should I use?

Use the datasheet value at your intended current, because Vf rises with current. As rough guidance: infrared 1.4 V, red 2.0 V, amber 2.1 V, green 2.2 V, blue and white 3.2 V. Individual parts vary by several tenths of a volt, which matters most when the headroom is small.

How much current should an LED get?

Traditional indicator LEDs are specified at 20 mA, and that is where the brightness figures in older datasheets are quoted. Modern high-efficiency parts are often too bright at 20 mA for a panel indicator — 2–5 mA is frequently enough. Lower current also means a cooler resistor and longer LED life.

Does the resistor go before or after the LED?

Electrically it makes no difference — they are in series, so the same current flows through both regardless of order. Convention puts the resistor on the supply side, but a circuit with it on the ground side behaves identically.

Why is my resistor getting hot?

The resistor dissipates (Vs − Vf) × If. On a high supply voltage with a single LED, most of the supply power ends up in the resistor rather than the LED — a 24 V rail driving one 2 V LED wastes 92% of the power as heat. Put more LEDs in series, or use a constant-current driver.

Sources and further reading

Last reviewed .

Related calculators