How the LED resistor is calculated
An LED drops a roughly fixed voltage (its forward voltage, Vf) and the resistor takes the rest. Ohm's law on the resistor gives:
R = (Vsupply − n × Vf) / ILED
where n is the number of LEDs in series. The calculator rounds up to the next E12 value, so the real current is slightly below your target rather than above it, and it shows that real current.
Example: 5 V supply, red LED (2.0 V), 20 mA → R = (5 − 2) / 0.02 = 150 Ω. 150 Ω is an E12 value, the resistor dissipates 0.06 W, and a ¼ W resistor is plenty.
Choosing the power rating
The resistor turns (Vsupply − n·Vf) × I into heat. The calculator picks the smallest common rating that is at least twice that power — running a resistor at its full rating makes it hot and shortens its life. More on this in how to check a resistor's power rating.
Why simulate it?
Forward voltage is not a constant: it depends on current, colour and the part. A simulation with a real diode model shows the current you actually get and whether the LED lights at all. Press Simulate this circuit and CircuPilot builds the schematic with an ammeter in series, ready to run — no install, no sign-up.
Longer explanation with worked examples: What resistor do I need for an LED?
FAQ
What resistor do I need for an LED on 5 V?
For a red LED at 20 mA, 150 Ω. For blue or white LEDs (≈3.2 V) at 20 mA, (5 − 3.2) / 0.02 = 90 Ω, so use the next standard value, 100 Ω.
What resistor for an LED on 12 V?
For one red LED at 20 mA: (12 − 2) / 0.02 = 500 Ω → use 560 Ω and a ¼ W resistor (it dissipates about 0.18 W). Putting three or four LEDs in series on 12 V wastes much less power in the resistor.
Can I connect an LED without a resistor?
Not to a voltage source. Without something to limit the current, it rises until the LED or the supply fails. A constant-current driver is the only exception.
Can several LEDs share one resistor?
In series, yes — one resistor for the whole string. In parallel, no: small differences in forward voltage make one LED take most of the current. Give each parallel LED its own resistor.