LED Resistor Calculator
Find the series resistor for one or more LEDs from the supply, the forward drop, the count, and the current.
🔒 Processed entirely in your browser — nothing you enter here is ever uploaded.
The result appears on this page after you run the tool. Nothing you enter is uploaded.
Result
About this tool
The form opens at a supply of 5 V, a forward voltage of 2 V, an LED count of 1, and a target current of 20 with the unit menu on milliamps. The count is rounded and then forced to at least 1. The LED drop is the forward voltage times that count, so one LED at 2 V uses 2 V. The resistor voltage is the supply minus that drop, 5 − 2 = 3 V. Resistance is that voltage divided by the current. 3 / 0.02 is exactly 150 Ω. Power in the resistor is current squared times resistance, 0.02 × 0.02 × 150 = 0.06 W, printed as 60 mW. The report also lists the supply, the forward voltage times the count, and the current.
Beside the exact resistance, the page lists the three nearest E24 preferred values, sorted by absolute distance, looking across the decade around the result. For 150 Ω those three are 150 Ω, 160 Ω, and 130 Ω. 150 is itself an E24 value, so it leads the list. A 9 V supply with the same 2 V LED and 20 mA leaves 7 V across the resistor, which is 350 Ω and 140 mW. Three LEDs at 3 V each on a 12 V supply leave 3 V, which is again 150 Ω and 60 mW. The count is series only. The drops add. The page does not compute a parallel string or a per-LED resistor in a parallel group.
The run stops when any of supply, forward voltage, or current is not strictly positive, and it also stops when the resistor voltage is not strictly positive. That second case is the one where the LEDs already drop the whole supply or more. The error text is the shared Enter positive numeric values. It does not spell out that the drop exceeded the supply. A count of 0 or a negative count is raised to 1 before the math. A fractional count is rounded. The current unit menu starts on milliamps. Leaving 20 selected as amps would be 20 A, which is a different circuit. Nothing in the formula knows the LED's real forward voltage at that current, the resistor's tolerance, or whether 60 mW fits the part you have. The power line is the number to compare with the resistor's wattage. The page does not pick a package and does not add a safety margin. Supply and forward voltage are plain volts, with no unit menu. The nearest-value list is E24 only. It is not E12 or E96.
Example. The defaults, 5 V, a 2 V drop, one LED, and 20 mA, return 150 Ω and 60 mW. The nearest E24 values are 150 Ω, 160 Ω, and 130 Ω. 9 V with the same LED and current returns 350 Ω and 140 mW.
Limit. The LEDs are in series. The calculation stops when the combined forward drop is not strictly below the supply. The current unit menu opens on milliamps.
What do the default 5 V and 20 mA give?
One LED at 2 V leaves 3 V for the resistor. 3 / 0.02 A is 150 Ω. Power is 60 mW. The nearest E24 values printed beside it are 150 Ω, 160 Ω, and 130 Ω. The current menu opens on milliamps, so the 20 is 20 mA until you change the unit.
How does the LED count work?
The forward voltages add. Three LEDs at 3 V on 12 V leave 3 V and, at 20 mA, another 150 Ω at 60 mW. The page does not place LEDs in parallel. A count below 1 is treated as 1, and a fractional count is rounded.
Why does a 9 V battery and a 2 V LED give 350 Ω?
9 − 2 = 7 V across the resistor at 20 mA. 7 / 0.02 is 350 Ω, and the resistor dissipates 140 mW. That is the same arithmetic as the 5 V default, with a larger remainder.
What if the LEDs drop more than the supply?
The resistor voltage would not be positive, and the page stops with Enter positive numeric values. It does not invent a negative resistor. The same message is used when the supply, the forward voltage, or the current is not positive.