About the voltage divider and LED resistor calculator
A voltage divider of two resistors gives Vout = Vin × R2/(R1 + R2). The calculator solves for the output, or for R1 or R2 when you know the output you want, and shows how a load across R2 pulls the output down. An LED needs a series resistor R = (Vs − n·Vf)/I, where Vf is the forward voltage of each of n LEDs in series and I is the current you want.
The divider default, 10 kΩ over 4.7 kΩ on 12 V, gives 3.84 V and draws 0.82 mA. A red LED (Vf ≈ 2.0 V) at 20 mA on 5 V needs exactly 150 Ω, an E12 value, and the resistor dissipates 60 mW, so a ⅛ W part covers it with a 2× margin.
Exact values are rounded up to the next E12 value (IEC 60063), which keeps the LED current at or below target. Forward voltages are typical figures; datasheets vary by a few tenths of a volt, and the current is most sensitive when little voltage is left across the resistor.
How to calculate a voltage divider and an LED resistor
An unloaded two-resistor divider gives Vout = Vin × R2/(R1 + R2), with R2 the resistor to ground: 10 kΩ over 4.7 kΩ on 12 V gives 3.84 V. An LED's series resistor is R = (Vs − Vf)/I: a 2 V red LED at 20 mA on 5 V needs (5 − 2)/0.02 = 150 Ω.
Voltage divider formula worked by hand
R1 runs from the input to the output node, and R2 from the output node to ground. For 12 V with R1 = 10 kΩ and R2 = 4.7 kΩ:
Total resistance: 10 + 4.7 = 14.7 kΩ.
Ratio: 4.7 ÷ 14.7 = 0.31973.
Output: 12 × 0.31973 = 3.837 V.
Current through the chain: 12 V ÷ 14.7 kΩ = 0.816 mA.
Only the ratio sets the output. Scaled tenfold to 100 kΩ over 47 kΩ, the divider still gives 3.837 V but draws 0.0816 mA. Larger values waste less current; smaller values hold their voltage better under load.
How to choose R1 or R2 for a target voltage
Fix one resistor and solve for the other:
R2 = R1 × Vout/(Vin − Vout)
R1 = R2 × (Vin − Vout)/Vout
For 3.3 V from 5 V with R1 = 10 kΩ, R2 = 10 × 3.3/1.7 = 19.41 kΩ. That is not a standard value: the nearest E12 parts, 18 kΩ and 22 kΩ, give 3.21 V and 3.44 V, so check the output with the part you will fit.
The target must be below the input voltage. A resistive divider can only scale a voltage down.
What a load does to a voltage divider
Anything connected to the output sits in parallel with R2, so the bottom of the divider becomes R2 × RL/(R2 + RL). Use that value in place of R2 in the divider formula.
Two 10 kΩ resistors on 12 V give 6 V unloaded. A 10 kΩ load makes the bottom 5 kΩ, so the output falls to 4 V and the source current rises to 0.8 mA, split 0.4 mA each through R2 and the load.
A load at least 10 times R2 keeps the drop under about 10%: a 100 kΩ load on the same divider gives 5.71 V. A 100 Ω load on the 10 kΩ/4.7 kΩ divider pulls 3.84 V down to 0.116 V.
That is why dividers feed sensing and reference inputs, while a regulator powers a circuit. OpenStax covers the series and parallel rules behind both calculations.
How to calculate the resistor for an LED
Subtract the forward voltage of every LED in the string: VR = Vs − n × Vf.
Divide by the current you want: R = VR/I.
Round up to the next E12 value (IEC 60063: 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82 in each decade), so the current stays at or below target.
Recompute the current with that value, then the resistor's power, P = I²R.
Choose a power rating at least twice P.
A blue LED (Vf ≈ 3.2 V) on 9 V at 15 mA leaves VR = 5.8 V. R = 5.8 ÷ 0.015 = 386.67 Ω, rounded up to 390 Ω. The current becomes 14.87 mA and the resistor dissipates 86 mW, so a ¼ W part keeps the 2× margin.
Three red LEDs in series on 12 V at 20 mA leave 12 − 3 × 2.0 = 6 V for the resistor. That gives 300 Ω, rounded up to 330 Ω, for 18.18 mA.
Divider and LED results compared
The rows are 10 kΩ over 4.7 kΩ on 12 V (Default), two 10 kΩ resistors on 12 V with a 10 kΩ load (Equal loaded), and one red LED on 5 V at 20 mA (LED default).
Scenario
Selected result
Source or LED current
Default
3.83673 V
0.816327 mA
Equal loaded
4 V
0.8 mA
LED default
150 Ω
20 mA
Typical LED forward voltages
Per LED at about 20 mA, the color presets assume red 2.0 V, yellow 2.1 V, green (InGaN) 3.0 V, blue 3.2 V, white 3.2 V and infrared 1.2 V.
Real parts vary by a few tenths of a volt with type, current and temperature, so use the datasheet figure when you have it.
The spread matters most when little voltage is left for the resistor. On 3.3 V, a red LED at 5 mA gets 270 Ω; if its real Vf is 2.2 V, the current falls 15%, from 4.81 to 4.07 mA. On 12 V with 560 Ω, the same shift moves the current 2%.
Resistor wattage and heat
The resistor turns VR × I into heat. Standard through-hole ratings run ⅛, ¼, ½, 1, 2, 5 and 10 W; pick one at least twice the calculated P = I²R.
Above 10 W, a resistor is the wrong part: a red LED at 1 A from 100 V would burn 96 W in a 100 Ω resistor, which is a job for a constant-current LED driver.
Mounting, airflow and the manufacturer's derating curve also decide how hot a resistor runs.
Common mistakes
Swapping R1 and R2. R2 is the resistor to ground. Swapped, 10 kΩ and 4.7 kΩ on 12 V give 8.16 V instead of 3.84 V.
Applying kilo twice. 4.7k typed with kΩ selected means 4.7 MΩ, and the 12 V divider's output jumps to 11.97 V.
Rounding the LED resistor down. 330 Ω instead of 390 Ω in the blue-LED example pushes the current to 17.6 mA, above the 15 mA target.
Sharing one resistor between parallel LEDs. Forward voltages differ between parts, so the current splits unevenly; give each string its own resistor.
Inputs worth checking
The load resistance applies when solving for output voltage. Solving for R1 or R2 uses the unloaded formula.
The LED count means LEDs in series in one string, all with the same forward voltage.
For one red LED at 20 mA, 150 Ω: (5 − 2.0 V)/0.020 A. A blue or white LED with a 3.2 V forward drop needs (5 − 3.2)/0.020 = 90 Ω, rounded up to 100 Ω in the E12 series, which gives 18 mA. Many indicator LEDs are bright enough at 5–10 mA, which doubles to quadruples the resistance.
What resistor do I need for an LED on 12 V?
For a single red LED at 20 mA, (12 − 2.0)/0.020 = 500 Ω, rounded up to 560 Ω (E12). That gives 17.9 mA and 0.18 W in the resistor, so use a ½ W part to keep a 2× margin. Three white LEDs in series instead (3 × 3.2 V = 9.6 V) need only 120 Ω, and the resistor wastes 48 mW.
How do you calculate a voltage divider?
Vout = Vin × R2/(R1 + R2), where R2 is the resistor between the output and ground. 10 kΩ over 4.7 kΩ on 12 V gives 12 × 4.7/14.7 = 3.84 V. For a target output, fix one resistor and solve for the other: R2 = R1 × Vout/(Vin − Vout), so 3.3 V from 5 V with R1 = 10 kΩ needs R2 = 19.4 kΩ.
Why does a voltage divider's output drop under load?
The load sits in parallel with R2 and lowers the bottom resistance. Two 10 kΩ resistors on 12 V give 6 V unloaded, but a 10 kΩ load makes the bottom 5 kΩ and the output falls to 4 V. Keep the load at least 10 times R2 to stay within about 10%, or buffer the output; dividers suit reference and sensing inputs, not powering circuits.
What wattage resistor do I need for an LED?
Work out P = I²R and choose a standard rating at least twice that. A 150 Ω resistor passing 20 mA dissipates 0.02² × 150 = 0.06 W, so a ⅛ W (0.125 W) resistor meets the 2× margin. With one red LED on 12 V the resistor dissipates 0.18 W and needs ½ W. Common through-hole ratings are ⅛, ¼, ½, 1 and 2 W.
About this calculator
Vout=VinR1+R2R2;R=IVs−nVf
Sources
Horowitz & Hill, The Art of Electronics (3rd ed.), §1.2.3 Voltage dividers and §2.1 (LED current limiting)
This calculator includes 7 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.
Put this calculator on your site
Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.