Key and Keyway — Definition & Formula Links

The square or rectangular bar and matching slots that lock a hub to a shaft, sized from shaft diameter per ASME B17.1 and checked in shear and bearing.


Updated August 22, 2026

A key is the small bar that transmits torque between a shaft and the hub mounted on it, seated half in a keyseat milled into the shaft and half standing proud into the keyway of the hub. ASME B17.1 schedules the cross-section directly from shaft diameter — a 1-inch shaft takes a 1/4 × 1/4 square key with a 1/8 in deep keyseat, a 1-1/2 inch shaft a 3/8 × 3/8 key — with square keys preferred through 6-1/2 inch shafts, a shorter rectangular alternative listed for most bands, and the nominal keyseat depth always half the key height.

Strength comes down to two classical failure modes on the tangential force F = 2T/d. Shear cuts across the key’s width: τ = 2T/(d·w·L), checked against the distortion-energy allowable 0.577·Sy/nd. Bearing crushes the half-height flank: σ = 4T/(d·h·L) against Sy/nd — the factor 4 appears because only h/2 of the key bears in each member, and bearing is what usually governs. Design factors of 2 to 3 against yield are common because keys see impact and reversal, and practice keeps key length between about 1 and 1.5 shaft diameters.

Two judgment calls ride along. The key should be slightly weaker than shaft and hub so the cheap, replaceable part is the mechanical fuse that fails first. And the keyseat itself weakens the shaft — a stress-concentration factor near 2 at the end-milled runout is typical — which is why shaft design at a keyed section carries fatigue stress-concentration factors of its own.

Try the Calculators

Sources & Further Reading

  • ASME B17.1-1967 (R2013), Keys and Keyseats — Table 1 key size versus shaft diameter (keyseat depth = H/2; square keys preferred over 5/16 through 6-1/2 in)
  • Shigley’s Mechanical Engineering Design, 11th ed. — keys and pins: shear and bearing failure checks with the 0.577·Sy distortion-energy shear allowable