# LED Resistor Calculator

URL: https://hifreetools.com/science/led-resistor-calculator

> Calculate the correct series resistor for an LED from your supply voltage, the LED's forward voltage and your target current — plus the power the resistor must dissipate so you can pick a safe wattage.

## Quick answer

Size an LED series resistor with R = (Vs − Vf) / I, where Vs is the supply voltage, Vf is the LED forward voltage, and I is the LED current in amperes. For a 5 V supply driving a 2 V LED at 20 mA (0.02 A), R = (5 − 2) / 0.02 = 150 Ω, and the resistor dissipates P = (Vs − Vf) · I = 3 × 0.02 = 0.06 W, so a standard 1/4 W resistor is fine.

## Formula

- R = (Vs − Vf) / I
- P = (Vs − Vf) · I

## Examples

- Standard red LED on 5 V (default): Vs = 5 V, Vf = 2 V, I = 20 mA → R = 150 Ω, P = 0.06 W
- Red LED on 12 V supply: Vs = 12 V, Vf = 2 V, I = 20 mA → R = 500 Ω, P = 0.2 W
- Blue LED on 9 V battery: Vs = 9 V, Vf = 3.2 V, I = 20 mA → R = 290 Ω, P = 0.116 W
- White LED on 5 V at 10 mA: Vs = 5 V, Vf = 3.4 V, I = 10 mA → R = 160 Ω, P = 0.016 W

## FAQ

**How do I calculate the resistor for an LED?**
Use R = (Vs − Vf) / I. Subtract the LED's forward voltage (Vf) from your supply voltage (Vs), then divide by the LED current in amperes. For example, a 5 V supply, a 2 V red LED and 20 mA give R = (5 − 2) / 0.02 = 150 Ω. Round up to the nearest standard value.

**Why does an LED need a series resistor?**
An LED's current rises steeply once it passes its forward voltage, so a tiny voltage increase can push huge current and burn it out. A series resistor limits the current to a safe value by dropping the difference between the supply and the LED's forward voltage, giving the circuit a stable, predictable operating point.

**What forward voltage should I use for my LED?**
Use the value from the LED datasheet. Typical figures are about 1.8–2.2 V for red, 2.0–2.2 V for yellow, 2.0–3.3 V for green, and 3.0–3.4 V for blue and white LEDs. If unsure, the default of 2 V is a safe starting point for red LEDs; measure or check the datasheet for accuracy.

**What current should I run my LED at?**
Standard indicator LEDs are usually run at 20 mA, which this calculator uses by default. Many modern LEDs are bright at 5–10 mA, which saves power and runs cooler. Never exceed the maximum forward current on the datasheet; a lower current simply makes the LED dimmer.

**What power rating should the resistor have?**
The resistor dissipates P = (Vs − Vf) · I watts. For most small-signal LEDs this is well under 0.1 W, so a common 1/4 W (0.25 W) resistor works. As a rule pick a part rated at least twice the calculated power; this calculator shows the exact dissipation so you can choose.

**What if the calculated resistor isn't a standard value?**
Resistors come in fixed series (E12/E24), so round up to the next standard value. Rounding up slightly lowers the current, which is safe for the LED. For 290 Ω use 300 Ω; for 500 Ω use 510 Ω. A small change in resistance only dims the LED a little.


## Sources

- [Wikipedia — Light-emitting diode (operating circuit)](https://en.wikipedia.org/wiki/Light-emitting_diode#Circuit)
- [HyperPhysics — Ohm's Law](http://hyperphysics.phy-astr.gsu.edu/hbase/electric/ohmlaw.html)
- [SparkFun — Light-Emitting Diodes (LEDs)](https://learn.sparkfun.com/tutorials/light-emitting-diodes-leds)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "LED Resistor Calculator", https://hifreetools.com/science/led-resistor-calculator
