An LED connected straight to a supply will burn out — it needs a series resistor to set its current. Enter the supply voltage, the LED's forward voltage and current, and how many LEDs are in series, and get the resistor value, the nearest standard size and the wattage it must handle.
From its datasheet ideally. Typical ranges: red 1.8–2.2 V, orange/yellow 2.0–2.2 V, green 2.2–3.2 V (older green ~2.2, modern high-brightness ~3), blue and white 3.0–3.4 V, infrared ~1.2–1.5 V. When in doubt for a small indicator LED, 2.0 V (red) or 3.2 V (white/blue) are safe planning figures.
An LED's current rises explosively with voltage once past its forward voltage — a fraction of a volt too much can mean ten times the current, overheating and failure. The series resistor turns that cliff into a controlled slope.
It is poor practice: no two LEDs have exactly the same forward voltage, so one hogs current, runs hotter, its Vf falls further, and it hogs more — thermal runaway until it fails. Give each parallel LED (or series string) its own resistor.
Voltage across the resistor = Supply V − (LEDs in series × Forward V)
Resistance (Ω) = Voltage across resistor ÷ Current (A)
Resistor power (W) = Actual current² × Standard resistor value
An LED's brightness is set by its current, and its forward voltage is roughly fixed by its chemistry — so the resistor's job is to absorb the leftover voltage at exactly the wanted current. The result is rounded up to the next standard E12 value (…100, 120, 150, 180, 220, 270, 330, 390, 470…), which can only make the current slightly lower and safer, and the resistor's wattage rating should be at least twice the power it actually dissipates.
Always round up to the next E12 value. The LED runs a little below its rated current — brightness drops only slightly (the eye is logarithmic) while lifetime and reliability improve.
At least twice the calculated dissipation as a rule of thumb, so the resistor runs cool and its value stays stable. For the common 5 V / 20 mA case almost any 0.25 W resistor is ample; for 12 V supplies or power LEDs, check the figure the calculator shows.
LED strips have resistors built in — just supply the rated voltage. High-power LEDs (1 W and up) are normally driven by a constant-current driver rather than a resistor, because a resistor wastes a lot of power and the current drifts as the LED warms up.
Add this calculator to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the calculator to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.