How to Size a Resistor So Your LED Doesn't Die in the First Five Seconds
Published October 20, 2026
A practical walkthrough of Ohm's Law, LED current-limiting resistors, reading color bands to confirm your parts, and voltage dividers — everything you need to wire up a single LED correctly on the first try.
Every beginner electronics project seems to start the same way: a battery, an LED, and a mild sense of dread about whether plugging it in is going to produce light or smoke. The good news is that this is one of the most well-understood circuits in all of electronics, and getting it right comes down to one equation and a few minutes of arithmetic you don't even have to do by hand.
This walks through the actual reasoning — not just "use a 220-ohm resistor," which you've probably seen repeated everywhere without explanation — so that the next time you're staring at an unlabeled LED and a different supply voltage, you know exactly what to do.
Start with Ohm's Law, because everything else is built on it
Ohm's Law describes the relationship between voltage (V), current (I), and resistance (R) in a circuit: V = I × R. That's it. Three variables, and if you know any two, you can find the third. Rearranged, the two forms you'll use constantly are I = V / R (how much current flows through a given resistance at a given voltage) and R = V / I (what resistance you need to achieve a specific current at a specific voltage).
The reason this matters for an LED specifically is that an LED is not a resistor — it doesn't obey Ohm's Law itself. Once an LED turns on, its voltage drop stays roughly constant (more on that below) regardless of how much current is flowing, which means current through an LED can increase very quickly with only a small change in applied voltage. Left unchecked, that current climbs past the LED's rated maximum almost instantly, which is why an LED wired directly across a battery with no resistor tends to flash brightly for a second and then die. The resistor's job is to absorb the "extra" voltage and limit the current to something the LED can survive indefinitely. Plug numbers into the Ohm's Law Calculator any time you want to sanity-check a voltage/current/resistance relationship in isolation — it's the building block the rest of this circuit depends on.
Sizing the actual resistor for your LED
Here's the standard approach, and it's just Ohm's Law applied to the specific situation of an LED in series with a resistor and a supply:
- Find your LED's forward voltage (Vf). This is the voltage dropped across the LED itself once it's conducting. It depends on the LED's color and chemistry — a standard red LED typically drops around 1.8-2.2V, while blue and white LEDs, which use a different semiconductor material, typically drop closer to 3.0-3.4V. If you have a datasheet, use its number; if not, a typical value for the color is a reasonable starting point.
- Find your LED's forward current (If). Most common 5mm indicator LEDs are rated for a maximum continuous current somewhere around 20mA, though many are run a bit under that (10-15mA) for a comfortable margin and longer lifespan. Again, check the datasheet if you have one.
- Subtract Vf from your supply voltage. The resistor has to drop whatever voltage is "left over" after the LED takes its share. A 9V battery driving an LED with a 2V forward voltage means the resistor needs to drop the remaining 7V.
- Divide that leftover voltage by your target current to get the resistance. This is R = V / I again, just with the "V" being the leftover voltage from step 3, not the full supply voltage.
Say you're driving a standard 5mm red LED (Vf around 2.0V, target current 15mA) from a 9V battery. The resistor needs to drop 7V at 15mA, which works out to a specific resistance you can calculate directly — or just plug the supply voltage, LED forward voltage, and desired current into the LED Resistor Calculator and it'll do steps 3 and 4 for you in one pass, along with telling you the resistor's power rating requirement (watts), which matters more than people expect — a resistor that's technically the right ohms but too small a wattage rating will overheat and potentially fail even though the resistance value was correct.
Once you have a target resistance, you won't find that exact value sitting in a parts bin — resistors come in standard value series (E12, E24, etc.), not every possible number. Round up to the nearest standard value rather than down. Rounding up slightly reduces the current below your target, which just means a marginally dimmer LED; rounding down pushes current above target, which trades a little brightness for shortened LED lifespan or, in a worse case, failure.
Confirming you grabbed the right resistor out of the bin
Resistors don't have their value printed in plain text — they use colored bands, and if your parts bin is anything like most people's, loose resistors of similar value get mixed together constantly. Before you solder anything in, it's worth confirming the physical part in your hand actually matches what you calculated.
The standard color code uses four or five bands: the first two or three bands represent significant digits, the next band is a multiplier, and the last band is a tolerance (often gold for ±5% or brown for ±1%). Reading these by eye and doing the math in your head is a classic source of off-by-one mistakes, especially distinguishing similar colors like blue and violet or red and orange, especially under indoor lighting. Instead of guessing, punch the bands you see into the Resistor Color Code Calculator — select each color in order and it'll tell you the exact resistance and tolerance, or run it in reverse by entering a resistance value to see what bands you should be looking for. This takes ten seconds and eliminates an entire category of "why isn't this working" debugging later, which is a genuinely common failure mode — more broken beginner circuits trace back to a misread resistor than to a miscalculated one.
When you need a specific reference voltage instead: the voltage divider
A single current-limiting resistor in series with an LED is the right tool when your goal is to limit current to a load. But a related, equally common need in a slightly more involved project is generating a specific voltage somewhere in between two rails — for example, you have 5V available but a sensor or a microcontroller input needs to see a reference around 3.3V, or you need to scale down a voltage so it falls within the measurable range of an analog input.
That's a different circuit topology called a voltage divider: two resistors in series across a voltage source, with the output voltage taken from the junction between them. The output voltage is a fraction of the input voltage, and that fraction is set entirely by the ratio of the two resistances (not their absolute values) — Vout = Vin × (R2 / (R1 + R2)), where R2 is the resistor on the output side. This is the same Ohm's Law relationship underneath, just applied across two resistors instead of one.
A couple of real caveats worth knowing before you rely on a voltage divider in a design: it's a poor choice for powering anything that draws meaningful or variable current, because the output voltage sags under load — a voltage divider's output impedance isn't zero, and connecting a load effectively adds a third resistor in parallel with R2, changing the ratio you designed for. It works well for feeding a high-impedance input (like an analog-to-digital converter pin, which draws essentially no current) but not for driving something like a motor or even a second LED. If you need to divide voltage and actually supply current, you generally want a dedicated voltage regulator instead. For the use cases where a divider is appropriate, the Voltage Divider Calculator takes your input voltage and either your two resistor values or your target output voltage, and solves for whichever piece you're missing.
Putting it together: a worked scenario
Say you're building a simple circuit: a 9V battery, a push button, and a standard 5mm red LED, and you also want to tap off a 3.3V-ish reference point for a separate sensor on the same board.
- Plug 9V supply, ~2.0V LED forward voltage, and a 15mA target current into the LED Resistor Calculator to get your series resistor value and power rating.
- Round up to the nearest standard resistor value available to you.
- Pull that resistor from your bin and confirm its bands in the Resistor Color Code Calculator before soldering it in — this is the step most people skip and later regret.
- For the 3.3V reference tap, use the Voltage Divider Calculator with a 9V input and a target 3.3V output to find a workable resistor ratio, keeping in mind this tap should only feed a high-impedance input, not another LED or a motor.
- If anything behaves unexpectedly once it's wired up — dimmer than expected, or warmer than expected — go back to the Ohm's Law Calculator and work the numbers for what you actually measured versus what you designed for; a mismatch there usually points straight at the problem.
FAQ
Can I just use a 220-ohm or 330-ohm resistor and skip the math? For a standard 5mm red or green LED off a 5V or 9V supply, those common values often land in a reasonable range, which is exactly why they get repeated so often in beginner guides. But "often works" isn't the same as "correct for your specific LED and supply," and it breaks down fast with white/blue LEDs (higher forward voltage) or unusual supply voltages. It costs nothing to actually calculate it.
What happens if I use too high a resistance? The LED will be dimmer than its rated brightness, but it won't be damaged — erring high is the safe direction if you're unsure of your LED's exact specs.
Does it matter which side of the LED the resistor goes on? Electrically, no — a series resistor limits current the same way whether it's placed before or after the LED in the loop. Polarity of the LED itself does matter, though; it only conducts in one direction.
Why do all these tools run instantly with no sign-up? Everything referenced here runs entirely client-side in your browser — the calculation happens on your device, nothing gets uploaded anywhere, which is part of why there's no delay and no account needed for a quick check mid-project.