Category

LM317 Calculator – Resistor Values, Output Voltage, Heatsink & Running Cost

Find the R1 and R2 resistors that set any output voltage from 1.25 V to 37 V on an LM317 adjustable regulator, or work out what an existing pair produces. Snaps onto real E24 and E96 values, draws the circuit diagram with your numbers on it, and calculates the power dissipated, the heatsink you need, the worst-case output spread and the yearly electricity cost. Symbols in ANSI or IEC standard, temperatures in °F or °C.

0 calculations

Calculation Parameters

V
Ω
Ω
V
mA
°C
°C/W
$
h

Enter Parameters

Fill in the form on the left and click "Calculate"

What Is the LM317 Calculator?

If you want to know which external resistors to choose to get your desired output voltage from the LM317 voltage regulator, the LM317 calculator is the only tool you need. Enter the voltage you want, and it hands you the two resistor values, the closest ones you can actually buy, the resulting output voltage, how hot the chip will get, and what it costs to run.

Whether you are planning to repair one of your electronic devices or just want to learn the basics of electronics, you have stumbled into the right place. Read on to find out what the LM317 voltage regulator is and how to calculate the required resistances to hit your target output voltage. You will also find an LM317 circuit diagram — the calculator draws it for you with your own values on it — and some common applications of the LM317 regulator.

What Is an LM317?

An LM317 is an adjustable DC voltage regulator. It can provide a steady output voltage even when there are fluctuations in the input power supply.

The regulator can supply an output current in the range of 0.01–1.5 A and a positive output voltage between 1.25 V and 37 V.

It is a three-terminal device. The three pins are:

  • Input terminal — accepts the supply voltage;
  • Output terminal — gives the regulated output voltage; and
  • Adjust terminal — sets the output voltage through two external resistors.

Notice what is not on that list: a ground pin. The LM317 is a floating regulator. It does not measure the output against ground at all — it holds a constant 1.25 V between its OUT and ADJ pins and nothing else. Every formula below follows from that one fact.

The device operates optimally as long as the difference between the input and output voltages lies in the range 3–40 V. Below 3 V the regulator drops out and simply follows the input; above 40 V you exceed the absolute maximum rating and destroy the part.

How to Adjust LM317 Voltage Regulator Output Voltage?

An LM317 is very easy to use, and we can vary the output voltage using a simple voltage divider arrangement consisting of two resistors, R1 and R2. R1 goes between the output pin and the adjust pin; R2 goes from the adjust pin to ground.

The formula for calculating the output voltage of the LM317 is:

VOUT = VREF × (1 + R2 / R1) + (IADJ × R2)

where:

  • VREF — the voltage difference between the output and adjustment terminals of the LM317. It has a constant value of 1.25 V; and
  • IADJ — the current that flows out of the adjust pin. The typical value of IADJ is 50 µA and can be neglected in most calculations.

Hence, we can write a simplified form of the above equation using the plain voltage divider formula:

VOUT = 1.25 × (1 + R2 / R1)

You can set the regulator to give a constant output voltage from 1.25 V to 37 V by choosing the appropriate resistors. The calculator computes both forms so you can see for yourself how much the adjust-pin current actually matters: with the usual R2 of a few hundred ohms it shifts the output by a few tens of millivolts, but with R2 up in the tens of kilohms it becomes the dominant error term.

Our resistor color code calculator can help you find the resistance of a resistor you already have in the parts drawer.

How to Use the LM317 Calculator

  1. Pick the unit system. Metric (IEC) draws resistors as IEC 60617 rectangles and reports temperatures in °C and heatsinks in °C/W. American (ANSI) draws them as ANSI/IEEE 315 zig-zags and reports °F and °F/W. Volts, ohms, amps and watts are the same in both — the SI units won that argument a long time ago.
  2. Choose what to solve for:
    • Find R2 — the usual case. You know the voltage you want and you have picked R1 (240 Ω is the classic choice).
    • Find R1 — you have a fixed R2, perhaps a trimmer already on the board.
    • Find VOUT — you have a circuit in front of you and want to know what it puts out.
  3. Enter the target output voltage and the resistor you already know.
  4. Pick a resistor series. E24 is the 5% series in every hobby kit; E96 is the 1% series. The calculator snaps the answer onto real catalogue values and shows the three nearest, with the output voltage each one gives.
  5. Enter the input voltage and the load current. These do not change the resistors — they decide whether the design survives.
  6. Pick the package and the ambient temperature to get the heat calculation, and optionally the thermal resistance of a heatsink you already own to see whether it is enough.
  7. Optionally enter your electricity price and how many hours a day the circuit runs, in any of twelve currencies, to see what all that waste heat costs per year — and what a switching regulator would have cost instead.

Worked Example: 5 V at 500 mA from a 12 V Supply

Take the most common LM317 job there is. You want 5 V from a 12 V wall adapter, drawing 500 mA, and you have fitted the traditional R1 = 240 Ω.

  • The resistor. R2 = (5 − 1.25) / (1.25 / 240 + 50 µA) = 713.2 Ω, which you cannot buy. The nearest E24 value is 680 Ω, giving 4.826 V — 3.5% low. The nearest E96 value is 715 Ω, giving 5.010 V, only 0.19% off. This is exactly why 1% resistors are worth the extra cent.
  • The heat. With the 715 Ω part the regulator drops 12 − 5.01 = 6.99 V while passing 505 mA, so it burns 3.53 W. In a TO-220 with no heatsink (θJA ≈ 50 °C/W) the junction would sit at 25 + 3.53 × 50 = 201.6 °C, far past the 125 °C limit. You need a heatsink of 23.3 °C/W or better — a small clip-on finned type will do.
  • The efficiency. 2.5 W out of 6.06 W in is 41.3%. At 24/7 and $0.15/kWh those 3.56 wasted watts cost $4.67 a year. A 90%-efficient buck converter would waste 278 mW and cost $0.37 — a saving of $4.31 per year, per regulator.
  • The tolerance. Even with 1% resistors the output can legitimately land anywhere between 4.704 V and 5.323 V — a 12.4% band — once the 1.20–1.30 V reference spread is stacked on top. With 5% resistors that band doubles. If you need 5 V to a tighter figure than that, you need a trimmer, not a better calculator.

The lesson. The resistors are the easy part; the LM317 calculator gets them right in one step. The interesting numbers are the other three: the heat, the heatsink and the electricity bill. A linear regulator throws away the entire voltage difference as heat, which is why an LM317 is a wonderful choice for dropping 9 V to 5 V at 50 mA and a poor one for dropping 24 V to 5 V at 1 A.

Why R1 Is Almost Always 240 Ω

The LM317 needs a minimum load to regulate properly — around 3.5 mA typically, and up to 10 mA in the worst case. The divider itself provides that load: the current through R1 is 1.25 V ÷ R1, which is 5.2 mA with 240 Ω. That is comfortably above the typical figure, so the regulator behaves even with nothing connected to the output.

Push R1 up to 10 kΩ to "save power" and the divider only draws 125 µA. With no load attached, the output drifts upward and the regulation specification no longer applies. The calculator warns you whenever your R1 is large enough to push the divider current under 3.5 mA — this is the single most common mistake in beginner LM317 circuits.

There is a second, less obvious reason to keep R1 small. The 50 µA adjust-pin current flows through R2, and R2 grows in proportion to R1. At R1 = 240 Ω a 5 V output needs R2 ≈ 715 Ω and that current adds 36 mV — nothing. At R1 = 10 kΩ the same 5 V needs R2 ≈ 21 kΩ, and the adjust current now contributes over a volt of the output. Tick the adjust-current box in the calculator and try it: with a large R1 the "negligible" term stops being negligible.

The LM317 Circuit

Beyond the two resistors, a working LM317 circuit wants a few extra parts:

  • C1, 0.1 µF at the input — required if the regulator sits more than a few centimetres from the filter capacitor of the power supply. Without it the regulator can oscillate.
  • C2, 1 µF at the output — improves the transient response and keeps the output stable.
  • A 10 µF capacitor from ADJ to ground — optional, and it improves ripple rejection by about 15 dB. It also slows the start-up ramp.
  • Protection diodes — if you add the ADJ capacitor, add a diode from output to ADJ to protect it during a short circuit, and a diode from output to input if the output can be held above the input by another supply.

Keep the R1 connection short and take it directly from the output pin, not from somewhere down a long trace. The LM317 regulates whatever it measures across R1, so any voltage dropped in the wiring between the pin and the resistor is voltage your load never sees.

Applications of the LM317

  • Adjustable bench power supply — swap R2 for a potentiometer and you have a continuously variable 1.25–37 V supply. This is the classic first project.
  • Fixed rails for logic and sensors — a clean 3.3 V or 5 V rail derived from a 9 V or 12 V supply, with far less output noise than a switching regulator.
  • Constant current source — wire a single resistor from OUT to ADJ and connect the load below it, and the LM317 delivers a fixed 1.25 V ÷ R amps regardless of the load. This is a common way to drive LEDs and charge NiMH cells.
  • Battery chargers — the constant-current mode plus a voltage limit makes a serviceable lead-acid or NiMH charger.
  • Pre-regulator ahead of a low-noise stage — dropping a noisy supply part of the way with an LM317 before a low-dropout regulator does the last volt.
  • Repairs — the LM317 is a drop-in substitute for a huge number of obsolete fixed regulators, since you can set it to whatever the original produced.

FAQs

What is the output voltage range of the LM317?

1.25 V to 37 V. The lower limit is the internal reference itself — with R2 shorted to ground the output is simply 1.25 V, and there is no way to go below it. The upper limit is the breakdown rating of the part.

Can the LM317 output 0 V?

Not on its own. To reach 0 V you have to sit the ADJ pin below the circuit ground, which needs a small negative supply — typically a −1.25 V reference — under R2. If you need a genuine 0 V, an LM337 pair or a dedicated 0-adjustable regulator is the easier answer.

What is the minimum input voltage for the LM317?

Three volts above whatever you want on the output. For a 5 V rail, feed it at least 8 V; for 12 V, at least 15 V. Remember that this must hold at the bottom of the ripple on your rectified supply, not at its average.

How much current can an LM317 deliver?

Up to 1.5 A in a TO-220 or TO-3 package, and that figure assumes adequate heatsinking and a modest input-to-output differential. In practice the heat, not the silicon, is what limits you: at 1.5 A the regulator dissipates 1.5 W for every volt it drops. The smaller packages are rated lower — 500 mA for the SOT-223 LM317M and 100 mA for the TO-92 LM317L.

Do I need a heatsink for my LM317?

Work out (VIN − VOUT) × ILOAD. Below about 1 W a bare TO-220 in still air is usually fine; above 2 W it is not. The calculator does the whole chain for you — power, junction temperature in free air, and the exact thermal resistance the heatsink has to beat. If it tells you no heatsink can do the job, that is not a rounding problem: it means the required thermal resistance is negative and you have to reduce the input voltage, drop some of it across a series resistor, or move to a switching regulator.

Why is my output voltage slightly wrong?

Three reasons, in order of size. First, your resistors: two 5% resistors can shift a 5 V output by a quarter of a volt between them. Second, the reference itself is specified as 1.20–1.30 V, not exactly 1.25 V. Third, the 50 µA adjust current, which matters once R2 gets large. The calculator's tolerance section stacks all three in the worst direction so you can see the band your output can legitimately land in.

Is the LM317 the same as the LM337?

No — the LM337 is its mirror image, a negative adjustable regulator. Same 1.25 V reference, same resistor formula, but it regulates a negative rail. A matched LM317 and LM337 pair is the standard way to build a split ±V bench supply.

Can I use a potentiometer for R2?

Yes, and it is the usual way to build an adjustable supply. Put a fixed resistor in series with the pot so that the output cannot be driven above what the rest of your circuit tolerates when the pot is at its maximum, and use the calculator in Find R2 mode twice — once for the lowest voltage you want and once for the highest — to size the pair.

Why is a linear regulator so inefficient?

Because it works by turning the unwanted voltage into heat. The current going out is essentially the current coming in, so the efficiency is roughly VOUT ÷ VIN, no matter what you do. Dropping 12 V to 5 V therefore caps you at about 41%. A switching regulator moves energy in packets instead of throttling it, which is how it reaches 90% — at the price of switching noise, a more complex board and an inductor. Enter your electricity price in the calculator to see what that difference is actually worth to you per year.

Calculation History

Loading...