Voltage divider calculator
12 V across two 1000-ohm resistors gives 6 V at the midpoint, a ratio of 0.5 and an attenuation of −6.0205999133 dB: enter the input voltage, R₁ and R₂ to get the same three answers for your own circuit. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Input voltage Vin (V)
- 12
- Upper resistor R1 (Ω)
- 1,000
- Lower resistor R2 (Ω)
- 1,000
- Output voltage Vout (V)
- 6
- Voltage-divider ratio
- 0.5
- Attenuation (dB)
- -6.0205999133
free in your browser
How a voltage divider works
A voltage divider is two resistors in series between an input voltage and ground, and it produces a lower voltage at the point where they meet. R₁ is the upper resistor, from the input to that output point, and R₂ is the lower one, from the output point to ground. The output is the share of the input that falls across R₂: the ratio is R₂ divided by the sum of R₁ and R₂, and the output voltage is the input times that ratio. With 12 V across two 1000-ohm resistors, the ratio is 0.5 and the output is 6 V. The calculator also gives that ratio as attenuation in decibels, which is −6.0205999133 dB for a halving.
When to use it and the usual mistakes
It is made for quick engineering checks and for homework and teaching, when you want to confirm a formula result without building a spreadsheet. The most common mistake is swapping R₁ and R₂, because the result only stays the same when both resistors are equal. Another is mixing units, such as one value in ohms and the other in kilohms; the ratio is only right when both are entered in the same unit. Wrong types, zero or negative values where they make no sense, and results that would overflow are rejected with a clear message instead of a meaningless number, so a typo cannot slip into your notes unnoticed.
What you can do with it
Engineering quick checks
Validate a formula result without a spreadsheet.
FAQ
Is it free?
Yes. Tier A runs in your browser without an account.
Rounding?
Half-away-from-zero to 10 decimal places on numeric outputs.
How do I calculate the output voltage of a voltage divider?
Multiply the input voltage by R₂ divided by the sum of R₁ and R₂. With 12 V and two resistors of 1000 ohms each, the ratio is 0.5 and the output is 6 V.
Which resistor is R₁ and which is R₂?
R₁ is the upper resistor, between the input and the output point, and R₂ is the lower one, from the output point to ground. Swapping them changes the result unless both have the same value.
What does the attenuation in decibels tell me?
It expresses the ratio on a logarithmic scale: twenty times the base-ten logarithm of the ratio. Halving the voltage, as in the example, gives −6.0205999133 dB, and a smaller ratio gives a more negative figure.
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/dev/voltage-divider \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"vin":12,"r1":1000,"r2":1000}'const res = await fetch("https://api.kit.forhosting.com/dev/voltage-divider", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"vin": 12,
"r1": 1000,
"r2": 1000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/voltage-divider",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"vin": 12,
"r1": 1000,
"r2": 1000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/voltage-divider", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"vin":12,"r1":1000,"r2":1000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"vin":12,"r1":1000,"r2":1000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/voltage-divider", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"vin": 12,
"r1": 1000,
"r2": 1000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.voltage_divider",
"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
How it works
Inputs are validated before arithmetic. The calculation is fully deterministic and runs free in your browser with the same pure function as the API path. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results.
Inputs and outputs
Required fields must be present and correctly typed. Optional fields use documented defaults. Success payloads always include the primary output fields for stable UI binding. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results.
Edge cases and limits
Wrong types, zero or negative values where forbidden, and overflow to non-finite results become clear invalid_input errors instead of silent null or NaN fields. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results.
Integration use cases
Homework and teaching
Check classic examples with stable golden fixtures.
Automation
Same pure function in the free widget and the API.
Technical questions
Does it call the network?
No. Pure parse on-device.
What if input is invalid?
invalid_input with a clear stable match string.
Author?
samurai.