Keyway Calculator
This keyway calculator finds the stresses in a parallel key that transmits torque between a shaft and a hub. A key sits in matching slots, the keyways, cut into the shaft and the mating part, and it carries the turning load through two simultaneous mechanisms: shear across the key and bearing on its sides. The torque first becomes a tangential force at the shaft surface, equal to the torque divided by the shaft radius. That force acts over the key's shear area, its width times its length, to give the shear stress, and over the bearing area, half its height times its length, to give the compressive bearing stress. These checks are the standard machine-design procedure used throughout mechanical and automotive engineering, including the drivetrain analysis behind vehicle safety work at the US National Highway Traffic Safety Administration. Enter the transmitted torque, the shaft radius, and the key width, height and length, and the calculator returns the tangential force, the shear stress and the bearing stress. Every figure is computed deterministically from the force and stress formulas shown in full below, with a worked example that reconciles exactly to the calculator so you can follow each step.
Torque becomes a tangential force that the key resists in shear and bearing: 200,000 N.mm over a 20 mm radius gives a 10,000 N force, a shear stress of 20.83 MPa on a 12 by 40 mm key and a bearing stress of 62.50 MPa.
Keyway stress formulas
F = T / r (tangential force at the shaft surface)
shear stress = F / ( w x L )
bearing stress = F / ( (h / 2) x L )
T = torque, r = shaft radius, w = key width, h = key height, L = key length
The torque produces a force at the shaft surface equal to torque divided by radius. The key resists that force in two ways at once: shearing across its width and length, and bearing on the half of its height that presses against the keyway wall. Both stresses must stay below the allowable values for the key material.
Worked example
A key transmits 200,000 N.mm on a 20 mm radius shaft, with width 12 mm, height 8 mm and length 40 mm.
- tangential force F = T / r = 200,000 / 20 = 10,000 N
- shear area = w x L = 12 x 40 = 480 square mm
- shear stress = 10,000 / 480 = 20.83 MPa
- bearing area = (h / 2) x L = 4 x 40 = 160 square mm; bearing stress = 10,000 / 160 = 62.50 MPa
The tangential force is 10,000 N, the shear stress is 20.83 MPa and the bearing stress is 62.50 MPa. These are the calculator's default inputs, so the result above matches the widget exactly.
Effect of key length on stress
A longer key spreads the same force over more area, lowering both stresses.
| Length (mm) | Shear (MPa) | Bearing (MPa) |
|---|---|---|
| 30 | 27.78 | 83.33 |
| 40 | 20.83 | 62.50 |
| 50 | 16.67 | 50.00 |
| 60 | 13.89 | 41.67 |
Drivetrain and transportation safety context: US National Highway Traffic Safety Administration (NHTSA).
Keyway Calculator: frequently asked questions
Why are there two stresses to check?
A key can fail in two distinct ways. It can shear across the plane between the shaft and hub, governed by the shear stress over the width-by-length area, or its side can crush, governed by the bearing stress over the half-height-by-length area. Both must be kept below the allowable values, and either can govern depending on the key proportions.
Why half the key height for bearing?
Only about half of the key's height presses against the keyway wall on the loaded side; the other half sits in the shaft slot. So the bearing area that resists the tangential force is the half-height times the length. This is the standard assumption for a parallel square or rectangular key.
What units does the tool use?
It uses SI machine-design units: torque in newton-millimeters, lengths in millimeters, force in newtons and stress in megapascals (newtons per square millimeter). Keep torque in N.mm; if you have N.m, multiply by 1,000 first. The stresses then come out directly in MPa.
How do I get the tangential force?
The torque is the tangential force times the shaft radius, so the force at the shaft surface is the torque divided by the radius. That force is what the key actually carries. A larger shaft radius lowers the force for the same torque, which is one reason bigger shafts ease key stresses.
What allowable stress should the key meet?
Compare the shear stress against the allowable shear of the key material, often taken as a fraction of its yield strength, and the bearing stress against the allowable bearing of the weaker of the key, shaft or hub. Designers apply a factor of safety, so the computed stresses should sit comfortably below the material limits.
Official sources
- Vehicle drivetrain and mechanical safety reference: US National Highway Traffic Safety Administration (NHTSA). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.