In mechanical engineering, a key is a machine element used to connect a rotating machine element to a shaft. The key prevents relative rotation between the two parts and may enable torque transmission. For a key to function, the shaft and rotating machine element must have a keyway and a keyseat, which is a slot and pocket in which the key fits. The whole system is called a keyed joint. A keyed joint may allow relative axial movement between the parts.
Commonly keyed components include gears, pulleys, couplings, and washers.
There are three main types of keys: Sunk, Saddle, and Tangent, Round, and Spline keys.
Types of sunk keys: Rectangular, Square, Parallel sunk, Gib-head, Feather, and Woodruff.
Parallel keys are the most widely used. They have a square or rectangular cross-section. Square keys are used for smaller shafts and rectangular faced keys are used for shaft diameters over 6.5 in (170 mm) or when the wall thickness of the mating hub is an issue. Set screws often accompany parallel keys to lock the mating parts into place. The keyway is a longitudinal slot in both the shaft and mating part.