Shaft and Key Sizing Calculator
Minimum shaft diameter from torque and bending, the next standard size, the standard parallel key and the key length needed for shear and bearing.
How it works
A shaft that carries torque T and a bending moment M at a section is loaded in torsion and bending together. For a solid round shaft the static design uses the maximum-shear (torsion alone) or the von Mises (combined) criterion with a safety factor n on yield.
d = [ 32 n ÷ (π Sy) × √(M² + ¾ T²) ]1/3, torsion only: d = [ 16 n T ÷ (π × ½ Sy) ]1/3
The torque comes from T = P ÷ ω with ω = 2π n ÷ 60. The calculator then rounds up to a standard shaft diameter and chooses the standard parallel key (ISO 773 / DIN 6885) for that diameter. The key carries a force F = 2 T ÷ d, and its length must be enough for both shear (L ≥ 2 T ÷ (d b τ)) and bearing on the side of the keyway (L ≥ 4 T ÷ (d h σ)), with τ = 0.577 Syk ÷ n and σ = Syk ÷ n. Gearing, belts and bearings are in Gears and Power Transmission.
Worked example
A 15 kW motor at 1 450 rpm drives a shaft of steel with Sy = 350 MPa through a pulley that adds a bending moment of 100 N·m; safety factor 2; key steel Syk = 300 MPa.
- ω = 2π × 1 450 ÷ 60 = 151.84 rad/s, so T = 15 000 ÷ 151.84 = 98.8 N·m.
- Torsion only: d = (16 × 2 × 98.8 ÷ (π × 175×10⁶))1/3 = 17.9 mm.
- With bending: √(100² + 0.75 × 98.8²) = 131.6 N·m, so d = 19.7 mm; the next standard size is 20 mm.
- The standard key for a 20 mm shaft is 6 × 6 mm. In shear: L = 2 × 98.8 ÷ (0.020 × 0.006 × 86.6×10⁶) = 19.0 mm; in bearing: L = 4 × 98.8 ÷ (0.020 × 0.006 × 150×10⁶) = 22.0 mm. Use a key at least 22 mm long (usually a standard length of 14 to 20 mm, and not less than the hub allows).
- The shaft twists 4.54° per meter at this torque.
Things to know
This is a static check only. A rotating shaft carrying bending moment sees fully reversed stress at every point on its surface: its size is usually governed by fatigue (endurance limit, surface finish, size and stress concentration at keyways, shoulders and grooves), which gives larger diameters.
The keyway reduces the shaft strength and creates a stress concentration (Kt of 2 or more). Use a key sized by the standard, a fillet radius in the keyway and, for heavy duty, splines or a shrink fit.
Check the critical speed and the stiffness: bending deflection under the gear loads and the slope at the bearings often govern the diameter before strength does.
The standard key sizes are metric (ISO 773). In the US, the equivalent square and rectangular keys are given in ASME B17.1.
For hollow shafts or shafts with steps, use the section modulus at the critical section.
Common questions
How do I find the torque from power and speed?
T (N·m) = 9 549 × P (kW) ÷ n (rpm). For horsepower: T (lbf·ft) = 5 252 × P (hp) ÷ n (rpm).
How long should a key be?
At least 1 to 1.5 times the shaft diameter for a steel hub, and long enough for the shear and bearing checks. Use a standard length and make it a little shorter than the hub.
What safety factor should I use?
For steady loads of known size, 1.5 to 2.5 on yield. For shock, unknown loads or fatigue, use 3 or more together with a fatigue analysis.
Sources
- Budynas, R. G. and Nisbett, J. K., Shigley’s Mechanical Engineering Design, McGraw-Hill, Chapters 7 (shafts) and 9; ISO 773 (parallel keys); DIN 6885.
- Machinery’s Handbook, Industrial Press (shaft diameters, keys and keyways); ASME B106.1M.
Last reviewed: November 2, 2026
