Parts
LM317 regulator: pinout, the R1/R2 formula, heat and the LM337
By Bulan Sarkar
An LM317 in a TO-220 is ADJ, OUT, IN: printed face toward you, leads down, the adjust pin is on the left, the output in the middle and the input on the right. The metal tab is the output as well, so a heatsink bolted to it sits at the output voltage.
Two resistors set the voltage, and the heat decides almost everything else. Below are the formula, a 5 V supply from 12 V worked through to the heatsink, and the LM337, the negative version, whose middle pin is the input. The numbers come from TI's SLVS044Z and SLVS047L and ST's DS0433 and LM337 datasheets.
Datasheet: Texas Instruments LM317 3-Pin Adjustable Regulator, SLVS044Z (PDF)Ask Datasheet Guru about the LM317T
Pinout by package
Printed face toward you, leads down: adjust, output, input from left to right. The tab is the output.
Source: Texas Instruments LM317 3-Pin Adjustable Regulator, SLVS044Z, p. 5 (Figure 5-2, KCS/KCT TO-220, and the pin table: ADJUST 1, OUTPUT 2 and TAB, INPUT 3)
Printed face toward you, leads down: adjust, output, input from left to right. ST prints "Tab connected to OUTPUT".
Source: STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 2 (Figure 1, TO-220 pin connections: INPUT, OUTPUT, ADJUST, "Tab connected to OUTPUT"); STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 13 (Table 6, order codes: LM317T is the TO-220)
Printed face toward you, leads down: adjust, input, output from left to right. The tab is the input.
Input and output swap places against the LM317. The tab is the input here, not the output.
Source: Texas Instruments LMx37 3-Terminal Adjustable Regulators (LM237, LM337), SLVS047L, p. 3 (KC and KCS TO-220 drawings with the tab marked INPUT; pin table ADJUSTMENT 1, INPUT 2, OUTPUT 3); STMicroelectronics LM337 Three-terminal adjustable negative voltage regulators, DocID2167, p. 4 (Figure 2, TO-220 pin connections: OUTPUT, INPUT, ADJUST)
Which one do you have?
LM317T is the TO-220 most shops sell, in ST's order codes as LM317T or the double-gauge LM317T-DG. TI's TO-220 parts are the KCS and KCT packages, which TI lists as its "legacy chip"; its newer die comes in SOT-223 and TO-263, with the same pin numbers and the tab still on the output. ST also sells an LM317 in a fully moulded TO-220FP (order code LM317P) with the same pin order.
Letters in front of the number name a temperature grade, not a different circuit: the LM217 is rated for a −25 to 150 °C junction and the LM317B for −40 to 125 °C. TI also lists an LM317M (0.5 A) and an LM317L (0.1 A) in its comparison table; those come in other packages with their own datasheets, so check their pins before you swap one in. A part marked only "LM317" with no maker's logo is anybody's; the bench check further down tells you whether it behaves like the datasheet.
Ratings
Both makers allow 40 V between input and output, about 1.5 A, and a junction between 0 and 125 °C in normal use. TI prints 150 °C as the absolute maximum for the TO-220 but recommends 125 °C; design to 125 °C.
| Parameter | LM317TO-220 | LM317TTO-220 | LM337TO-220 |
|---|---|---|---|
| Input-to-output voltage VI − VO | 40 V | 40 V | −40 V |
| Input-to-output voltage, recommended | 3 to 40 V | 2.5 to 40 V (where VREF is tested) | −2.5 to −37 V |
| Output current, recommended IO | 10 mA to 1.5 A | internally limited | 10 mA to 1.5 A (P ≤ 15 W) |
| Power dissipation PD | internally limited | internally limited | not listed |
| Junction temperature, absolute maximum TJ | 150 °C | 125 °C (0 to 125 °C operating) | 150 °C |
| Junction temperature, recommended TJ | 0 to 125 °C | 0 to 125 °C | 0 to 125 °C |
| Junction to ambient, TO-220 RθJA | 23.5 °C/W (JEDEC test board) | 50 °C/W | 24.8 °C/W (JEDEC test board) |
| Junction to case, TO-220 RθJC | 15.9 °C/W (top), 0.1 °C/W (bottom) | 5 °C/W | 3 °C/W (top) |
| Storage temperature Tstg | −65 to 150 °C | −65 to 150 °C | −65 to 150 °C |
The thermal figures are where they part company. TI lists 23.5 °C/W from junction to air for its TO-220, a number computed for the JEDEC standard test board. ST gives 50 °C/W for the bare package and 5 °C/W from junction to case. Use ST's pair: a regulator standing on two legs in a box is closer to ST's case than to a test board, and the worked example below uses those two numbers.
Reference, adjust current and headroom
| Parameter | LM317TO-220 | LM317TTO-220 | LM337TO-220 |
|---|---|---|---|
| Reference voltage, OUTPUT to ADJUST VREFfull load and temperature range; from 3 V across the part (TI), 2.5 V (ST) | 1.2 / 1.25 / 1.3 V | 1.2 / 1.25 / 1.3 V | −1.2 / −1.25 / −1.3 V |
| Reference voltage at 25 °C VREF | 1.25 V typ | not given separately | −1.213 / −1.25 / −1.287 V |
| Adjust pin current IADJ | 50 µA typ, 100 µA max | 50 µA typ, 100 µA max | 65 µA typ, 100 µA max |
| Minimum load current|VI − VO| = 40 V | 3.5 mA typ, 10 mA max | 3.5 mA typ, 10 mA max | 2.5 mA typ, 10 mA max |
| Current limit|VI − VO| ≤ 15 V | 1.5 A min, 2.2 A typ | 1.5 A min, 2.2 A typ | 1.5 A min, 2.2 A typ |
| Current limit|VI − VO| = 40 V, 25 °C | 0.15 A min, 0.4 A typ | 0.4 A min | 0.15 A min, 0.4 A typ |
| Line regulation at 25 °C3 V to 40 V across the part | 0.01 %/V typ, 0.04 %/V max | 0.01 %/V typ, 0.04 %/V max | 0.01 %/V typ, 0.04 %/V max |
| Load regulation at 25 °C10 mA to 1.5 A, |VO| ≥ 5 V | 0.1 % typ, 0.5 % max | 0.1 % typ, 0.5 % max | 0.3 % typ, 1 % max |
| Ripple rejection, 120 Hz, 10 µF on ADJVO = 10 V (−10 V for the LM337) | 62 dB min, 64 dB typ (legacy chip) | 66 dB min, 80 dB typ | 66 dB min, 77 dB typ |
| Dropout, typical, 25 °Cread from ST Figure 4 | TI asks for up to 3 V headroom | about 1.9 V at 500 mA, 2.3 V at 1.5 A | TI asks for at least 2.5 V |
The reference is the voltage the LM317 holds between OUT and ADJ: 1.25 V typical, anywhere from 1.2 V to 1.3 V over load and temperature. Every output voltage is that number scaled by the divider, so a part at the edge of its limits moves a 5 V output by about 4 % either way.
The adjust pin leaks 50 µA typical, 100 µA at most, into R2. With a few hundred ohms there it adds a few tens of millivolts. With tens of kilohms it adds volts, which is one reason R1 and R2 stay small.
The regulator also needs current to stay in regulation: 3.5 mA typical and up to 10 mA with 40 V across it. The divider can supply that by itself, which is why the worked example uses 120 Ω for R1 rather than the 240 Ω in TI's drawing.
Headroom is the last limit. TI asks for up to 3 V between input and output. ST's typical dropout curve sits lower, near 1.9 V at 500 mA and 2.3 V at 1.5 A at 25 °C, but that is a typical curve, not a limit. Plan on 3 V.
What it is good for
- Odd voltages no fixed regulator offers, from 1.25 V up to 37 V.
- A bench supply with a pot as R2. The LM317 calculator finds the resistor pair for any voltage.
- A constant-current source: one resistor from OUT to ADJ, and the current is 1.25 V divided by that resistor (TI section 7.3.3). It is a common way to run an LED string or charge a small battery at a fixed current.
- Cleaning up the output of a switching module, a volt or two below it.
It is the wrong part for a big step down at more than a few hundred milliamps. Every volt it drops turns into heat, as the example below shows. For 12 V to 5 V at an amp, a buck regulator such as the LM2596 wastes far less. For 3.3 V from 5 V at small currents, the AMS1117 needs less headroom.
Worked example: 5 V at half an amp from 12 V
A 12 V adapter has to give 5 V to a 10 Ω load, about half an amp. The circuit is TI's Figure 8-1 without the optional parts: R1 from OUT to ADJ, R2 from ADJ to ground, 100 nF on the input and 1 µF on the output.
1. Pick R1 for the minimum load. 1.25 V / 120 Ω = 10.4 mA, just over the 10 mA worst case, so the output holds even with nothing else connected. TI's 240 Ω gives 5.21 mA: enough for a typical part, not for every part.
2. Pick R2. R2 = R1 × (5 / 1.25 − 1) = 360 Ω, an E24 value. With the adjust current added, VOUT = 1.25 × (1 + 360/120) + 50 µA × 360 Ω = 5.02 V. Over the reference limits and up to 100 µA of adjust current it lands between 4.8 V and 5.24 V.
3. Check the headroom. 5.02 V + 3 V = 8.02 V is the lowest input that keeps it regulating. 12 V leaves 6.98 V, plenty.
4. Work out the heat. The regulator carries the load current, 502 mA, plus the divider's 10.4 mA: 512 mA in all. P = (12 − 5.018) V × 512 mA = 3.58 W, with the adjust current adding well under a milliwatt.
5. Try it without a heatsink. At ST's 50 °C/W the junction would rise 179 °C, to 219 °C in 40 °C air. It never gets there: the thermal protection shuts the output down first, and the supply cuts in and out.
6. Size the heatsink. (125 − 40) °C / 3.58 W = 23.8 °C/W in total, junction to air. Take off 5 °C/W junction to case and 1 °C/W for a greased insulating pad, our allowance since neither maker gives one: the heatsink must be 17.8 °C/W or better. A 17 °C/W part puts the junction at 122 °C.
The LM317 calculator runs the same resistor sums for any voltage and supply. The regulator thermal design and heatsinks lessons go deeper into the heat side.
Worked example in numbers
- Output voltage
- 5.02 V
- Heat in the LM317
- 3.58 W
- Heatsink needed
- ≤ 17.8 °C/W
- Efficiency
- 41 %
The LM337: the negative version
The LM337 makes a negative rail the same way: −1.25 V between OUTPUT and ADJUSTMENT, scaled up by R2 over R1. With the same 120 Ω and 360 Ω it gives -5 V; TI's design procedure uses 120 Ω for R1 for the same minimum-load reason, 10.4 mA through the divider.
The pins are not the LM317's. In the TO-220 the LM337 is ADJ, IN, OUT, and TI marks the tab as the input. ST's sheet shows the same pin order. The negative supply therefore sits on the tab and on any heatsink bolted to it.
One more difference: the LM337 needs an output capacitor to stay stable. Both makers ask for 1 µF solid tantalum or 10 µF aluminium electrolytic on the output, and 1 µF tantalum on the input when the regulator sits more than 10 cm from the supply's filter capacitor. ST rates its TO-220 at 70 °C/W junction to air and 3 °C/W junction to case.
Tips and checks
- Solder R1 straight across the OUT and ADJ pins and run R2's ground end to the load's ground. ST recommends exactly this for the best load regulation.
- A 10 µF capacitor from ADJ to ground raises the ripple rejection: ST quotes about 15 dB, and TI's 120 Hz figure goes from 57 dB to 64 dB on the TO-220. Add TI's protection diode across R1 with it, so the capacitor cannot discharge into the adjust pin.
- The tab is live. Use an insulating pad and bushing if the heatsink touches anything else, or treat the whole heatsink as the output rail (the input rail for an LM337).
- Keep R1 at 120 Ω or lower unless the load always draws 10 mA. A light load on a 240 Ω divider can let the output creep up.
- Without a heatsink, keep the heat under about 1.7 W in 40 °C air (85 °C of rise at 50 °C/W).
Substitutes
The LM217 and LM317B are the same regulator in other temperature grades and drop straight in. For the LM337 the LM237 does the same job. Nothing in this list fixes the heat; a part that runs too hot as an LM317 runs just as hot as an LM217.
| Part | Pins | Verdict |
|---|---|---|
| LM217 | ADJ-OUT-IN | The same regulator in ST’s sheet, rated for a −25 to 150 °C junction instead of 0 to 125 °C. Same pins, same 1.25 V reference; a direct swap.STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 3; STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 5 |
| LM317B | ADJ-OUT-IN | ST’s −40 to 125 °C grade. Same pins, but its reference is specified only up to 500 mA, so treat it as a half-amp part on paper.STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 3; STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 7 |
| LM237 (for an LM337) | ADJ-IN-OUT | The wider-temperature LM337, rated −25 to 150 °C. Same pins as the LM337, which means the opposite middle pin to an LM317.Texas Instruments LMx37 3-Terminal Adjustable Regulators (LM237, LM337), SLVS047L, p. 3; Texas Instruments LMx37 3-Terminal Adjustable Regulators (LM237, LM337), SLVS047L, p. 4 |
A bench check before it goes in
- Power off, meter on continuity: the tab should read 0 Ω to the middle pin.
- Wire the 120 Ω and 360 Ω divider, feed 12 V from a current-limited bench supply and measure the output with no load. It should be between 4.8 V and 5.24 V.
- Measure across R1. That is the reference: 1.2 V to 1.3 V. A part outside it is not behaving like an LM317.
- Add the load and watch the output for a minute. If it sags or starts cutting out, the heat is the cause, not the resistors.
The common mistakes: the LM337 wired like an LM317, R1 at a few kilohms with no load so the output floats up, no heatsink on a 3 W job, and the heatsink shorted to a grounded case through a missing insulator. The linear regulators lesson explains why the heat follows the voltage drop, and the voltage divider covers the R1/R2 arithmetic.
What we'd do
Use the LM317 for odd voltages, adjustable bench supplies and current sources, with R1 at 120 Ω and R2 from the formula. Work out the heat before choosing it: under about 1.7 W it runs bare, up to a few watts it needs a proper heatsink, and beyond that, or for 12 V to 5 V at an amp, buy a buck module instead. For a negative rail use the LM337, and check its pinout twice.
Questions people ask
What is the LM317 pinout?
In TO-220, with the printed face toward you and the leads down: pin 1 adjust, pin 2 output, pin 3 input. The tab is the output.
How do I calculate R1 and R2 for an LM317?
VOUT = 1.25 V × (1 + R2/R1), plus a small error from the adjust current. Fix R1 at 120 Ω and solve for R2: R2 = 120 × (VOUT/1.25 − 1). 5 V needs 360 Ω.
What input voltage does an LM317 need?
The output plus about 3 V, and no more than 40 V above the output. For 5 V out that means at least 8 V in.
Does an LM317 need a heatsink?
Multiply the voltage it drops by the current. Below about 1.7 W in warm room air, no. Above it, yes: 12 V to 5 V at half an amp is 3.6 W and needs about 17 °C/W.
Can an LM317 drive LEDs at a constant current?
Yes. Put one resistor between OUT and ADJ and take the current from the far end of it: I = 1.25 V / R. 62 Ω gives about 20 mA. The input has to cover the LED string, the 1.25 V across the resistor and 3 V of headroom.
What is the difference between the LM317 and the LM337?
The LM317 regulates positive voltages, the LM337 negative ones. The LM337's middle pin and tab are the input, and it needs an output capacitor to be stable.
Buying the LM317 in India
LM317T in TO-220 is stocked by almost every component shop and sold loose. Ask for the LM337 by name, since some shops keep only the LM317, and ask for a named maker. A part with no logo may still work, but run the bench check above before you trust it with anything expensive, and buy the heatsink and insulating kit at the same time. Our guide to buying electronic components in India compares ten online sellers and covers how to spot fakes.
One email a month from the bench
New circuits, lessons, part guides and calculators, on the first Sunday of each month.
Used in these lessons
Lessons that go deeper
Datasheets this page was checked against
- Texas Instruments, LM317 3-Pin Adjustable Regulator, SLVS044Z (SLVS044Z, September 1997, revised April 2025)
- STMicroelectronics, LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433 (DS0433 Rev 22, December 2021)
- Texas Instruments, LMx37 3-Terminal Adjustable Regulators (LM237, LM337), SLVS047L (SLVS047L, November 1981, revised January 2015)
- STMicroelectronics, LM337 Three-terminal adjustable negative voltage regulators, DocID2167 (DocID2167 Rev 5, May 2014)
Makers revise datasheets. If the copy you download has a newer revision and a number here disagrees with it, the datasheet wins, and we would like to hear about it.