Choosing a resistor for an LED
Why an LED needs a resistor at all, how to pick the value, what power rating it needs, and why wiring LEDs in parallel off one resistor goes wrong.
Why an LED needs a resistor at all
A resistor obeys Ohm's law: double the voltage and you double the current, smoothly and predictably. A diode does not. Below its forward voltage an LED conducts almost nothing; above it, current climbs exponentially with only a tiny change in voltage. The transition is sharp enough that connecting an LED straight across a supply is not "running it at the wrong current" so much as "running it at whatever current the supply can deliver until something gives".
That exponential relationship also means the LED cannot regulate itself. Warm it up and its forward voltage falls slightly, which lets more current through, which warms it further. In a well-behaved circuit the resistor dominates and swallows that drift. Without one, the loop has nothing to stop it.
So the resistor is not there to protect the LED from the supply. It is there to convert a voltage source into something closer to a current source, which is what the LED actually wants.
The calculation
Everything follows from one application of Ohm's law to the part of the circuit that is not the LED:
R = (Vsupply − Vforward) / I
The supply pushes a fixed voltage. The LED drops its forward voltage, roughly regardless of current. Whatever is left appears across the resistor, and the resistor's value decides how much current that leftover voltage drives.
A worked case: a red LED with a 2.0 V forward drop, running at 15 mA, from a 5 V supply. The resistor sees 5 − 2 = 3 V, so R = 3 / 0.015 = 200 Ω. TheLED resistor calculator does this and the power arithmetic below in one step.
Forward voltage is not one number
The single biggest source of error here is treating forward voltage as a property of "an LED" rather than of the specific part. It varies mostly with the colour, because it is set by the semiconductor's band gap:
- Red, around 1.8–2.2 V
- Yellow and amber, around 2.0–2.4 V
- Green, around 2.0–3.4 V depending on the chemistry
- Blue and white, around 2.8–3.6 V
Those ranges are wide, and they matter most when the supply voltage is close to the forward voltage. Driving a 3.4 V white LED from 5 V leaves only 1.6 V across the resistor, so a 0.3 V error in the assumed forward voltage shifts the current by nearly 20%. Driving the same LED from 12 V leaves 8.6 V, and the same error moves the current by 3%. Low headroom makes everything sensitive — which is a good reason to prefer a higher supply where you have the choice.
The number that belongs in the calculation is the one on the datasheet for the part you are fitting, at the current you intend to run. If you do not have it, measure one.
The resistor's power rating
This step gets skipped constantly and it is the one that produces a burning smell. The resistor dissipates:
P = I² · R = (Vsupply − Vforward) · I
In the example above, 3 V across the resistor at 15 mA is 45 mW — entirely comfortable for a common 1/4 W part, and fine even for a 1/8 W one. Now run the same LED from 24 V: the resistor drops 22 V at 15 mA, which is 330 mW. A quarter-watt resistor in that position runs hot enough to discolour the board, and will drift and eventually fail.
A reasonable habit is to size the resistor for at least twice the calculated dissipation. Resistor power ratings assume free air at moderate ambient temperature, and a part packed between others on a board does not get that.
Picking a real value
The calculation almost never lands on a value you can buy, becausestandard resistors follow the E-series rather than a linear scale. 200 Ω happens to exist in E24; 187 Ω does not exist below E48.
Round up, not down. A larger resistor means less current, which means a slightly dimmer LED and a longer life. A smaller resistor means more current than you designed for. Since the eye responds roughly logarithmically, the brightness difference between 15 mA and 13 mA is barely perceptible, while the difference in stress on the part is real.
Tolerance rarely matters here. A 5% resistor shifts the current by about 5%, which is invisible. Spend the precision somewhere it counts.
Modern LEDs need far less current than the habit suggests
The familiar 20 mA figure is a legacy of older parts. A modern indicator LED is often uncomfortably bright at 20 mA and perfectly readable at 2 mA — and on a battery-powered device that difference is the whole power budget. If a panel indicator is the only thing awake, its current is the standby current.
Start low. Fit a resistor for a few milliamps, look at it in the light the device will actually live in, and only increase if you must. Bright enough to see is the requirement, not maximum rated current.
Do not share one resistor between parallel LEDs
This is the classic mistake and it looks entirely reasonable on a schematic: three LEDs in parallel, one resistor feeding them, a third of the current each. It does not work that way.
Parallel LEDs all sit at the same voltage, and their forward voltages differ slightly even within one batch. The lowest-Vf part conducts most, heats up, drops its forward voltage further, and takes even more of the current. The others sit progressively darker. At best the string is visibly uneven; at worst one part carries nearly all the current and fails, at which point the remainder redistribute onto the next weakest.
Give every parallel LED its own resistor. In series the problem disappears — the same current necessarily flows through all of them, so one resistor is correct. Just check the arithmetic: three white LEDs in series need over 10 V before any current flows at all, which is why series strings want a higher supply.
When a resistor is the wrong answer
A resistor wastes the difference between supply and forward voltage as heat, and at higher powers that becomes the dominant loss. Driving a 3 V LED at 350 mA from 12 V burns over 3 W in the resistor to deliver about 1 W to the LED. For anything beyond indicators — lighting, backlights, high-power emitters — use a constant-current driver instead. It regulates the current directly, wastes far less, and holds brightness steady as the supply sags.