LM317 Resistor Calculator

LM317 Resistor Calculator
Vout = 1.25(1 + R2/R1)
R1 = 240Ω (standard)
Iadj ≈ 50µA
LM317 Resistor Calculator
R1 (typically 240Ω)
Vout Target Voltage
Vin Input Voltage (optional)
Enter values
LM317 Resistor Calculator Results
R2 Required
Ω
Vout Actual
V
R2/R1 Ratio
×
Iadj Error
V
Dropout Vin−Vout
V
Power Dissipated
W
LM317 Voltage Regulator LM317 IN OUT ADJ Vin Vout R1 R2 GND Vout = 1.25(1 + R2/R1)

Figure 1: LM317 Resistor Calculator — enter values to calculate the result with step-by-step workings.

Table of Contents
Fundamentals
  1. How the LM317 Sets Output Voltage
  2. The Formula and Why R1 = 240Ω
Worked Examples
  1. 3.3V Output (Logic Level)
  2. 5V Output (Standard Rail)
  3. 12V Output (Motor/Relay Supply)
  4. Quick Reference Table
Deep Dive
  1. Dropout Voltage and Thermal Design
  2. Capacitor Requirements
  3. Accuracy and Iadj Error
Reference
  1. Frequently Asked Questions
  2. Related Calculators

How the LM317 Sets Output Voltage

The LM317 is the most popular adjustable linear voltage regulator — in production since the 1970s and still the default choice for simple, reliable power supplies. It maintains a constant 1.25 V reference voltage between its output pin and its adjustment pin. Two external resistors convert this fixed reference into any output voltage from 1.25 V to 37 V.

Inside the LM317, an error amplifier compares the voltage across R1 to the 1.25 V bandgap reference. If Vout drops (load increases), the amplifier drives the pass transistor harder, sourcing more current to restore the voltage. If Vout rises, the pass transistor backs off. This feedback loop holds Vout stable to within a few millivolts under changing load conditions. The Op-Amp Gain Calculator uses the same negative feedback principle — a reference, a divider, and a feedback loop that forces the output to a specific ratio.

The Formula and Why R1 = 240Ω

Vout = 1.25 × (1 + R2/R1)

Solving for R2: R2 = R1 × ((Vout/1.25) − 1)

The 1.25 V reference appears across R1, driving a fixed current of 1.25/R1 through the resistor divider. This current also flows through R2 to ground, producing a voltage drop across R2 that adds to the 1.25 V reference. The total output is the reference plus the R2 drop.

R1 = 240 Ω is the standard value because it sets the divider current to 1.25/240 = 5.2 mA — safely above the LM317’s minimum load requirement (typically 3.5–5 mA) while keeping power dissipation in the resistors low. A smaller R1 wastes current; a larger R1 risks falling below the minimum load at light output loads. The Emitter Resistor Calculator handles a similar design choice where a resistor value must balance current consumption against stability.

Example: 3.3V Output

R1 = 240 Ω, target Vout = 3.3 V

Ratio = (3.3 / 1.25) − 1 = 1.64

R2 = 240 × 1.64 = 394 Ω

Nearest E24 standard: 390 Ω → actual Vout = 1.25 × (1 + 390/240) = 3.28 V

Or use 430 Ω → Vout = 1.25 × (1 + 430/240) = 3.49 V

Neither standard value hits 3.3 V exactly. For precision, use a 360 Ω fixed + 100 Ω trimmer pot in series. For most digital logic (which tolerates 3.0–3.6 V), 390 Ω is close enough.

Example: 5V Output

R1 = 240 Ω, target Vout = 5.0 V

Ratio = (5.0 / 1.25) − 1 = 3.0

R2 = 240 × 3.0 = 720 Ω

Nearest E24: 750 Ω → Vout = 1.25 × (1 + 750/240) = 5.16 V

With a 9 V input: dropout = 9 − 5.16 = 3.84 V. At 0.5 A load: P = 3.84 × 0.5 = 1.92 W — needs a heatsink. The Transistor Biasing Calculator handles the related thermal analysis of power dissipation in a pass transistor.

Example: 12V Output

R1 = 240 Ω, target Vout = 12.0 V

Ratio = (12.0 / 1.25) − 1 = 8.6

R2 = 240 × 8.6 = 2,064 Ω

Nearest E24: 2.0 kΩ → Vout = 1.25 × (1 + 2000/240) = 11.67 V

Or 2.2 kΩ → Vout = 12.71 V

For exactly 12 V, combine 1.8 kΩ + 270 Ω in series = 2,070 Ω → Vout = 12.03 V.

With 15 V input at 1 A: P = (15 − 12) × 1 = 3 W — definitely needs a heatsink with thermal resistance below 15 °C/W.

Quick Reference Table

VoutR2 (calc)R2 (E24)Actual Vout
1.5 V48 Ω47 Ω1.49 V
3.3 V394 Ω390 Ω3.28 V
5.0 V720 Ω750 Ω5.16 V
9.0 V1,488 Ω1.5 kΩ9.06 V
12.0 V2,064 Ω2.0 kΩ11.67 V
15.0 V2,640 Ω2.7 kΩ15.31 V
24.0 V4,368 Ω4.3 kΩ23.65 V

All values assume R1 = 240 Ω. The gap between calculated and nearest standard R2 is why the calculator shows both the ideal value and the actual Vout — so you can pick the closest standard resistor and see exactly what voltage it produces.

Dropout Voltage and Thermal Design

The LM317 needs at least 2–3 V of headroom between input and output (the dropout voltage). Vin must be at least Vout + 3 V for reliable regulation. The voltage difference is dissipated as heat in the LM317’s internal pass transistor: P = (Vin − Vout) × Iload.

Thermal rule of thumb:
Below 0.5 W: no heatsink needed (TO-220 package).
0.5–2 W: small clip-on heatsink or PCB copper pour.
2–5 W: bolt-on heatsink with thermal paste.
Above 5 W: consider a switching regulator instead — the LM317 is wasting too much power as heat.

For high-current applications where the dropout is large, a switching pre-regulator followed by the LM317 for final filtering gives the best of both worlds — high efficiency from the switcher and low noise from the linear post-regulator. The MOSFET Calculator can analyse the switching element in such a pre-regulator design.

Capacitor Requirements

The LM317 datasheet specifies minimum capacitors for stable operation:

Input (Cin): 0.1 µF ceramic, placed as close to the LM317 input pin as possible. Prevents oscillation from long input leads. Required whenever the LM317 is more than a few centimetres from the main filter capacitor.

Output (Cout): 1 µF minimum for stability. 10 µF or larger electrolytic improves transient response. Ceramic alone can cause oscillation in some configurations — always include an electrolytic or tantalum in parallel.

Adjustment pin (Cadj): An optional 10 µF electrolytic from the ADJ pin to ground improves ripple rejection by 15–20 dB. Not required for basic operation but highly recommended for audio and sensitive analogue circuits.

Accuracy and Iadj Error

The LM317’s adjustment pin draws about 50 µA, which flows through R2 and adds a small error to the output voltage: ΔV = 50 µA × R2. For a 5 V output (R2 = 720 Ω), the error is 50 × 10−6 × 720 = 36 mV — negligible for most applications. For a 24 V output (R2 = 4.3 kΩ), the error grows to 215 mV. The Shockley Diode Calculator models a similar small-current effect where a few microamps through a junction produce a measurable voltage shift.

Overall output accuracy depends on the 1.25 V reference tolerance (±4% typical for LM317), resistor tolerances, and Iadj variation. With 1% metal film resistors, the dominant error source is the reference itself. For tighter accuracy, use an LM317L (lower tolerance) or a precision adjustable reference like the LM431.

Frequently Asked Questions

How does the LM317 set output voltage?
The LM317 maintains 1.25 V across R1 (between output and adjustment pin). The current through R1 also flows through R2, producing Vout = 1.25 × (1 + R2/R1). R1 = 240 Ω is standard.
What is the minimum output voltage?
1.25 V, when R2 = 0 (ADJ pin shorted to ground). The LM317 cannot regulate below its internal bandgap reference voltage.
What is dropout voltage?
The minimum voltage difference between input and output for regulation — typically 2–3 V for the LM317. Vin must be at least Vout + 3 V. The excess is dissipated as heat. For low-dropout applications, use an LDO regulator instead.
Do I need capacitors?
Yes. 0.1 µF ceramic on input (close to IC), 1 µF minimum on output for stability. Optionally 10 µF on ADJ pin to ground for improved ripple rejection. The 555 Timer Calculator faces similar capacitor selection considerations for timing accuracy.
Can I use the LM317 as a current source?
Yes. Connect R1 between output and ADJ with no R2. The constant 1.25 V across R1 sets a constant current: I = 1.25/R1. With R1 = 1.25 Ω, the current is 1 A. The BJT Gain Calculator can design a discrete current source for applications where the LM317 approach is too simple or dissipates too much power.
What if the nearest standard resistor does not give my target voltage?
Combine two standard resistors in series for R2 to get closer to the calculated value. Or use a fixed resistor plus a trimmer pot. For example, for exactly 12 V: 1.8 kΩ + 270 Ω = 2,070 Ω gives Vout = 12.03 V. The MOSFET Threshold Voltage Calculator deals with a similar precision-matching challenge in semiconductor design.

Browse all Electronics Calculators →

Last updated: March 2026