The LED resistor formula
The resistor drops whatever voltage the LEDs don’t use, at the current you want:
R = (supply voltage − LED voltage × number of LEDs) ÷ current P = current² × R
A 5 V supply and a red LED at 20 mA: (5 − 2) ÷ 0.020 = 150 Ω, dissipating 60 mW, so a 1/4 W resistor is plenty.
Forward voltage by color
Red, orange and yellow LEDs drop about 1.8–2.2 V; blue, white and bright green about 3.0–3.4 V. The datasheet value at your current is best — it changes with current and temperature.
Resistor wattage
The calculator picks a rating at least twice the power the resistor dissipates, so it runs cool. If the answer is more than about half a watt, consider more LEDs in series, a lower supply voltage or a constant-current driver — the resistor is wasting most of the energy as heat.