💡 LED Resistor Calculator
Enter the supply voltage, the LED's forward voltage and current to get the required series (current-limiting) resistor, the nearest standard value and its power. Everything runs in your browser.
What is the LED Resistor Calculator?
The LED resistor calculator is a free tool that instantly finds the series (current-limiting / dropping) resistor you need to drive an LED safely. It asks for just three values: the supply voltage feeding the circuit, the LED's forward voltage (Vf), and the forward current (If) you want to flow through the LED. The tool computes the exact resistance, the nearest E12/E24 standard resistor, the power dissipated in the resistor, and a suitable power rating (1/8 W, 1/4 W, 1/2 W…). It is handy for Arduino and electronics hobbyists, students and technicians. All computation happens in your browser; nothing you type is ever sent to a server.
Why does an LED need a resistor?
An LED is a diode, and a diode's voltage–current curve is very steep. Once the threshold (forward voltage) is reached, the voltage across it stays almost constant while the current rises sharply. If you wire an LED straight to a supply, the difference between the supply voltage and the LED voltage turns into a huge current and the LED overheats and burns out within seconds. A series resistor acts like a "brake" on the path from the supply to the LED: it takes up the extra voltage and pins the current at a safe value.
The LED resistor formula
The calculation is just Ohm's law. The voltage the resistor must drop is the difference between the supply and the LED voltage. From that:
- Resistance: R = (Vsupply − Vf) / If
- Power dissipated: P = (Vsupply − Vf) × If
Use current in amps: 20 mA = 0.02 A. The exact value rarely lands on a stocked part, so the tool suggests the nearest E12/E24 value. To stay on the safe side it is usually fine to pick the next value up, which lowers the current slightly and protects the LED.
Arduino 5 V example (step by step)
Let's connect a red LED to an Arduino's 5 V output. Typical red-LED values are Vf ≈ 2 V and If = 20 mA (0.02 A). First find the voltage the resistor must drop: 5 − 2 = 3 V. Then the resistance: R = 3 / 0.02 = 150 Ω. The nearest E12 standard is 150 Ω; the very common 220 Ω is a safe step up. The power in the resistor is P = 3 × 0.02 = 0.06 W (60 mW), so a cheap, common 1/4 W resistor is more than enough.
Tips
- Color preset: if you don't have the datasheet, the color dropdown fills in a typical Vf for you, but the real number on the part is always best.
- Series wiring: connecting several LEDs in series adds their forward voltages. The total Vf can't exceed the supply — the tool checks this and warns you.
- Parallel wiring: rather than paralleling LEDs on one resistor, give each branch its own resistor; LEDs are never identical, so the current won't split evenly.
- Safety margin: when choosing between the exact value and the nearest standard, picking the value up trades a touch of brightness for longer LED life.
Frequently Asked Questions
How do I calculate an LED resistor?
The series resistor is R = (supply voltage − LED forward voltage) / LED forward current. For a 5 V supply, a 2 V LED and 20 mA, R = (5 − 2) / 0.02 = 150 Ω. The tool rounds the result to the nearest E12/E24 value and shows the power dissipated too.
Why does an LED need a series resistor?
LEDs are very sensitive to current and their voltage is almost constant. Without a resistor an excessive current flows and the LED burns out. A series resistor limits the current to a safe level.
What resistor should I use for an LED on Arduino?
Arduino is 5 V. For a red LED (Vf ≈ 2 V) at 20 mA, R = (5 − 2) / 0.02 = 150 Ω; 150 Ω or the common 220 Ω one step up are safe choices. On 3.3 V boards the value is lower.
Does the resistor power rating (wattage) matter?
Yes. Power is P = (supply − Vf) × If. In LED circuits this is usually tiny (e.g. 60 mW), so a common 1/4 W resistor is plenty. The tool computes the power and recommends a suitable wattage.
Is my data stored?
No. The tool runs entirely in your browser; the values you enter are never uploaded or saved.