What the LED Resistor Calculator Does
An LED needs a current-limiting resistor in series with it. Without one, an LED connected directly across a power source draws too much current and burns out almost instantly. This calculator works out the correct resistor value to place in series with your LED so it runs safely at its rated current. It also tells you how much power that resistor will dissipate, so you can choose one with an adequate wattage rating. The physics here is universal — Ohm's law applies the same way everywhere — so this tool is not country-specific.
The Three Inputs
- Supply Voltage (V) – the voltage of the power source driving the circuit, for example 5 V from a USB rail, 9 V from a battery, or 12 V from a car system.
- LED Forward Voltage (V) – the voltage dropped across the LED when it is lit. This depends on the LED colour: roughly 1.8–2.2 V for red, 3.0–3.4 V for blue/white. Check the datasheet for an exact figure.
- LED Forward Current (mA) – the target operating current, often around 20 mA for standard 5 mm LEDs.
The Formula
The calculator applies Ohm's law. The resistor must drop the difference between the supply voltage and the LED's forward voltage, while passing the chosen current:
- Resistance (Ω) = (Supply Voltage − Forward Voltage) ÷ (Forward Current ÷ 1000)
- Power (W) = Resistance × (Forward Current ÷ 1000)²
The current is divided by 1000 to convert milliamps to amps before the calculation.
Worked Example
Suppose you have a 9 V battery, a red LED with a 2 V forward voltage, and you want 20 mA through it.
- Resistance = \((9 - 2) \div (20 \div 1000) = 7 \div 0.02 =\) 350 Ω
- Power = \(350 \times (0.02)^{2} = 350 \times 0.0004 =\) 0.14 W
Since 350 Ω isn't a standard value, pick the next common size up (such as 360 Ω or 390 Ω) to stay safe. A standard 0.25 W (¼ watt) resistor comfortably handles the 0.14 W dissipation.
Frequently Asked Questions
Why round up to the next resistor value? Choosing a slightly higher resistance lowers the current marginally, which protects the LED. Rounding down could push current above the rated limit.
What if supply voltage is below the forward voltage? The result would be negative or zero, meaning the LED won't light. You need a supply voltage higher than the LED's forward voltage.
Why does the power rating matter? A resistor dissipates energy as heat. If the calculated power exceeds the resistor's rating, it overheats and may fail. Always pick a resistor rated above the calculated wattage.