Keys and keyways serve as fundamental mechanical mechanisms for transmitting torque between rotating shafts and power transmission components, such as metric spur, helical, or bevel gears. The structural integrity and kinetic reliability of a shaft-hub assembly depend heavily on the geometric dimensioning and tolerancing (GD&T) of the mating components. When detailing the proper key and keyway size for the application, consideration must be given to the dimensional constraints, boundary tolerances, and mechanical fit classifications governing standard metric keyways. The two most common standards are Js9 and P9 classifications.
A common adage says that a square peg cannot fit into a round hole. From an analytical perspective, this statement is mechanically incomplete without specifying the precise spatial constraints, nominal dimensions, and boundary tolerances of the mating geometries.
Consider a square prism with a nominal cross-section of 25 X 25 millimeters that has an upper limit tolerance of h11 (which would range from 25.000 to 24.870 or, for precision fit, a tolerance of 0 to -0.010).
If this prism is paired with a cylindrical bore featuring a nominal diameter of 25 and a lower limit tolerance of +0.010 to 0 millimeter, then the square component can achieve a sliding clearance fit. The four sharp corners of the square key will intersect the boundary of the cylindrical bore and allow the key to be inserted. Thus, a square peg could fit in a round hole.
The metric standards ISO 773 and DIN 6885-1 detail the selection of the key based on the nominal diameter of the mating shaft (d). This shaft diameter dictates the nominal width (b) and height (h) of the keyway cross-section to optimize shear and compressive strength. Table 1 details some common shaft diameters and their associated key sizes. When designing a hub-shaft interface with parallel keys, the engineer must specify the width tolerance zone of the keyway slot.
The two most prominent standard selections within the metric system use different fundamental deviations to achieve distinct mechanical behaviors.

The more common tolerance is the Normal or Free Fit tolerance. This is designated as a Js9 fit. This tolerance class provides a symmetrical distribution relative to the nominal value. The tolerance band is split equally between a plus (+) and minus (-) deviation. It yields a transitional fit transitioning slightly between a minimal clearance and a minor interference. This allows for manual insertion of the parallel key into the slot. Using this tolerance, gears can be axially positioned and adjusted along the shaft during assembly or field maintenance without requiring hydraulic press equipment.
This tolerance is common for most industrial gear drives operating under uniform, continuous unidirectional loads where periodic disassembly is required.
The other common tolerance is the Interference or Press Fit tolerance. This is designated as a P9 fit. This tolerance class specifies a strict negative deviation, placing the entire tolerance zone below the nominal value.
This forces a definitive interference fit or press fit between the key flanks and the keyway walls. Once the key is assembled into the keyway slot, micro-frictional engagement prevents any relative macro-movement or migration. Typical applications for this fit are heavy-duty applications characterized by reversing loads, shock loading, high cyclic start-stop intervals, or precision positioning where rotational backlash must be eliminated.
When machining a keyway into a gear, you must evaluate the structural integrity of the remaining material. Since cutting a keyway introduces severe geometric discontinuity, you must consider the localized stress concentration factors that can reduce the fatigue life of the shaft and hub.
The minimum rim thickness (SR) under the root diameter of the gear tooth must satisfy (Equation 1):

Where m represents the gear module. When a keyway is introduced into the bore, the effective section modulus is reduced. The remaining structural wall thickness between the top of the hub keyway (t2) and the root cylinder of the gear teeth must be cross-referenced against the maximum torsional shear stress (τ max) per the following formula (Equation 2):

Where:
- T is the transmitted operational torque (Nm)
- r is the radial distance from the shaft centerline to the critical stress point (m)
- J is the polar moment of inertia of the net cross-section (m4)
Failure to maintain adequate radial rim thickness over the keyway geometry will result in plastic deformation, crack propagation along the keyway corners, and ultimate catastrophic structural splitting of the gear blank.
With these considerations you can design a gear shaft connection that suits both your application and the design needs in order to exceed your life parameters for the drive.




















