ForHosting KIT · Engineering & construction

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
Use it from WebAPIEmailTelegramApp soon
If you enter
Input voltage Vin (V)
12
Upper resistor R1 (Ω)
1,000
Lower resistor R2 (Ω)
1,000
You get
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.

Engineering quick checks

Validate a formula result without a spreadsheet.

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.

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.

POSThttps://api.kit.forhosting.com/dev/voltage-divider

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.

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}'
{
  "vin": 12,
  "r1": 1000,
  "r2": 1000
}
{
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

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.

Homework and teaching

Check classic examples with stable golden fixtures.

Automation

Same pure function in the free widget and the API.

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.

Read the full KIT documentation →