How to use the LM317 calculator
- 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).
- Enter R1 — 240 Ω is the classic value — and the target voltage or R2.
- 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.
- 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:
- 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 Ω
| Target | Ideal R2 | Nearest E24 R2 | Real Vout (with I_adj) |
|---|---|---|---|
| 3.3 V | 394 Ω | 390 Ω | 3.30 V |
| 5 V | 720 Ω | 680 Ω | 4.83 V |
| 6 V | 912 Ω | 910 Ω | 6.04 V |
| 9 V | 1,488 Ω | 1.5 kΩ | 9.14 V |
| 12 V | 2,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.
Related tools and guides
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.





