Enter your supply voltage, the LED's forward voltage, and the current you want to drive it at. FigureDesk computes the current-limiting resistor value and the power it needs to dissipate.
Your numbers
From the LED's datasheet — typically 1.8–2.2 V for red, 3–3.4 V for blue/white.
Identical LEDs wired in a single series chain on this branch.
Result
Resistor value
350 Ω
Given Vs = 9 V, Vf = 2 V, If = 20 mA → R = (Vs − Vf) / If = 350 Ω, P = I² × R = 0.14 W
An LED needs a series resistor to limit current to a safe level, because an LED's own forward-voltage curve is far too steep to self-limit current the way a plain resistor does. Ohm's law gives the resistor value directly once you know the voltage it has to drop (supply minus the LED's own forward voltage) and the current you want flowing through it.
R = (Vsupply − n × Vf) / ILED
P = I² × R
A red LED (Vf = 2 V) run at 20 mA from a 9 V supply:
An LED's current rises extremely steeply for a small change in voltage across it — without something to limit current, it draws more and more until it fails. A series resistor sets the current to a safe, predictable value by dropping the voltage the LED itself doesn't need.
On its datasheet, listed as Vf or "forward voltage" at a specific test current. As a rough starting point, red and amber LEDs are commonly around 1.8–2.2 V, green around 2–3.2 V, and blue or white around 3–3.4 V — but always confirm against your specific LED's datasheet, since it varies by manufacturer and die.
Choose a standard wattage rating (1/8 W, 1/4 W, 1/2 W, 1 W...) that is comfortably above the computed power dissipation — commonly at least double — so the resistor runs cool rather than right at its rated limit.
For LEDs wired in series (same current through all of them), enter the number in series — their forward voltages add together. For LEDs wired in parallel, each branch needs its own resistor sized independently at that branch's current, since parallel LEDs do not share current evenly on their own.
The underlying relationship this calculator applies — solve for any of voltage, current, resistance, or power.
Once you know the resistance you need, read a physical resistor's color bands to find the closest standard value on hand.
Convert a power budget to current for the rest of your circuit.
FigureDesk results are advisory and do not replace a licensed electrician, a qualified engineer, or the applicable local electrical code. Verify any electrical work against your local code and with a qualified professional before relying on it.