PartAndStock
Blog

How to Set the LM317 Output Voltage

August 29, 2026 6 min read
Quick answer

The LM317's output voltage is set by two resistors: Vout = 1.25 V × (1 + R2/R1). The LM317 holds a fixed 1.25 V reference between its ADJ and OUT pins. For example, with R1 = 240 Ω and R2 = 720 Ω: 1.25 × (1 + 720/240) = 5 V. Increasing R2 raises the output.

The LM317 is a popular adjustable linear voltage regulator whose output is set by two resistors. Unlike a fixed-output regulator, a single LM317 can produce any voltage from 1.25 V up to about 37 V. This article covers the formula that sets the output, how to choose the resistors, and the practical caveats (dropout, minimum load, heat).

How the LM317 works (the 1.25 V reference)

The LM317 always maintains a fixed 1.25 V reference voltage (VREF) between its ADJ (adjust) and OUT (output) pins. If you place a resistor (R1) between these pins, a constant current flows through it: I = 1.25 / R1. That current also flows through a second resistor (R2), dropping an additional voltage across R2 and raising the total output. So the output voltage is set by the ratio of R1 and R2.

LM317 output voltage formula

The output voltage is given by:

Vout = 1.25 V × (1 + R2 / R1) + IADJ × R2

SymbolMeaningTypical value
VREFInternal reference (ADJ–OUT)1.25 V (fixed)
R1Resistor between OUT and ADJ240 Ω (or 220 Ω)
R2Resistor between ADJ and GND (adjust)Set by target output
IADJADJ pin leakage current≈ 50 µA (usually ignored)

Because IADJ is tiny, in practice the formula simplifies to Vout ≈ 1.25 × (1 + R2/R1). This is Ohm's law applied to the regulator.

Choosing the resistors, step by step

  1. Pick R1 — the datasheet recommends 240 Ω (220 Ω is also common).
  2. Decide your target output voltage (Vout).
  3. Solve for R2: R2 = R1 × (Vout/1.25 − 1).
  4. Pick the nearest standard value; for a precise output use a trimpot for R2.
  5. Check the input: Vin ≥ Vout + 3 V (dropout).
  6. Calculate the power dissipation and add a heatsink if needed.

Worked examples

R1R2Vout = 1.25 × (1 + R2/R1)
240 Ω240 Ω1.25 × (1 + 1) = 2.5 V
240 Ω720 Ω1.25 × (1 + 3) = 5 V
240 Ω2.4 kΩ1.25 × (1 + 10) = 13.75 V

For example, if you want 5 V and R1 = 240 Ω: R2 = 240 × (5/1.25 − 1) = 240 × 3 = 720 Ω.

Dropout and minimum load

The LM317 is a linear regulator; the input must be at least ~3 V above the output to work (dropout). It also needs a minimum load current of about 5–10 mA for its reference to behave; running with no load can let the output drift high. A small "bleeder" resistor across the output, or a real load, fixes this.

Power dissipation and heat

In a linear regulator the input–output difference is dissipated as heat: P = (Vin − Vout) × Iout. For example, going from 12 V to 5 V at 0.5 A: P = (12 − 5) × 0.5 = 3.5 W — a serious amount of heat that definitely needs a heatsink. With a large input–output gap and high current, consider a switching (buck) regulator instead for efficiency.

Common mistakes

  • Making R1 too large: the minimum load current is not met and the output drifts. Keep R1 at 240 Ω.
  • Ignoring dropout: Vin = Vout + 1 V will not regulate; leave at least +3 V.
  • Skipping the heatsink: at high dissipation the LM317 hits thermal shutdown and cuts the output.
  • Omitting input/output capacitors: for stability, ~0.1 µF at the input and ~1 µF at the output (or the datasheet's values) are recommended.

Use the calculator

To instantly find R1/R2 for your target output voltage, use our LM317 Voltage Calculator.

Frequently Asked Questions

What is the LM317 output voltage formula?+
Vout = 1.25 × (1 + R2/R1) + IADJ×R2. Since IADJ ≈ 50 µA is tiny, in practice Vout ≈ 1.25 × (1 + R2/R1) is used.
What value should R1 be for the LM317?+
The datasheet recommends R1 = 240 Ω (220 Ω is also common). Keep R1 near this value; a much larger R1 fails to supply the minimum load current and lets the output drift.
Which resistors give 5V from an LM317?+
With R1 = 240 Ω, R2 = 240 × (5/1.25 − 1) = 720 Ω. So 240 Ω and 720 Ω → 1.25 × (1 + 3) = 5 V.
What is the LM317 dropout voltage?+
About 3 V. The input must be at least 3 V above the output (Vin ≥ Vout + 3 V), otherwise regulation breaks down.
Why does the LM317 get hot, does it need a heatsink?+
The input–output difference becomes heat: P = (Vin − Vout) × Iout. Above a few watts a heatsink is essential, or thermal protection will cut the output.