Two resistors set the output of an LM317, and the textbook pair for 5 volts does not exist in the standard E24 resistor series. The ideal second resistor is 720 ohms; the nearest stock values give 4.83 V or 5.19 V. Then the chip’s own tolerance spreads the 680-ohm version anywhere from about 4.60 V to 5.05 V before a single resistor tolerance is counted. Working through Texas Instruments’ current LM317 datasheet shows why this decades-old regulator is still on every parts list, and where its convenience costs volts, watts and degrees.
How the LM317 sets its output
A fixed 1.25 volts
The LM317 is a three-terminal linear regulator: input, output and an adjust pin. The LM317 datasheet (TI document SLVS044Z) lists the output as “Adjustable: 1.25V to 37V” with more than 1.5 A available. Internally it holds a reference of 1.25 V, typical, between its output and adjust pins.
Put a resistor R1 between output and adjust, and that 1.25 V drives a fixed current through it. Add R2 from the adjust pin to ground, and the same current, plus a small leak from the adjust pin itself, flows through R2. The voltage on R2 stacks on top of the 1.25 V, which sets the output.
The equation
The datasheet gives it as:
VO = VREF (1 + R2 / R1) + (IADJ × R2)
VREF is the 1.25 V reference. IADJ is the current flowing out of the adjust pin, which the datasheet lists as 50 µA typical and 100 µA maximum. Most quick calculations drop the IADJ term, which is fine for low voltages and less fine for high ones.

Picking resistors from real values
The usual R1
The datasheet’s typical application uses R1 = 240 Ω. With 1.25 V across it, that sets about 5.2 mA through the divider. That is comfortably above the minimum load current the datasheet requires to stay in regulation: 3.5 mA typical and 10 mA maximum, measured with 40 V across the regulator over the full temperature range. A circuit with no other load still keeps the regulator working, because the divider is a load.
Nearest E24 values
With R1 fixed at 240 Ω, the ideal R2 for each common output, and the result of the nearest standard E24 value including the typical 50 µA adjust current, came out as:
| Target | Ideal R2 | Nearest E24 R2 | Typical output |
|---|---|---|---|
| 3.3 V | 394 Ω | 390 Ω | 3.301 V |
| 5.0 V | 720 Ω | 680 Ω | 4.826 V |
| 9.0 V | 1,488 Ω | 1,500 Ω | 9.137 V |
| 12.0 V | 2,064 Ω | 2,000 Ω | 11.767 V |
The 3.3 V case lands almost exactly. The 5 V case is the awkward one: 680 Ω gives 4.83 V and 750 Ω would give about 5.19 V. A second resistor in series, a trim potentiometer, or a different R1 such as two values in parallel gets closer. For a 5 V rail that must be accurate, a fixed 5 V regulator is often the simpler part.
The adjust current’s share
The IADJ term added 19.5 mV to the 3.3 V output and 100 mV to the 12 V output. At its 100 µA maximum, those shares double. The effect grows with R2, which is one reason designs that need a high output voltage sometimes lower both resistors together, keeping the ratio but shrinking R2.
The tolerance hidden in VREF
1.2 to 1.3 volts
The reference is not exactly 1.25 V. The datasheet lists VREF as 1.2 V minimum, 1.25 V typical and 1.3 V maximum over its stated test conditions. That is a 4 percent window before resistor tolerances are added.
What that does to the output
Combining the VREF limits with the IADJ range, using perfect resistors, gave these possible spreads:
| R2 | Output range from VREF and IADJ alone |
|---|---|
| 390 Ω (3.3 V) | 3.15 to 3.45 V |
| 680 Ω (5 V) | 4.60 to 5.05 V |
| 1,500 Ω (9 V) | 8.70 to 9.58 V |
| 2,000 Ω (12 V) | 11.20 to 12.33 V |
Any one chip will sit at a single point inside its range, and most will sit near the typical value. But a design that copies the resistor values from a tutorial and expects exactly 5.00 V on every board is relying on the typical figure. When the voltage matters, a trimmer resistor in R2 and a meter on the output take care of it once per board.

Headroom and dropout
Three volts recommended
A linear regulator cannot make its output higher than its input, and it needs some margin between them to regulate. The LM317 datasheet’s recommended operating conditions list the input-to-output difference as 3 V minimum and 40 V maximum, and it says “A 3V headroom is recommended (VI – VO) to support maximum current and lowest temperature.”
In practice, that means a 5 V output wants at least 8 V at the input under full load, and a 12 V output wants 15 V. Feeding a 5 V LM317 from a 6 V battery pack may work at light current and room temperature, then droop when the load or the cold increases.
The other limit
The 40 V maximum difference matters at start-up and during faults. If the output is shorted or a large output capacitor is charging, nearly the whole input voltage appears across the regulator, so the input should never be more than 40 V above whatever the output might be pulled down to, including 0 V during a short.
Capacitors and protection diodes
Input and output capacitors
The two resistors are not the whole circuit. The datasheet recommends an input capacitor, noting that “A 0.1µF or 1µF ceramic or tantalum capacitor provides sufficient bypassing for most applications,” and that it matters most when the regulator sits far from the power supply’s own filter capacitors. Its typical application shows a 1.0 µF output capacitor, which “improves transient response, but is not needed for stability,” a convenient property compared with some newer regulators that oscillate without a capacitor of the right type.
The adjust-pin capacitor
A third capacitor, from the adjust pin to ground, improves ripple rejection. The datasheet says CADJ “prevents amplification of the ripple when the output voltage is adjusted higher.” Its electrical tables show the effect at a 10 V output and 120 Hz, the ripple frequency of a full-wave rectified 60 Hz supply: the legacy chip rejects 57 dB without the capacitor and 62 to 64 dB with 10 µF.
Diodes that protect the chip
Capacitors store charge, and when the input is suddenly shorted or switched off, that charge can flow backwards through the regulator. The datasheet recommends a protection diode D1 when the output capacitor is used and D2 when CADJ is used, saying the diode “provides a low-impedance discharge path to prevent the capacitor from discharging” into the chip. Two ordinary rectifier diodes cost far less than a replacement regulator.

Where the power goes
Heat equals voltage drop times current
Every volt the LM317 drops, it burns as heat. For an input of 12 V and an output of 5 V:
| Load current | Power in the regulator | Efficiency |
|---|---|---|
| 0.5 A | 3.5 W | 42% |
| 1.0 A | 7.0 W | 42% |
At 9 V in and 5 V out at 0.5 A, the loss falls to 2 W and the efficiency rises to 56%. The efficiency of a linear regulator is roughly output voltage divided by input voltage, so the closer the input sits to the output, the better, down to the 3 V headroom limit.
Temperature rise
The datasheet’s thermal table lists a junction-to-ambient thermal resistance of 23.5 °C/W for the TO-220 KCS package with the legacy chip, measured under the standard test conditions the table describes. At 3.5 W, that suggests a junction about 82 °C above the surrounding air. At 7 W, the figure would be about 164 °C of rise, which is not survivable without a heatsink. Real-world thermal resistance depends heavily on how the part is mounted, so the datasheet’s number is a starting point for heatsink sizing, not a guarantee.
Linear or switching
These numbers are why many projects now use a small switching buck converter instead. A linear regulator is quiet, cheap and simple, and the LM317’s line regulation of 0.01 %/V typical at 25 °C is excellent. But when the voltage difference and current are both large, most of the input power turns into heat. The LM317 earns its place when the drop is small, the current is modest, or the circuit needs a clean, adjustable rail without switching noise.
For bench and breadboard projects:
- BOJACK LM317T Adjustable Positive Voltage Regulator 1.2 V to 37 V 1.5 A IC LM317 chip TO-220 (Pack of 25): a 25-pack of the TO-220 LM317, the package with a metal tab for bolting to a heatsink. See it on Amazon (affiliate link)
As an Amazon Associate I earn from qualifying purchases. A commission may be earned if you buy through this link, at no extra cost to you.
Sources
- Texas Instruments, LM317 datasheet, SLVS044Z (revised April 2025): https://www.ti.com/lit/ds/symlink/lm317.pdf
