LM317 calculator
With 240 Ω and 720 Ω, an LM317 delivers 5.036 V, a little over 5 V: enter the two programming resistors and get the output voltage the datasheet formula gives, adjust-pin current included. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- R1
- 240
- R2
- 720
- Vref
- 1.25
- Iadj
- 0.00005
- Ratio
- 3
- Output voltage
- 5.036
The LM317 is the classic three-terminal adjustable linear regulator: two resistors between OUT, ADJ, and ground program the DC voltage that appears at the output pin.
How two resistors set the LM317 output
The LM317 keeps a reference of about 1.25 V between its output pin and its adjust pin. The upper resistor sits across that reference, so a fixed current flows through it and continues down through the lower resistor to ground. The output therefore rises to the reference times one plus the ratio of the lower resistor to the upper one. On top of that, the adjust pin itself lets a small current out, and that current also passes through the lower resistor, so the real output ends up a little higher. In the textbook pair of 240 Ω and 720 Ω the ratio is 3, the reference is multiplied by four to reach 5 V, and the adjust current brings the result to 5.036 V, matching the datasheet example.
Common mistakes and what this does not cover
The most frequent slip is swapping the two resistors, which changes the result completely. The second is calculating the pair as a plain voltage divider and forgetting the adjust-pin current. Both resistors must be real, positive values: zero ohms would short the reference and is rejected. This calculation gives only the programmed output voltage. It does not size a heat sink, check whether the input leaves enough headroom above the output, or choose protection diodes, so check those separately before building or repairing a supply.
What you can do with it
BOM and repair reconstruction
Script the same formula used in the browser so a parts list or two surviving resistors recover the intended LM317 setpoint.
FAQ
What output voltage do 240 Ω and 720 Ω give on an LM317?
5.036 V. The 1.25 V reference is multiplied by one plus 720 divided by 240, which gives 5 V, and the small current leaving the adjust pin through the 720 Ω resistor adds the rest.
Where does each resistor go on an LM317?
The upper resistor sits between the output pin and the adjust pin, and 240 Ω is the usual datasheet value. The lower one runs from the adjust pin to ground. Swapping them gives a very different voltage, so check the schematic first.
Why is the LM317 output slightly higher than the simple formula?
Because a small current flows out of the adjust pin and through the lower resistor, adding a little voltage on top of the reference times the resistor ratio. Treating the pair as a plain voltage divider ignores it and reads slightly low.
Can I recover the intended voltage of a board I am repairing?
Yes, if the two programming resistors survived. Read their values, enter them, and you get the setpoint the designer chose, which helps you confirm a replacement regulator before powering the rest of the circuit.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/elec/lm317 \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"r1":240,"r2":720}'const res = await fetch("https://api.kit.forhosting.com/elec/lm317", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"r1": 240,
"r2": 720
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/lm317",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"r1": 240,
"r2": 720
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/lm317", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"r1":240,"r2":720}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"r1":240,"r2":720}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/lm317", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"r1": 240,
"r2": 720
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.lm317",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Zero, negative, missing, or non-numeric resistors fail with invalid_input and are not billed.
How the LM317 sets Vout from R1 and R2
The LM317 three-terminal adjustable regulator holds a typical 1.25 volt reference between its output pin and its adjust pin, then programs a higher output with the resistor divider hanging off ADJ. Both resistances must be finite and strictly positive in ohms—zero ohms would divide by zero or short the reference, and negative ohms are not a physical resistor. A textbook pair of 240 ohms and 720 ohms therefore produces a little over five volts once the Iadj term is included, matching the datasheet example rather than a passive divider that ignores the servo. Identical JSON always yields identical JSON because the path is pure floating-point arithmetic with no network, no random seed, and no wall clock.
Input contract, response shape, and error behaviour
Wire the free browser form for breadboard work and lab checks, then call the identical contract from scripts when a parts configurator or homework oracle needs a stable voltage from two stocked resistors. Missing fields, empty strings, non-numeric values, NaN, Infinity, zero, and negative ohms all fail with invalid_input naming the offending field, and those failures are not charged. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance. This product does not size heat sinks, drop-out headroom, or protection diodes; pair it with a linear dissipation calculator when the next question is package watts rather than setpoint volts.
Where an LM317 voltage calculator earns its keep
Repair technicians reconstructing a scorched adjustable stage often only know the two colour-coded resistors still standing on the board; feeding those ohms into a trusted LM317 calculator recovers the intended rail before they restuff another regulator. Keep linear-regulator dissipation, passive voltage-divider, and LED series-resistor landings separate so each search intent has one clear page rather than a overloaded multi-topology tool that confuses both students and search engines. Firmware and hardware bring-up teams pick two E12 or E24 parts from the drawer, need the actual servo voltage including Iadj rather than a rounded 1.25 times one plus ratio, and want that number in JSON they can pin in a design-review table. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
Breadboard 5 V and 12 V rails
Enter R1 and R2 from the LM317 divider to get the regulated voltage, including the small Iadj term, before wiring a wall-wart to a logic or analog rail.
Lab homework and datasheet checks
Let students verify Vout = Vref(1+R2/R1)+Iadj·R2 against textbook LM317 examples with deterministic golden answers.
Technical questions
How is LM317 output voltage calculated from R1 and R2?
Send positive R1 (OUT to ADJ) and R2 (ADJ to ground) in ohms. The API returns Vout = 1.25·(1 + R2/R1) + 50 µA·R2, the typical datasheet identity, plus the ratio and the constants used.
Which resistor is R1 and which is R2 on an LM317?
R1 is the resistor between the OUT pin and the ADJ pin (often 240 Ω). R2 is the resistor from ADJ to ground; increasing R2 raises the regulated output.
Why must R1 and R2 be positive numbers?
A zero or negative resistance is not a physical programming resistor and would divide by zero or invert the servo. The task fails with invalid_input and is not billed.
Does this LM317 calculator include Iadj?
Yes. The typical 50 µA adjust-pin current is included as Iadj·R2. Vref (1.25 V) and Iadj are returned in the JSON so you can see the model, not guess it.
What does the LM317 calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.