An LED needs a series resistor to limit its current, or it will burn out. Enter your supply voltage, the LED's forward voltage and the current you want to get the resistor value and its power.
Enter the supply voltage.
Enter the LED forward voltage and desired current.
Round the resistor up to the next standard value.
Resistor: R = (Vs − Vf) ÷ I
Power: P = (Vs − Vf) × I
An LED needs a resistor in series to limit its current. Without one, the current can rise until the LED burns out in a moment. This calculator takes the supply voltage, the LED's forward voltage and the current you want to run it at, and returns the resistor value and the power that resistor will dissipate.
It is one of the most common calculations in hobby electronics, from an indicator on an Arduino board to a strip of lights on a bike or a festival decoration running from a 12 V adapter. The forward voltage depends on the LED colour, roughly 2 V for red and around 3 V for blue and white, and the recommended current is on the datasheet, often 5 mA to 20 mA for small indicator LEDs.
1. Find the supply voltage Vs, the LED forward voltage Vf and the target current I from the datasheet.
2. Subtract to get the voltage the resistor must drop: Vs − Vf.
3. Convert the current to amperes: 20 mA = 0.02 A.
4. Resistor value: R = (Vs − Vf) ÷ I.
5. Round up to the next standard value available, which slightly lowers the current and adds a safety margin.
6. Resistor power: P = (Vs − Vf) × I. Choose a rating at least double this.
7. For several LEDs in series, subtract the sum of their forward voltages from Vs.
An LED is a diode. Below its forward voltage it conducts almost nothing, but just above it, the current rises exponentially with voltage. A few tenths of a volt extra can multiply the current many times. The forward voltage also falls slightly as the LED warms, which can push current up further in a runaway. So an LED must be driven by something that sets the current, not the voltage. A series resistor is the simplest such device: it absorbs the excess voltage and, by Ohm's law, fixes the current.
The calculated value rarely matches a stock resistor. Standard values follow the E12 and E24 series, such as 470, 560, 620, 680 and 820 Ω. Always round up to the next available value. The current then comes out slightly below target, which is safe and barely changes the visible brightness, because perceived brightness is not proportional to current. Rounding down pushes the current above the rating and shortens the LED's life. After choosing, recompute the actual current with (Vs − Vf) ÷ R_chosen.
Supplies are not always at their nominal voltage. A vehicle's 12 V system can run at around 14 V while the engine is charging the battery, and a fresh set of cells may be above its label. Design for the highest voltage you expect, or the LED will be over-driven. The resistor also wastes power as heat; with a large gap between Vs and Vf, most of the energy goes into the resistor. For high-power LEDs or long strings, a constant-current driver is more efficient than a resistor.
Rahul is adding a white LED as a glovebox light in his car, powered from the 12 V system. The LED's datasheet gives a forward voltage of 3.2 V, and he wants to run it at 15 mA.
Voltage across the resistor: 12 − 3.2 = 8.8 V
R = (Vs − Vf) ÷ I: = 8.8 ÷ 0.015 = 586.67 Ω
Resistor power: P = 8.8 × 0.015 = 132 mW
Answer: Resistor needed 586.667 Ω; Resistor power 132 mW
Entering current in milliamps as if it were amps when working by hand, giving a resistor a thousand times too small.
Rounding the resistor down, which over-drives the LED.
Using one resistor for several LEDs in parallel; slight differences in forward voltage make one LED hog the current.
Ignoring resistor power and using a tiny resistor that runs hot on a 12 V or 24 V supply.
Assuming every LED colour has the same forward voltage.
Adding indicator LEDs to Arduino, ESP32 and Raspberry Pi projects.
Wiring LED lights in cars, bikes and cycles from a 12 V supply.
Making decorative LED strings and diyas for festivals from adapters.
Replacing indicator bulbs in appliances and control panels with LEDs.
Electronics lab exercises on diode characteristics.
What resistor for a red LED on 5 V?
(5 − 2) ÷ 0.02 = 150 Ω; 150 Ω or 220 Ω are common choices.
Can I share one resistor between parallel LEDs?
It is not recommended; give each LED its own resistor.