# LM317 Calculator (Voltage Source)

This calculator can be used to calculate LM317 resistor values from a needed output voltage or output voltage from given resistor values.

LM317 is a linear adjustable voltage regulator. It allows you to get lower output voltage from a higher input voltage.

Also, check out my newest calculator: Resistor Color Code – Value Calculator

## How does the LM317 calculator work?

After typing in any two values of the three and pressing ‘Calculate’, the calculator will output the third value. If all three values are filled in – the calculator by default will calculate output voltage.

The calculator does additional checks on possible values. LM317, according to its datasheet, can output voltages from 1.25 to 37 Volts. Also, the calculator will calculate resistor heat output. If a resistor dissipates up to 0.4W of heat – it is a usable value. If it dissipates from 0.4 to 0.9W of heat – the text will be shown as a warning (yellow), because such heat output is high for such application. When a resistor dissipates more than 0.9W of heat – the text will be shown as an error (red), as the resistor will dissipate lots of heat.

Furthermore, resistor values should be positive values (R2 can be 0) in increments of 0.001. Note, that there is a small current flowing through Adjust pin. Because it is negligible, it was not used in any calculations shown at the end of this page.

Also, a good practice to choose R1 value between 100 and 1000 Ω (usually 240 Ω) . Input voltage needs to be at least 2V higher than output voltage to get good output regulation.

## Calculations

Theese are the formulas used for an output voltage, R1 and R2 calculation:

Vout = 1.25*(1 + R2/R1)

R1 = R2 / (Vout/1.25 – 1)

R2 = (Vout/1.25 – 1)*R1

Resistor heat output is calculated with a formula:

P(R1) = 1.25*1.25/R1

P(R2) = (Vout – 1.25)*(Vout – 1.25)/R2