Side-by-side comparison
| Parameter | LM317 | 7805 Voltage Regulator |
|---|---|---|
| Output Voltage | Adjustable — 1.25 V to 37 V set by R1, R2 | Fixed — 5.0 V ±4% |
| Setting Formula | Vout = 1.25 × (1 + R2/R1); typical R1=240 Ω | No formula — output is fixed at 5 V |
| Minimum Output | 1.25 V (reference voltage) | 5 V (fixed) |
| Maximum Input Voltage | 40 V | 35 V |
| Dropout Voltage | ~3 V (Vin must exceed Vout by 3 V) | ~2 V (Vin must be ≥ 7 V for 5 V output) |
| Output Current | Up to 1.5 A (with heatsink) | Up to 1.5 A (with heatsink) |
| External Components | R1 (240 Ω), R2 (calculated), output cap | Input cap (0.1 µF), output cap (0.1 µF) — minimal |
| Quiescent Current | ~5 mA (flows through R1 to output, not GND pin) | ~8 mA to GND pin |
| Protection Features | Thermal shutdown, current limiting, safe operating area | Thermal shutdown, current limiting, safe operating area |
| Package | TO-220 (LM317T), TO-92 (LM317L for 100 mA) | TO-220 (7805), TO-92 (78L05 for 100 mA) |
Key differences
The 7805 has three fixed-function pins: Input, GND, Output — the output is 5 V with no external resistors. The LM317 has three pins labelled Input, Adjustment, Output; the output floats at 1.25 V above the ADJ pin, and the resistor network from Output to ADJ to GND sets the final voltage using Vout = 1.25×(1 + R2/R1). The LM317's quiescent current flows into the ADJ pin (50 µA typical) and through R1 — a key difference: the 7805's quiescent current dumps to GND and wastes power. Both have ~3 V dropout; for a 3.3 V output, LM317 needs at least 6.3 V input. Line regulation for LM317 is 0.01%/V; for 7805 it is 50 mV maximum variation over input range.
When to use LM317
Use the LM317 when output voltage needs to be anything other than 5 V — charging a 12 V lead-acid battery at constant voltage, generating a 9 V reference for an analog circuit, or building a lab bench supply that sweeps from 1.25 V to 30 V with a potentiometer.
When to use 7805 Voltage Regulator
Use the 7805 when you need exactly 5 V and want zero external circuitry — powering a 5 V-tolerant microcontroller like ATmega328P from a 9 V battery, driving a 5 V relay from a wall adapter, or any prototype where simplicity matters more than voltage flexibility.
Recommendation
Choose LM317 when your output voltage must be anything other than 5 V — the two-resistor formula gives you any voltage from 1.25 V to 37 V. Choose 7805 when 5 V is your target — it's simpler, well-characterized, and available everywhere. Both need heatsinking above 500 mA; for lower dropout, switch to an LDO like the AMS1117.
Exam tip: Examiners give you an LM317 circuit with R1=240 Ω and R2=720 Ω and ask for output voltage — apply Vout = 1.25×(1 + 720/240) = 1.25×4 = 5 V; also be ready to reverse-calculate R2 for a given target voltage.
Interview tip: Interviewers ask the difference in quiescent current path — for 7805, Iq flows to GND and is wasted; for LM317, Iq (50 µA) flows into the ADJ pin and through R1 into Vout, slightly adding to the load current calculation.