A keyway is a slot cut into a shaft or hub that holds a small piece of metal called a key, locking the two parts together so they rotate as one unit. Without it, a gear or pulley mounted on a spinning shaft would simply slip in place, unable to transfer any power. Keyways are one of the oldest and most common methods for connecting rotating components in machinery, from electric motors to industrial pumps.
How a Keyway Transmits Torque
The basic setup involves three parts: a shaft, a hub (the hole in a gear, pulley, or coupling that slides onto the shaft), and a key. The shaft has a groove milled along its length, and the hub has a matching slot on its inside diameter. When the key is inserted into both grooves simultaneously, it bridges the gap between shaft and hub, creating a mechanical lock that forces them to spin together.
This arrangement transmits torque, the rotational force that makes machinery work. Every time an electric motor spins a pump impeller, a gearbox turns a conveyor belt, or an engine drives a transmission, there’s a good chance a key sitting in a keyway is doing the work of transferring that rotational energy from one component to another.
Technically, the groove in the shaft is called a keyseat and the groove in the hub is the keyway, though in everyday use most people call both slots “keyways” without confusion.
Common Types of Keys and Keyways
The shape of the key determines the shape of the keyway. The most widely used types fall into a few categories.
- Parallel (square or rectangular) keys are straight bars with a uniform cross-section. They’re the default choice for most general-purpose power transmission. The key sits flush or slightly proud in its groove and relies on a tight fit between the parallel sides to prevent movement. Square keys are used on smaller shafts; rectangular keys, which are wider than they are tall, handle heavier loads on larger shafts.
- Woodruff keys are semicircular, shaped like a half-moon. The curved bottom seats deep into a matching pocket in the shaft, which makes the key self-aligning and resistant to rolling out of its groove. Woodruff keys work well on tapered shafts and high-speed assemblies because they adjust naturally to slight misalignment between parts. They’re also designed to shear under excessive load, acting as a built-in safety fuse that breaks before more expensive components do.
- Taper keys have a slight wedge shape along their length. When driven into place, the taper creates a friction fit that locks the hub axially on the shaft, preventing it from sliding along the shaft’s length. This makes them useful where components need to stay fixed in position without additional fasteners.
- Gib-head keys are taper keys with a protruding head on one end, giving you something to grip or pry against during removal. They’re common in applications where the key needs to be installed and removed periodically for maintenance.
Where Keyways Are Used
Keyways show up in virtually any machine that has a rotating shaft connected to another component. Electric motors and generators are among the most common examples: every rotor shaft needs a keyway to lock it to its coupling and transmit torque to the driven equipment. Centrifugal pumps, fans, compressors, and conveyor drives all rely on keyed connections at multiple points in the drivetrain.
Beyond industrial equipment, keyways appear in automotive transmissions, power generation turbines, agricultural machinery, and even smaller tools like drill presses and lathes. The principle is always the same: wherever a shaft needs to drive a hub, a keyway is one of the simplest and most reliable ways to make that connection.
How Keyways Are Cut
Cutting a keyway requires removing a precise channel of material, and the method depends on whether the slot is on an external shaft or inside a hub.
For external shaft keyways, milling is the most popular method. A rotating cutter machines the groove along the shaft’s length, and the process handles straight, partial-length, and even tapered keyways easily. For internal hub keyways, broaching is the standard approach. A broaching tool with progressively larger teeth is pushed or pulled through the bore of the hub, cutting the keyway in just one to three strokes. The process is fast and highly repeatable, which makes it ideal for production runs.
Wire EDM (electrical discharge machining) fills a different niche. Instead of a physical cutting tool, a thin copper wire uses electrical sparks to vaporize material with extreme precision. Wire EDM is slower and more expensive per part, so it’s typically reserved for small batches, hardened materials, or situations where tolerances are especially tight.
Standardized Dimensions
Keyway dimensions aren’t left to guesswork. In the United States, ANSI B17.1 specifies the exact width, depth, and tolerances for square and rectangular keyways based on shaft diameter. A half-inch shaft, for example, calls for a key width of 1/8 inch, while a 1-inch shaft uses a 1/4-inch key. As shaft diameters grow, key sizes step up in defined increments, reaching 3/4 inch wide for shafts around 3 inches in diameter. The tolerances on these dimensions are tight, often within a few thousandths of an inch, because a sloppy fit leads to vibration, wear, and eventually failure.
Key stock, the raw bar material from which keys are cut, is manufactured to match these standards. It’s available in carbon steel for most applications and stainless steel where corrosion resistance matters. The key should generally be softer than both the shaft and the hub so that if something wears or fails, it’s the inexpensive key that gives way first.
Stress and Failure Concerns
Cutting a keyway into a shaft removes material and creates sharp corners, both of which concentrate stress. Under repeated loading, the corners and fillet regions of a keyway become the most likely points for fatigue cracks to start. These cracks can grow progressively over time until the shaft fails entirely.
This is a well-documented issue in engineering. The stress concentration effect of a keyway is both complex and significant: it amplifies both the twisting forces from torque transmission and the bending forces from the shaft’s own weight and load. In one documented case involving an industrial decoiler machine, the combination of bending stress with stress concentrations at the keyway and a nearby diameter change caused multiple fatigue cracks to initiate around the shaft, leading to complete failure.
Engineers manage this risk by specifying generous fillet radii at keyway corners, choosing appropriate shaft materials, and ensuring the shaft diameter provides enough remaining cross-section to handle the loads. Proper key fit also matters: a loose key will rock and hammer the keyway walls, accelerating wear.
Keyways vs. Splined Connections
A spline is essentially the same concept taken further. Instead of one or two keys, a splined shaft has multiple teeth machined directly into it that mesh with matching grooves in the hub. Because the teeth are integral to the shaft rather than inserted separately, and because there are typically four or more of them sharing the load, splines distribute torque more evenly and can handle higher loads than a single keyway.
Splined connections also produce more uniform stress on the hub, particularly when the teeth use an involute profile (the same curved shape found on gear teeth). The tradeoff is cost and complexity: splines require more precise machining on both the shaft and hub, making them more expensive to produce. For many applications, a simple keyway handles the job reliably at a fraction of the cost, which is why keyed connections remain so widespread despite the theoretical advantages of splines.

