Ohmforge LED Resistor Calculator
Series resistor for LEDs, rounded to a standard value and checked with a real diode model.
How it works
Calculates the series resistor for one or more LEDs in series: R = (Vs − n·Vf) / I, rounds up to the next E6/E12/E24 value, and then verifies the actual current, LED voltage and resistor dissipation by simulating the circuit with Ohmforge's diode model. Suggests a power rating with 2× margin.
- Exact value R = (Vs − n·Vf) / I with the typical forward voltage of the chosen colour at 20 mA.
- Rounded UP to the next preferred value of the chosen E-series so the current never exceeds the target.
- The circuit (supply, resistor, n LEDs) is then simulated with Ohmforge's LED diode model (n = 2, Rs = 4 Ω, fitted to Vf at 20 mA) to report the real current, which is slightly different because Vf depends on current.
- Resistor rating: next of 0.125/0.25/0.5/1/2/5 W at or above twice the dissipation.
Forward voltages vary by LED type and batch (±0.2 V is common); check the datasheet of your LED. Mains-powered LED circuits need proper isolation – do not build them from this calculation.
Sources
Use this tool in an app
These free programs for your browser have this tool built in, next to everything else the task needs.
-
Ohmforge Virtual electronics workbench
Draw a circuit, switch it on, and measure it with real-feeling bench instruments.
-
Skillgrove Learning app with lessons, labs and quizzes
Learn plants, crafts, code, electronics, science and money, from basic to expert.
Related tools
- Ohmforge DC Operating Point – SPICE netlist in, node voltages, branch currents, power and overload warnings out.
How to use the Ohmforge LED Resistor Calculator
Find the right series resistor for one or more LEDs, rounded to a standard E-series value, with the real current, resistor power rating and efficiency.
What it is for
On a battery or plain DC supply, an LED's current is usually limited by a series resistor. The textbook formula is R = (supply − LED voltage) ÷ current. Two practical problems follow. The result is rarely a resistor you can buy, and the LED's voltage isn't fixed: it shifts with current, so the real current differs a little from the target.
This calculator handles both. It computes the exact value, rounds up to the next E6, E12 or E24 value so the current never exceeds your target, then simulates the circuit with Ohmforge's LED diode model to report the current that actually flows. It also suggests a power rating with a 2× margin and gives you a SPICE netlist for Ohmforge.
It assumes typical forward voltages per colour (for example, red ≈ 1.9 V, blue ≈ 3.1 V, white ≈ 3.2 V at 20 mA) and room temperature. Real LEDs vary by type and batch, often by ±0.2 V. If you know your LED's datasheet value, choose Custom forward voltage. This tool isn't meant for mains-powered LED circuits, which need proper isolation.
Worked example
One red LED on a 9 V battery at 20 mA, E12:
Use 390 Ω (E12, ≥ 0.5 W): 1× LED (Red) on 9 V draws 18.24 mA (exact value 355 Ω).
(9 − 1.9) ÷ 0.02 = 355 Ω, and the next E12 value up is 390 Ω. In simulation, the LED drops 1.888 V and 18.24 mA flows. The resistor burns 129.7 mW, so the tool recommends 0.5 W: twice 130 mW is 260 mW, which is above the common 0.25 W size. Only 21 % of the power reaches the LED, and the tool says so.
Three white LEDs in series on 12 V at 15 mA, E24: exactly 160 Ω, which happens to be an E24 value. Simulated current 15.57 mA, a 0.125 W resistor is enough, and efficiency rises to 79 %. Series strings waste far less power in the resistor.
A blue LED on 5 V at 10 mA: exact 190 Ω, use 220 Ω, 9.02 mA. Two white LEDs on 5 V are refused, because 6.4 V of forward voltage can't be reached from a 5 V supply.
How to read the result
- Exact value: the formula result.
- E-series value: the resistor to buy. This is the one that matters.
- Simulated current: what flows with that resistor. Usually a little below target because of the rounding.
- Resistor power and Use rating: the dissipation and a rating with at least 2× headroom.
- Efficiency: the share of supply power that goes into the LEDs rather than heating the resistor.
- SPICE netlist: the same circuit for Ohmforge or any SPICE simulator.
Tips and common mistakes
- Put LEDs in series, each string with its own resistor. Never wire LEDs straight in parallel on one shared resistor: they won't share current evenly.
- Leave headroom. If the supply only just exceeds the total forward voltage, small changes in supply or LED voltage cause big current swings.
- Indicator LEDs are often bright enough at 2–5 mA. Lower current saves battery and makes the resistor run cooler.
- For high-power LEDs (hundreds of mA), a resistor wastes a lot of power. Use a constant-current driver instead.
FAQ
What resistor do I need for an LED on 5 V?
For a red LED at 20 mA: (5 − 1.9) ÷ 0.02 = 155 Ω, so the next E12 value is 180 Ω. The simulation gives 17.32 mA, and a 0.125 W resistor is enough.
Why is the simulated current lower than my target?
The resistor is rounded up to a standard value, and the LED's forward voltage changes slightly with current. Both effects are included in the simulation.
Is a 0.25 W resistor enough?
Only if the tool's recommended rating says so. It applies a 2× margin, so 9 V with a 390 Ω resistor already needs 0.5 W.
Can I use a custom forward voltage?
Yes. Choose Custom forward voltage and enter the value from your LED's datasheet.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://ohmforgeledresistor.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://ohmforgeledresistor.usefulweb.site/mcp· tool nameohmforge_led_resistor
Example request
curl -s -X POST https://ohmforgeledresistor.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"supply":9,"colour":"red","current":20,"count":1,"series":"E12"}'