Start here: what is this resistor for?
| Job | Typical value | Set by |
|---|---|---|
| *Limiting current (LED) | 220–330Ω | Ohm's law |
| *Pull-up / pull-down (button) | 10kΩ | Noise vs wasted current |
| *Driving a transistor base | 220Ω–1kΩ | Required base current |
| *Voltage divider | Ratio matters | The two values' proportion |
Pick the row, then read that section. Everything else is detail.
Job 1: limiting current
The classic LED case. One formula:
The resistor's job is to absorb the leftover voltage. A red LED on 5V drops about 2V and wants around 20mA, so the resistor drops the remaining 3V: 3 ÷ 0.02 = 150Ω.
In practice everyone uses 220Ω or 330Ω, which run the LED slightly dimmer and further from its limit. Full worked version here, including values for other LED colours.
Job 2: pull-up and pull-down
Here you're not solving an equation so much as picking a sensible middle.
- Too large (1MΩ): the pull is weak and electrical noise can overcome it. Unreliable readings.
- Too small (100Ω): works, but wastes current continuously whenever the button is held. Bad on battery.
10kΩ sits comfortably between and is right almost always. I2C is the exception — it wants lower, for reasons in the I2C guide. And on Arduino you can often skip the component entirely with INPUT_PULLUP.
Job 3: driving a transistor base
Work backwards from the current you need to switch:
- Load current ÷ a conservative gain figure = base current needed
- R = (pin voltage − 0.7V) ÷ base current
Switching 200mA with a conservative gain of 10 needs 20mA of base current, so (5 − 0.7) ÷ 0.02 = 215Ω — use 220Ω. The 0.7V is the base-emitter drop of a silicon transistor. The transistor datasheet guide covers where the gain figure comes from.
Job 4: voltage divider
Two resistors in series; you tap the voltage between them.
Only the ratio sets the output voltage, so 1kΩ+2kΩ and 10kΩ+20kΩ both turn 5V into 3.33V. The absolute size decides how much current the divider itself wastes, and how easily whatever you connect disturbs it.
Common use: dropping a 5V signal to something a 3.3V input can accept — but never on an I2C line. See the level-shifting guide.
Then round to a value that exists
Your calculation will give something like 215Ω, which nobody sells. Real resistors come in the E12 series:
10 12 15 18 22 27 33 39 47 56 68 82
...and those ×10, ×100, ×1k and so on. So 215Ω becomes 220Ω.
Which way to round? For current limiting, round up — more resistance means less current, which is the safe direction. For a pull-up, either way is fine.
Two things people forget
Power rating
Resistors turn the voltage they drop into heat. P = V × I. Most hobby resistors are quarter-watt, which is plenty for signal work — the LED example above dissipates 0.06W. But drop 10V at 100mA and that's 1W, which will cook a quarter-watt part.
Tolerance
A 5% resistor marked 220Ω might actually be 209Ω or 231Ω. Fine for LEDs and pull-ups. If your circuit needs better than that, buy 1% parts — and measure them.
The habit that beats all of this
Measure before you fit. Colour bands are genuinely hard to read under bench lighting, and red/orange/brown confusion has cost everyone an evening at some point. A multimeter takes two seconds and removes the doubt — see the bench guide.