A keyway is a slot cut along the length of a shaft that holds a small metal piece called a key, which locks a rotating component (like a gear or pulley) to the shaft so they spin together. Without a keyway, a gear mounted on a shaft could simply spin freely instead of transferring power. The keyway, the key, and a matching slot in the hub of the attached component form what’s called a keyed joint, and it’s one of the most common ways to transmit torque in mechanical systems.
How a Keyed Joint Works
A keyed joint has three parts: the keyway in the shaft, a matching slot (called a keyseat) in the hub of whatever component you’re attaching, and the key itself, which is a small rectangular or semicircular piece of steel that sits in both slots simultaneously. The key bridges the gap between the shaft and the hub, physically preventing them from rotating independently. When the shaft turns, the key pushes against the wall of the hub’s slot, forcing the hub to turn with it.
This arrangement also makes assembly and disassembly straightforward. You can slide the component onto the shaft, drop the key into place, and secure it. When maintenance is needed, you pull the key out and slide the component off. That simplicity is a major reason keyed joints remain so widely used in industrial machinery, vehicles, and power transmission equipment.
Common Types of Keys
Three main key types show up in most mechanical applications, and each one requires a slightly different keyway shape cut into the shaft.
- Parallel keys are rectangular bars with rounded ends that sit in a milled slot running along the shaft. The key is the same width from end to end, with no taper. These are common on automotive axle shafts and anywhere a hub is mounted on a tapered shaft section, since the key simply slides into the slot during assembly.
- Taper keys (gib keys) are wedge-shaped, thicker at one end than the other. They’re driven into the keyway with a hammer or press, and the taper creates a tight friction fit that locks everything in place. A small head on one end makes extraction easier. You’ll find these on industrial and agricultural machinery where a secure, vibration-resistant connection matters.
- Woodruff keys are semicircular, shaped like a half-moon. The shaft gets a curved pocket milled into it (rather than a long slot), and the key nestles into that recess with its flat top sticking up into the hub’s slot. Because of their shape, Woodruff keys can tilt slightly to match the angle of a tapered hub, which makes them popular for gears, sprockets, and pulleys on cars and motorcycles. They also reduce stress concentration near shaft shoulders because the curved pocket doesn’t require milling a long slot close to a diameter change.
Standard Keyway Dimensions
Keyway sizes aren’t arbitrary. In the United States, ANSI B17.1 specifies exactly how wide and deep a keyway should be based on the shaft diameter. The key width scales up with shaft size in a predictable pattern:
- A 1/2-inch shaft uses a 1/8-inch wide key
- A 3/4-inch shaft uses a 3/16-inch wide key
- A 1-inch shaft uses a 1/4-inch wide key
- A 1-1/2-inch shaft uses a 3/8-inch wide key
- A 2-inch shaft uses a 1/2-inch wide key
- A 3-inch shaft uses a 3/4-inch wide key
These dimensions are tightly toleranced, often to within a few thousandths of an inch. A keyway that’s too loose allows the key to rattle and wear, while one that’s too tight can crack the shaft during assembly. Bore and keyway tolerances follow either a clearance fit (where a small gap allows easy sliding) or an interference fit (where the key is slightly larger than the slot and must be pressed in). Clearance fits are typical for components that need regular removal, while interference fits suit permanent or high-load connections.
How Keyways Are Cut
The method used to cut a keyway depends on whether you’re working on the outside of a shaft or the inside of a hub. For shafts, the keyway is almost always milled. An end mill or a specialized keyseat cutter runs along the shaft’s surface, carving out the slot to the correct width and depth. This can be done on a manual milling machine or a CNC.
For internal keyways inside a hub or bore, broaching is the standard method. A broach is a long, toothed cutting tool that gets pushed or pulled through the bore in a single pass, shaving out the slot progressively. Each tooth on the broach is slightly larger than the one before it, so the slot reaches full depth by the time the tool exits. Broaching produces a very clean, accurate keyway and is fast enough for production work.
Why Keyways Fail
Cutting a keyway into a shaft removes material and creates sharp corners at the bottom of the slot, both of which concentrate stress. Every time the shaft rotates under load, bending and torsional forces pile up at those corners. Over thousands or millions of cycles, this can initiate a fatigue crack that gradually spreads until the shaft breaks.
Stress concentration at keyway edges is the root cause of many documented shaft failures. One analysis of an elevator drive shaft that had been in service for 30 years found that torsional and bending fatigue stresses concentrated at the keyway edges caused the eventual fracture. In another case, a decoiler machine shaft failed because the keyway’s stress concentration combined with a nearby diameter transition, pushing localized stresses beyond the material’s fatigue limit.
Beyond fatigue cracking, keys can also fail by shearing (the key itself gets cut in half by opposing forces from the shaft and hub) or by crushing (the contact surfaces between the key and the keyway walls get deformed from excessive pressure). Properly sizing the key to the shaft diameter, keeping keyway corners radiused rather than perfectly sharp, and avoiding unnecessarily deep slots all help prevent these failures.
Keyways vs. Splines and Other Alternatives
Keyed joints aren’t the only way to lock a component to a shaft. Splined shafts have a series of ridges (splines) running along their length that mesh with matching grooves inside the hub. Because splines distribute the load across many teeth rather than concentrating it on a single key, they handle significantly higher torque and distribute forces more evenly. Splines also tolerate slight misalignment better than keyed connections.
The tradeoff is complexity and cost. Keyed shafts are simpler to design, cheaper to manufacture, and easier to service in the field. If a key wears out, you replace a small steel piece rather than the entire shaft. For precision machinery and moderate-torque applications like conveyors, pumps, fans, and machine tool spindles, a keyed joint is often the most practical choice. Splines earn their place in high-torque, high-speed situations like automotive transmissions, aerospace drives, and heavy equipment where the extra manufacturing cost is justified by performance demands.
Shrink fits and press fits are another alternative, where the hub is heated (or the shaft cooled) so the hub slides on, then grips the shaft tightly as temperatures equalize. These eliminate the stress concentration of a keyway entirely, but they make disassembly difficult and don’t work well when components need regular removal for maintenance.

