LM317 Voltage Regulator Calculator

Find R2 for any LM317 output voltage or Vout from R1 and R2, with nearest standard resistors, dropout check and heat dissipation.

  • Free, no signup
  • Works on mobile
  • Formula + worked example

How to use the LM317 calculator

  1. Pick a mode: R2 for a target voltage (you know the voltage you want) or Vout from R1 and R2 (you already have the resistors).
  2. Enter R1 — 240 Ω is the classic value — and the target voltage or R2.
  3. Choose the resistor series you can buy (E12, E24 or E96). The calculator picks the standard R2 that gives the output closest to your target, and shows the next value on each side.
  4. Enter the input voltage and load current to check dropout headroom and how much heat the regulator must get rid of.

Formula

The LM317 keeps 1.25 V (V_ref) between its OUT and ADJ pins. That fixes the current through R1, and the same current (plus a small ADJ-pin current) flows through R2:

Vout = 1.25 × (1 + R2 ÷ R1) + I_adj × R2 R2 = (Vout − 1.25) ÷ (1.25 ÷ R1 + I_adj) P = (Vin − Vout) × I_load
  • R1 – resistor from OUT to ADJ (usually 240 Ω)
  • R2 – resistor from ADJ to ground
  • I_adj – ADJ pin current, about 50 µA typical (up to about 100 µA)

Without the I_adj term the formula becomes the familiar Vout = 1.25 × (1 + R2 ÷ R1). With R1 = 240 Ω the difference is small — usually a few tens of millivolts — but it grows when R2 is large.

Common output voltages with R1 = 240 Ω

TargetIdeal R2Nearest E24 R2Real Vout (with I_adj)
3.3 V394 Ω390 Ω3.30 V
5 V720 Ω680 Ω4.83 V
6 V912 Ω910 Ω6.04 V
9 V1,488 Ω1.5 kΩ9.14 V
12 V2,064 Ω2.0 kΩ11.77 V

Dropout and heat

The LM317 is a linear regulator: it simply burns the extra voltage as heat. It also needs headroom — plan for the input to be at least about 3 V above the output, especially at higher currents or when a battery is running down. If you need 5 V from a 6 V source, use a low-dropout (LDO) regulator instead.

Common mistakes

  • Swapping R1 and R2. R1 goes between OUT and ADJ, R2 from ADJ to ground. Swapped, the output will be far from your target.
  • Using a large R1 (like 10 kΩ). The divider current drops below the LM317's minimum load current and the output can creep up with no load.
  • Mixing up pinouts. On the common LM317T (TO-220), the pins are ADJ, OUT, IN from left to right with the text facing you — check your datasheet, as it is different from the 7805.
  • Expecting below 1.25 V. The output can never go lower than V_ref.

Running from batteries? Estimate run time with the battery life calculator and read our robot battery guide. Make an R2 value from two resistors with the series and parallel resistor calculator, check cable losses with the wire gauge voltage drop calculator, and size the copper on your PCB with the PCB trace width calculator. Learn more about the capacitors around the regulator in capacitors explained for beginners.

Frequently asked questions

What is the LM317 output voltage formula?+

Vout = 1.25 × (1 + R2 ÷ R1) + Iadj × R2, where R1 sits between OUT and ADJ, R2 between ADJ and ground, and Iadj is about 50 µA. With R1 = 240 Ω the Iadj term adds only a few tens of millivolts, so many people use the simpler 1.25 × (1 + R2 ÷ R1).

Which resistors give 5 V from an LM317?+

With R1 = 240 Ω the ideal R2 is 720 Ω (about 713 Ω allowing for Iadj). In the E24 series, 680 Ω gives about 4.83 V and 750 Ω about 5.19 V. A 1% 715 Ω resistor gives about 5.01 V.

Why is R1 usually 240 Ω?+

R1 sets the current through the divider: 1.25 V ÷ 240 Ω ≈ 5.2 mA. That keeps the regulator above its minimum load current even with nothing connected. Some designers use 120 Ω to cover the worst-case 10 mA minimum load.

How much higher than the output must the input be?+

Plan for at least about 3 V more at the input than the output. The LM317 needs around 2 V of headroom at higher currents (more when it is cold), and battery voltages sag under load.

Does my LM317 need a heatsink?+

Multiply (Vin − Vout) by the load current. Below about 0.5 W a TO-220 LM317 runs warm without a heatsink; around 1 W it gets hot; above that, use a heatsink. For large drops at high current, a buck (switching) converter wastes much less power.

From the Thinking Robot store

Shop all
All tools
WhatsApp