LED Resistor Calculator: Pick the Right Resistor Without Burning an LED

CodexFuse Team · 2026-11-01T04:18:48.209Z · 11 min read min read

Work out the exact LED resistor with the free LED resistor calculator: formula, worked 12 V example, and the rounding mistakes that burn LEDs out.

An LED resistor calculator is a free online tool that works out the exact current-limiting resistor an LED circuit needs from three inputs: supply voltage, LED forward voltage, and desired current. Enter those three numbers and it returns the resistor value in ohms and the power the resistor must safely handle in watts, so you can build the circuit without guessing.

The pain it solves is familiar to anyone who has wired an LED by hand. Connect an LED straight to a battery or power supply and it draws far more current than it can survive. It glows brilliantly for a few seconds, then dims, discolours, or dies completely. Guess a resistor that is too large and the LED is frustratingly dim. Guess one that is too small and you are back to burnt LEDs, wasted components, and a project that stalls.

This guide explains the formula behind the tool, walks through a complete worked example, and shows the mistakes that catch even experienced makers out.

What resistor do I need for an LED?

A resistor for an LED is the value given by R = (Vs − Vf) / I, where Vs is your supply voltage, Vf is the LED's forward voltage drop, and I is the current in amps. For a typical red LED at 20 mA on a 5 V supply, that works out to 150 Ω, and the resistor must handle at least 0.06 W, so a standard ¼ W resistor is the safe pick.

The formula looks simple, but each input hides a decision. Supply voltage is the voltage your circuit actually delivers, not the number printed on a nominal battery label. Forward voltage depends on the LED's colour and type, typically 1.8 V to 3.3 V. Current is the brightness-versus-lifetime trade-off you choose, usually 10–20 mA for a standard LED.

The LED resistor calculator removes the arithmetic and the unit conversions. Type in Vs, Vf, and current in milliamps, click Calculate, and it returns R in ohms and P in watts, ready to copy into your parts list.

How the LED resistor formula actually works

An LED is not like a light bulb. Once its forward voltage is reached, its resistance collapses and current rises sharply with only a tiny increase in voltage. Without something to limit that current, the LED effectively short-circuits its own power supply.

The resistor sits in series with the LED and drops the excess voltage. If the supply is 12 V and the LED drops 3.2 V, the resistor must drop the remaining 8.8 V. Ohm's law then sets the resistance that allows exactly your chosen current to flow through that 8.8 V drop.

  • Supply voltage (Vs): the voltage feeding the circuit — for example 5 V from USB or an Arduino, 9 V from a battery, or 12 V from a vehicle or mains adapter.
  • Forward voltage (Vf): the voltage the LED itself drops, found on its datasheet. Red and amber LEDs are usually near 2 V; white and blue LEDs are usually near 3.0–3.3 V.
  • Current (I): the current you want through the LED, entered in milliamps. Most standard LEDs are rated around 20 mA maximum, and running at 10–15 mA gives slightly dimmer light with a longer life.
  • Power (P): the heat the resistor must dissipate, calculated as P = (Vs − Vf) × I. Always choose a resistor rated above this figure, not exactly at it.
Pro Tip

Always convert milliamps to amps before doing the maths by hand: 20 mA is 0.02 A. The calculator does this for you, which is where most hand-calculation errors creep in.

Worked example: a 12 V reading light that must not fail

Consider a fictional maker, Dan, who is fitting a single white LED reading light in a camper van. The van's supply is 12 V. The LED's datasheet lists a forward voltage of 3.2 V and a forward current of 20 mA. Dan wants a light that runs every evening for years, not one that burns out on the first trip.

He opens the LED resistor calculator and enters the three values exactly as the tool asks for them:

  1. Supply voltage: 12 V.
  2. Forward voltage: 3.2 V, taken from the datasheet rather than guessed from the LED's colour.
  3. LED current: 20 mA, the LED's rated current.

He clicks Calculate. The tool returns 440 Ω and a power dissipation of 0.176 W. The maths checks out by hand: (12 − 3.2) / 0.02 = 440 Ω, and 8.8 × 0.02 = 0.176 W.

Dan then chooses the nearest standard resistor value at or above the result, with a power rating above 0.176 W. A 470 Ω, ¼ W resistor fits both rules: the slightly higher resistance trims the current a fraction, the LED is a touch dimmer but safer, and the ¼ W rating leaves comfortable headroom over 0.176 W. He solders it in series with the LED, powers the circuit, and the light runs at a steady, even brightness instead of flaring and dying.

Notice what Dan did not do. He did not reuse a resistor from a 5 V project, did not guess Vf from the LED's colour alone, and did not pick a resistor rated exactly at the calculated power. Each of those shortcuts is a common cause of early LED failure.

Common resistor values at a glance

The table below shows the combinations most makers reach for first. All three are consistent with the tool's own presets and worked answers, and each assumes the resistor is rated ¼ W unless the power column says otherwise.

SupplyLED forward voltageCurrentResistorPower dissipated
5 V2.0 V20 mA150 Ω0.06 W
9 V2.0 V10 mA700 Ω0.07 W
12 V2.0 V20 mA500 Ω0.20 W
12 V3.2 V20 mA440 Ω0.176 W

If your exact combination is not in the table, that is precisely what the calculator is for. Enter your real Vs, Vf, and current rather than rounding to a row that looks close.

Important

Round resistor values UP to the nearest standard value, never down. A slightly larger resistor means slightly less current and a slightly dimmer, safer LED. A smaller resistor pushes more current than planned, which is what burns LEDs out.

Should I run an LED at its maximum current?

No, not continuously, unless you have a specific reason and a datasheet that supports it. Running an LED at its maximum rated current gives maximum brightness but also maximum heat and the shortest life. Most designs run standard LEDs at 10–15 mA instead of the full 20 mA, accepting slightly dimmer light in exchange for a circuit that lasts.

Brightness is also not linear with current. Dropping from 20 mA to 15 mA rarely looks 25% dimmer to the eye, but it does cut the heat in the LED and the resistor. For indicator lights, panel lights, and decorative lighting, the lower current is usually the better engineering choice.

When you need full brightness, check the datasheet for continuous versus peak current ratings, and make sure the resistor's power rating still has headroom at the higher current. A resistor running hot to the touch is a warning sign, not a normal operating condition.

What the calculator does not do

Honest limits matter here, because misapplying a simple tool to a complex circuit is how LEDs still get destroyed. The calculator solves one series resistor for one LED at one set of conditions. It does not do the following:

  • LED strips with built-in resistors: most 12 V LED strips already include current-limiting resistors per segment. Adding another resistor dims the strip for no benefit. Check the strip's specification first.
  • Constant-current drivers: high-power LEDs for lighting, torches, and displays are normally driven by a constant-current driver, not a resistor. A resistor wastes power as heat and cannot hold current steady as voltage varies.
  • Series and parallel arrays: for several LEDs, calculate per series string and give each string its own resistor. Sharing one resistor across parallel LEDs lets the LED with the lowest forward voltage hog the current.
  • Temperature and batch variation: forward voltage shifts with temperature and varies between batches. A design balanced on a knife-edge at room temperature can drift out of specification when it warms up.

For those cases, the right move is a proper LED driver, a datasheet-led design, or a per-string calculation — not a larger guess at a single resistor value.

The same discipline applies to the power side of a project. If you are sizing a supply or checking what a circuit actually draws, an amps-to-watts converter turns current ratings into real power numbers, and an electric current converter keeps unit conversions from silently corrupting the maths.

Stop losing evenings to burnt LEDs and stalled projects

CodexFuse takes the same headache away from the rest of your setup — your website, business email, and backups run fully managed on pay-as-you-go credits, so you spend your time building instead of babysitting servers.

Get Started with CodexFuse

Using the tool step by step

The workflow on the live tool page is deliberately short. It asks for supply voltage, forward voltage, and current, and nothing else, because those are the only three inputs the formula needs.

  1. Enter Vs: type your supply voltage, for example 5 V, 9 V, or 12 V.
  2. Enter Vf: use the datasheet figure where possible; the page notes the typical 1.8 V to 3.3 V range by colour as a fallback.
  3. Enter current in mA: standard LEDs usually run at 10–20 mA. Click Calculate.
  4. Read R and P: take the resistor value in ohms and its power rating in watts, then choose the nearest standard resistor at or above both figures.

One-click presets cover the common setups — 5 V at 20 mA, 12 V at 20 mA, and 9 V at 10 mA — which is useful when you are prototyping quickly and want a sanity check before ordering parts. The copy button moves the result straight into a parts list without retyping numbers, which removes another source of transcription errors.

If you sell what you make, the same attention to detail belongs on your business systems. A maker shop whose website is down, whose order emails bounce, or whose product photos vanish after a failed backup loses sales in exactly the way a burnt LED loses an evening — quietly, and at the worst moment. That is the problem CodexFuse is built around: one managed platform, on credits, where hosting, business email, security, and backups are handled for you instead of becoming four more jobs.

Suggested Reading

For the running costs behind a project like this, see the electricity bill calculator and the kWh calculator — both help you turn watts and hours into numbers you can actually budget around.

Move your whole setup to one managed platform

Do not stop at fixing one LED circuit while the business around it still runs on guesswork. Move your website hosting, business email, and backups to CodexFuse this week: create your account, add credits only for what you use, point your domain to the managed platform, and let the CodexFuse team handle updates, security, and backups while you get back to building. No subscription, no lock-in, no server babysitting — just a setup that stays up while you work.

And before your next build, run the numbers through the LED resistor calculator first. Thirty seconds with the right resistor beats an evening of troubleshooting a dead LED, every time.

Frequently Asked Questions

What is the LED resistor formula?

R = (Vs − Vf) / I, where R is resistance in ohms, Vs is supply voltage, Vf is the LED's forward voltage, and I is current in amps. If your current is in milliamps, divide by 1,000 first.

What resistor do I need for a 5 V LED circuit?

For a typical LED with Vf of 2 V running at 20 mA on a 5 V supply, R = (5 − 2) / 0.02 = 150 Ω, dissipating 0.06 W. A standard 150 Ω, ¼ W resistor is the right pick.

What resistor do I need for a 12 V LED?

For a typical LED with Vf of 2 V at 20 mA on 12 V, R = (12 − 2) / 0.02 = 500 Ω, dissipating 0.2 W, so a 500 Ω, ¼ W resistor works. With a white LED at Vf 3.2 V, the answer is 440 Ω instead.

Should I round the resistor value up or down?

Round up to the nearest standard value. A slightly larger resistor gives slightly less current and a slightly dimmer but safer LED, while a smaller resistor pushes more current than planned and risks burning the LED out.

How much current does an LED need?

Check the datasheet for its forward current. Most standard LEDs are rated around 20 mA, and running them at 10–15 mA gives slightly dimmer light with longer life. Never connect an LED directly to a voltage source without a current-limiting resistor.

Is the LED resistor calculator free?

Yes, completely free with no signup. Enter supply voltage, forward voltage, and current, and it returns the resistor value and power rating instantly in your browser.

Featured on Twelve Tools Launch Llama Tools Launch your MCP