If the LEDs sit at the datasheet's maximum Vf (2.3 V), the current drops to 16.9 mA.
An LED drops a roughly fixed voltage (its forward voltage, Vf) and lets through as much current as the circuit allows, so it needs something to set the current. A series resistor takes whatever voltage the LEDs don't, and Ohm's law gives its value:
R = (Vs − n × Vf) / I
Vs is the supply, n the number of LEDs in series, Vf the forward voltage of one LED and I the current you want. The resistor's power is P = I² × R; buy one rated for at least twice that.
Round up to the next standard value, never down. A bigger resistor means a little less current and a little less light, which you won't see. A smaller one pushes the LED past the current you picked.
On the current: 20 mA is the classic figure because that's where 5 mm LEDs are specified, but modern LEDs are bright enough as indicators at 2 to 10 mA. Less current means less heat, longer life and a resistor nobody has to think about.
A red LED (1.9 V) at 20 mA from USB: (5 − 1.9) / 0.02 = 155 Ω. The next E24 value up is 160 Ω, giving 19.4 mA and 60 mW in the resistor, so a 1/8 W (0805) part is fine.
One white LED (3.3 V) at 20 mA: (12 − 3.3) / 0.02 = 435 Ω, so 470 Ω, 18.5 mA and 161 mW burnt in the resistor (buy 1/2 W). Three in series instead: (12 − 9.9) / 0.02 = 105 Ω, so 110 Ω and only 40 mW, for three times the light.
The 220 Ω in every starter kit gives (5 − 1.9) / 220 = 14 mA with a red LED on a 5 V Uno pin. The ATmega328P's absolute maximum is 40 mA per pin (datasheet, Absolute Maximum Ratings), so 220 Ω to 1 kΩ is a safe range. On a 3.3 V board like an ESP32 or a Pico, a red LED with 150 Ω to 330 Ω works (4 to 9 mA, inside the 12 mA a Pico pin is specified for in the RP2040 datasheet); blue and white LEDs need about 3.3 V themselves and stay dim or dark, so power them from 5 V through a transistor.
| Colour | Typical Vf | Max Vf | Measured at | Max current | Part |
|---|---|---|---|---|---|
| Red | 1.9 V | 2.3 V | 10 mA | 30 mA | WP7113ID (GaAsP/GaP) |
| Super bright red | 1.85 V | 2.5 V | 20 mA | 30 mA | WP7113SRD/D (GaAlAs) |
| Orange | 1.95 V | 2.3 V | 10 mA | 25 mA | WP7113ND (GaAsP/GaP) |
| Yellow | 1.95 V | 2.4 V | 10 mA | 30 mA | WP7113YD (GaAsP/GaP) |
| Green (yellow-green) | 2 V | 2.4 V | 10 mA | 25 mA | WP7113GD (GaP) |
| True green | 3.2 V | 4 V | 20 mA | 30 mA | WP7113ZGC/G (InGaN) |
| Blue | 3.3 V | 4 V | 20 mA | 30 mA | WP7113QBC/D (InGaN) |
| White | 3.3 V | 4 V | 20 mA | 30 mA | WP7113QWC/D (InGaN) |
Source: Kingbright WP7113 series datasheets (5 mm round through-hole LEDs), electrical and absolute maximum ratings at 25 °C, forward voltage tolerance ±0.1 V. Red, orange, yellow and yellow-green are older GaAsP, GaAlAs and GaP chips at about 2 V; blue, white and true green are InGaN at 3 to 4 V. Other makers and SMD packages are close but not identical, so use your own LED's datasheet when you have it.
LEDs in series share one current, so one resistor per string is enough. LEDs in parallel do not share nicely: the one with the lowest Vf takes most of the current, runs hotter, its Vf drops further and it takes even more. With one resistor per string each string's current is set on its own. That's why this calculator gives a resistor per string and multiplies by the number of strings for the totals.
Putting several LEDs in series is also more efficient: less of the supply is burnt in the resistor. Leave at least a volt or two across the resistor, though, or small differences in Vf swing the current a lot.
GrandpaCAD's chat picks real parts, draws the schematic, routes the PCB and checks it against JLCPCB's rules. You get Gerbers, BOM, pick-and-place, a KiCad project and a 3D board, plus a printed case if you want one.
"USB-powered board with 3 LEDs and the right resistors"