A voltage divider is two resistors in series that give you a fraction of the input voltage. It’s one of the most useful circuits around: you can use it to measure batteries, read resistive sensors and step 5 V signals down to 3.3 V.
In short
- Vout = Vin × R2 / (R1 + R2): the output depends only on the ratio between the resistors.
- It’s for measuring voltages, not for powering anything.
- Typical values: between 1 kΩ and 100 kΩ in total.
Calculator
- Vout
- —
- Current
- —
- Total power
- —
How it works
The two resistors are connected in series between the input voltage and ground. The output is taken at the point where they meet:
Vin ──[ R1 ]──┬──[ R2 ]── GND
│
Vout

The same current flows through both, so the voltage is split in proportion to their values. If R1 and R2 are equal, Vout is exactly half of Vin.
The formula
Vout = Vin × R2 / (R1 + R2)
And if you know the Vout you want and one of the resistors, you can solve for the other:
R1 = R2 × (Vin − Vout) / Vout
Practical uses
Measuring a battery with Arduino or ESP32
An ESP32’s ADC only accepts up to 3.3 V (and in practice it’s more accurate below ~2.5 V). To measure a 2-cell LiPo battery (up to 8.4 V) you need to bring the voltage down:
- R1 = 100 kΩ, R2 = 33 kΩ → Vout = 8.4 × 33 / 133 ≈ 2.08 V.
- Divider current draw: 8.4 / 133,000 ≈ 63 µA, acceptable in a battery-powered device.

In your code, multiply the reading by (R1 + R2) / R2 to get the real voltage back.
Stepping a 5 V signal down to 3.3 V
To connect the TX output of a 5 V module to the RX of an ESP32 or a Raspberry Pi:
- R1 = 1 kΩ, R2 = 2 kΩ → Vout = 5 × 2 / 3 ≈ 3.33 V.

It works for one-way signals that aren’t very fast. For bidirectional buses (like I2C), use a level shifter. We explain it in I2C, SPI and UART.
Reading a resistive sensor (LDR, thermistor)
If you replace R2 with a sensor whose resistance changes (an LDR with light or an NTC with temperature), Vout varies with the quantity you want to measure. You read it with an analog input.
How to choose the values
| Total R1 + R2 | Advantage | Drawback |
|---|---|---|
| Under 1 kΩ | Very stable | Draws a lot of current and heats up |
| 10 kΩ – 100 kΩ | Good balance | — |
| Over 1 MΩ | Minimal current draw | The ADC input or the load skews the reading |
A handy rule: the impedance of whatever you connect to Vout has to be at least 10 times higher than R2, or the output will drop.
Why it can’t power anything
A very common mistake is using a divider to get 3.3 V from 5 V and powering a module with it. As soon as the module draws current, it acts like a resistor in parallel with R2 and Vout drops. On top of that, the voltage will change depending on how much the module draws at any given moment. To power something, use a regulator (LDO or DC-DC converter).
Common mistakes
- Swapping R1 and R2: R1 is the top one (toward Vin) and R2 the bottom one (toward GND).
- Forgetting the headroom: if the battery can go above its nominal voltage (a charged LiPo gives 4.2 V per cell), calculate with the maximum voltage.
- Tolerances: with 5% resistors, the result can be off by several percent. Use 1% resistors or calibrate in code.
- Divider always connected: in battery-powered devices, the divider draws current even when you’re not measuring. Use high values or a transistor to disconnect it.



