The LM317 is a three-terminal adjustable positive voltage regulator. It delivers up to 1.5 A of output current over an output range of 1.25 V to 37 V, set by nothing more than two external resistors. One LM317 replaces a range of fixed regulators, which is why it has stayed in production since the 1970s and remains one of the most stocked linear regulators in the industry.
The part uses a floating architecture: it senses only the voltage difference between its input and output pins, not the voltage to ground. Two practical consequences follow. First, it can regulate within supplies of several hundred volts, as long as the input-to-output differential never exceeds 40 V. Second, its output is programmed externally, and the programming network introduces two design requirements covered later in this article.
Table of Contents
LM317 Pinout
The LM317 has three pins: ADJ (adjust), VOUT (output), and VIN (input). The pin numbering is consistent across the common packages, but the physical arrangement and the tab connection are where errors happen.

| Package | Pin 1 | Pin 2 | Pin 3 | Tab |
|---|---|---|---|---|
| TO-220 (LM317T) | ADJ | VOUT | VIN | VOUT |
| TO-263 / D2PAK (LM317D2T) | ADJ | VOUT | VIN | VOUT |
| SOT-223 | ADJ | VOUT | VIN | VOUT (pin 4) |
| TO-92 (LM317LZ, 100 mA) | ADJ | VOUT | VIN | — |
Two warnings before wiring:
The tab is VOUT, not ground. On the TO-220, TO-263 and SOT-223 packages, the metal tab connects internally to the output pin. Bolting an LM317T directly to a grounded chassis or a shared grounded heatsink shorts the output to ground. Use an insulating pad and shoulder washer, or an isolated heatsink. This is the opposite of the 7805, whose tab is ground.
The LM317 is not pin-compatible with the 78xx series. The 78xx order is IN–GND–OUT; the LM317 order is ADJ–OUT–IN. Dropping an LM317 into a 7805 footprint applies the raw input voltage where the circuit expects a regulated output.
For the TO-92 package, note that TI’s datasheet drawing is a bottom view. Reading a bottom-view drawing as a top view is a common cause of miswired LM317LZ builds. When in doubt, identify pin 1 (ADJ) from the flat-face orientation in the specific manufacturer drawing, not from a diagram found in an image search.
Part Number Suffixes
The suffix on an LM317 part number encodes the package and the current class, and mixing them up changes the current rating by an order of magnitude:
| Part number | Package | Max output current |
|---|---|---|
| LM317T | TO-220 | 1.5 A |
| LM317D2T | TO-263 (D2PAK) | 1.5 A |
| LM317K | TO-3 metal can (legacy) | 1.5 A |
| LM317M | SOT-223 / TO-252 | 500 mA |
| LM317L / LM317LZ | SOIC-8 / TO-92 | 100 mA |
The prefix matters too: LM117 is the military-temperature version (−55 °C to +150 °C), LM317B and NCV317 are the −40 °C to +125 °C industrial/automotive grades, and the plain LM317 is specified for 0 °C to +125 °C junction temperature.
LM317 Datasheet and Key Specifications
The table below summarizes the key electrical characteristics from the Texas Instruments LM317 datasheet, cross-checked against the STMicroelectronics and onsemi datasheets. Where manufacturers differ, the most conservative figure is shown.
| Parameter | Value |
|---|---|
| Output voltage range | 1.25 V to 37 V |
| Output current | 1.5 A (with adequate heatsinking) |
| Reference voltage (VOUT to ADJ) | 1.25 V nominal (1.2 V to 1.3 V) |
| Adjust pin current (IADJ) | 50 µA typical, 100 µA max |
| Max input-to-output differential | 40 V |
| Line regulation | 0.01 %/V typical |
| Load regulation | 0.1 % typical |
| Minimum load current | 3.5 mA typical, 10 mA max worst case |
| Ripple rejection | 65 dB; 80 dB with 10 µF ADJ bypass |
| Protection | Current limit, thermal shutdown, safe-area protection |
All protection circuitry remains functional even if the ADJ pin is disconnected — the output simply defaults toward 1.25 V when ADJ is clamped to ground, which is also how electronic shutdown is implemented.
How the LM317 Works
The LM317 maintains a constant 1.25 V reference between its VOUT and ADJ pins. Place a resistor R1 between those two pins and a fixed current I1 = 1.25 / R1 flows through it. That current continues through R2 down to ground, and the output voltage is the sum of the reference plus the drop across R2.
The complete output equation is:
Vout = 1.25 × (1 + R2/R1) + IADJ × R2
The second term is often omitted from published circuits. It exists because the ADJ pin sources up to 100 µA of its own bias current through R2, and whether it can be ignored depends entirely on the resistor values.
When the IADJ term does not matter. With the standard R1 = 240 Ω and R2 = 720 Ω:
Vout = 1.25 × (1 + 720/240) = 5.00 V
Worst-case IADJ error: 100 µA × 720 Ω = 0.072 V. Output lands between 5.00 V and 5.07 V — about 1.4 % high in the worst case, usually inside the tolerance stack of the resistors themselves.
When it does matter. Suppose the divider is scaled up ten times to reduce standing current — R1 = 2.4 kΩ, R2 = 7.2 kΩ. The first term still says 5.00 V, but the error term is now 100 µA × 7.2 kΩ = 0.72 V. The nominal 5 V rail can sit at 5.72 V. High-value dividers on an LM317 trade quiescent current for accuracy, and they also conflict with the minimum-load requirement below. Keep R1 in the 120–240 Ω range unless both effects have been calculated.
The LM317 was deliberately designed to make IADJ small and constant with line and load changes, and it achieves this by returning all of its internal quiescent current to the output pin rather than to ground. That design decision is also why the LM317 has a minimum load current requirement.
Minimum Load Current Requirement
Because the regulator’s quiescent current exits through VOUT, something at the output must sink it. If the total load falls below the minimum operating current, that quiescent current has nowhere to go, charges the output node, and the output voltage rises above the programmed value. The regulator has not failed; this is normal behavior for an unloaded LM317, and it is a frequent cause of an LM317 appearing to output the wrong voltage.
The numbers: minimum load current is 3.5 mA typical, but the guaranteed worst case is 10 mA at the full 40 V input-output differential (it relaxes at low differentials). The standard fix is to make the feedback divider itself the minimum load:
- R1 = 240 Ω → divider sinks
1.25 / 240 ≈ 5.2 mA. Covers the typical case; not guaranteed at high differential. - R1 = 120 Ω → divider sinks
1.25 / 120 ≈ 10.4 mA. Covers the guaranteed worst case at any operating condition.
If the design can genuinely present a zero-current load (a bench supply with nothing connected, a battery charger after the battery is removed), size R1 at 120 Ω. The extra few milliamps of standing current is the cost of guaranteed regulation at no load.
LM317 Application Circuits
Basic Adjustable Regulator

This is the canonical circuit, shown here programmed for 5 V (R1 = 240 Ω, R2 = 720 Ω). Component roles, and when each is actually required:
- Ci (0.1 µF ceramic or 1 µF tantalum, input to ground): required if the regulator sits more than about 15 cm from the supply’s filter capacitors; recommended otherwise.
- CADJ (10 µF, ADJ to ground): optional. Raises ripple rejection from 65 dB to 80 dB by preventing input ripple from being amplified along with the output voltage. Values above 10 µF provide no further improvement at 120 Hz.
- Co (1 µF tantalum or 25 µF electrolytic): the LM317 is stable with no output capacitor, but stray capacitance in the 500 pF–5000 pF range can cause ringing; Co swamps that window and improves transient response.
- D1 (1N4002, VOUT to VIN): discharge path for Co if the input is shorted.
- D2 (1N4002, ADJ to VOUT): discharge path for CADJ if the output is shorted. Protection diodes are only necessary when CADJ is used and the output is above roughly 25 V; below that, the internal paths survive the discharge.
One layout rule from the datasheet that materially affects performance: tie R1 directly to the VOUT pin, not out at the load. Any trace resistance between the regulator and R1 gets multiplied by (1 + R2/R1) and appears as load-regulation error — a 0.05 Ω run can degrade load regulation more than tenfold.
Variable Bench Supply (1.25 V – 25 V)

Replace R2 with a 5 kΩ potentiometer (R1 = 240 Ω) and the output sweeps from 1.25 V up to 1.25 × (1 + 5000/240) ≈ 27 V, ceiling-limited by the input voltage minus headroom. Two practical notes: the output can never reach 0 V — 1.25 V is the floor, because the reference sits between VOUT and ADJ — and at the low end of the pot the divider current is at its maximum, so the minimum-load condition is automatically satisfied; it is the high R2 end where an unloaded supply can drift upward.
Constant-Current LED Driver

Connect a single resistor R between VOUT and ADJ, take the load from the ADJ side, and the LM317 becomes a current source: it forces 1.25 V across R regardless of load, so
Iout = 1.25 / R
For a 20 mA LED string: R = 1.25 / 0.020 = 62.5 Ω → use 62 Ω, giving 20.2 mA. Power in R is only 1.25 V × 20 mA = 25 mW, so a standard 1/4 W part is fine. The same topology at higher currents charges NiMH cells or drives power LEDs — just verify R’s power rating (P = 1.25² / R) and the regulator’s dissipation. Because 1.25 V is dropped across R on top of the load voltage and the regulator’s own headroom, budget the input supply accordingly.
Power Dissipation and Heatsink Requirements
Every volt dropped across a linear regulator at load current becomes heat:
Pd = (Vin − Vout) × Iout
Take a common case — 12 V in, 5 V out, 1 A load:
Pd = (12 − 5) × 1 = 7 W
To hold the junction at its 125 °C limit in 25 °C ambient, total thermal resistance junction-to-ambient must not exceed (125 − 25) / 7 ≈ 14 °C/W. A bare TO-220 in free air is several times worse than that; at 7 W it will hit thermal shutdown almost immediately. A heatsink is not optional here — and remember from the pinout section that the tab it bolts through is at VOUT, so the heatsink must be insulated or isolated.
Two design levers reduce the problem at the source. Lower the input-output differential — feeding this rail from 8 V instead of 12 V cuts dissipation from 7 W to 3 W with identical output. Alternatively, above roughly 1.5–2 W of continuous dissipation, a bare TO-220 LM317 exceeds what the package can dissipate reliably in free air, and either a heatsink or a switching pre-regulator belongs in the design. Note also that the LM317’s internal current limit derates as the input-output differential grows: the full 1.5 A is only available at moderate differentials.
What the LM317 Is Used For
The same three-terminal block covers a wide span of roles: adjustable and non-standard fixed voltage rails, variable bench power supplies, constant-current sources and LED drivers, battery chargers (constant-current trickle chargers and current-limited voltage chargers), post-regulation to clean up the output of switching converters, on-card local regulation, and precision current limiters. With the ADJ pin clamped to ground through a transistor, it also implements logic-controlled electronic shutdown.
LM317 vs LM7805
Choose between them on three axes:
Output flexibility. The 7805 outputs a fixed 5.0 V. The LM317 covers any voltage from 1.25 V to 37 V and can be trimmed to a non-standard rail such as 3.3 V or 9.2 V with two resistors.
Circuit overhead. The 7805 works with just two bypass capacitors and has no minimum load requirement worth designing around. The LM317 needs its divider, has the minimum-load and IADJ considerations above, and its tab is live at VOUT while the 7805’s tab is safely at ground.
Precision. The LM317’s line and load regulation (0.01 %/V, 0.1 % typical) are tighter than a standard 7805’s, and its output can be set exactly rather than accepted at ±4 %.
The practical rule: if the rail is exactly 5 V, 12 V or another 78xx standard value and precision is not critical, the fixed part is simpler and more forgiving. The moment the design needs an in-between voltage, an adjustable rail, or a current source, the LM317 is the answer.
LM317 Family and Equivalents
The LM317’s architecture scales across a family of parts. Selection is by current first, then by dropout and polarity:
| Part | Type | Output current | Notes |
|---|---|---|---|
| LM317L | Adjustable positive | 100 mA | TO-92/SOIC; signal-level rails |
| LM317M | Adjustable positive | 500 mA | SOT-223/TO-252; SMD mid-current |
| LM317 | Adjustable positive | 1.5 A | The standard part |
| LM350 | Adjustable positive | 3 A | Same equation, same pinout |
| LM338 | Adjustable positive | 5 A | Same equation, same pinout |
| LM337 | Adjustable negative | 1.5 A | Mirror of the LM317 for negative rails; different pinout — check its datasheet |
| AMS1117-ADJ | Adjustable positive LDO | 1 A | ~1.3 V dropout vs the LM317’s ~3 V headroom requirement; the choice when input-output differential is tight |
LM338 and LM350 use the identical 1.25 × (1 + R2/R1) equation and TO-220 pinout, so an LM317 design upgrades to 3 A or 5 A by swapping the part and resizing the thermal design. The AMS1117-ADJ is the modern low-dropout alternative when the input rail sits close to the output — a 5 V to 3.3 V conversion, for example, is outside the LM317’s headroom but comfortable for an LDO. Cross-manufacturer sourcing is straightforward: TI, STMicroelectronics, onsemi and multiple second sources all produce the LM317 to compatible specifications, which keeps availability high and price low even during allocation cycles.
