Keyway Design Calculator: Key Size, Key Shear and Bearing Stress, Minimum Key Length and Keyway Tolerances

Pick a key for a shaft and a torque, check it, and find the minimum length  |  ANSI B17.1, ISO/DIN 6885-1, Woodruff keys, Shigley’s method

Inputs
1. Key Type & Standard

The Woodruff tables are not built in yet. The key number gives the width and diameter; take the height and seat depth from ANSI B17.2 (or DIN 6888).

2. Geometry
3. Load
Peak or start-up torque (optional)

A one-off torque such as a motor’s breakdown torque or a jam. It is checked against yield with no design factor. A NEMA Design B motor can reach about 2 to 2.5 times its rated torque at breakdown.

4. Materials & Allowables
5. Fit & Tolerance Class

Free for a hub that slides along the key, normal for most fixed hubs, close for reversing or shock loads.

Results update as you type.

Results & Live Preview
Live Preview

Green is under 80% of the allowable, amber 80–100%, red over. The red dot marks the check that governs. The thick lines are the faces that bear: the shaft pushes on the key below the shaft surface, and the key pushes on the hub above it. The dashed red line is the shear plane.

Key Results
Margins of Safety
CheckAppliedAllowableMS

How Hard to Shear It
FailureTorque× design torque

Required Key Length
Shaft Weakening at the Keyseat
Every Standard Key, Compared

Keyway Tolerances
Intermediate Values ▶
Method & Equations
01

Overview

A key carries torque from a shaft into a hub through two side faces. The shaft pushes on the part of the key below the shaft surface; the part above the surface pushes on the hub. Between the two, the key is loaded in shear across the plane of the shaft surface.

That gives three ways for the key joint itself to fail: the key shears, the shaft keyseat crushes, or the hub keyway crushes. A fourth is the shaft, weakened by the keyseat, yielding in torsion or cracking in fatigue at the end of the keyseat. This page checks all four and answers three questions: is this key OK, what is the shortest key that works, and what fails first.

A key is cheap and easy to replace, which is why it is often sized to be the weakest link. When the torque is high, reverses, or comes with heavy shock, a spline, a shrink fit or a taper-lock bushing usually does better than a longer key.

02

Standards & Sizing

The standards size the key from the shaft diameter, so the key is in proportion to the shaft. ANSI B17.1 gives inch keys, square or rectangular, with the keyseat cut to half the key height in both the shaft and the hub. ISO/DIN 6885-1 gives metric keys with separate depths t₁ in the shaft and t₂ in the hub; t₁ is the larger, so the key sits deeper in the shaft. Only the length is left to the designer, and that is what the strength checks set.

  • 1-1/2 in shaft → 3/8 × 3/8 in square key (ANSI B17.1, shafts over 1-3/8 to 1-3/4 in).
  • Ø 40 mm shaft → 12 × 8 mm key, t₁ = 5.0 mm, t₂ = 3.3 mm (DIN 6885-1, shafts over 38 to 44 mm).

Woodruff keys are numbered by size. In ANSI B17.2 the last two digits are the key diameter in eighths of an inch and the digits in front are the width in thirty-seconds: No. 204 is 1/16 × 1/2 in, No. 1212 is 3/8 × 1-1/2 in.

Check the tables against your copy of the standard. The ANSI B17.1 and DIN 6885-1 size tables built into this page are the widely published values and have not yet been checked row by row against licensed copies. The Woodruff tables (ANSI B17.2, DIN 6888) and the ANSI Class 1 and Class 2 width tolerances are not built in at all.
03

Torque & Force

From power and speed:

Torque $$T = \frac{63{,}025\,P_{hp}}{n}\ \text{lb-in} \qquad T = \frac{9{,}549\,P_{kW}}{n}\ \text{N·m}$$

The design torque includes the service factor for the kind of load, and the key sees it as a force at the shaft surface:

Tangential force $$T_d = K_A\,T \qquad F = \frac{2\,T_d}{D}$$

Taking the force at the shaft surface is Shigley’s convention and is slightly conservative; DIN 6892 takes it at the middle of the contact height, a little further out.

04

Shear & Bearing

Stresses $$\tau = \frac{F}{b\,L_{eff}\,\varphi} \qquad \sigma_{shaft} = \frac{F}{t_1\,L_{eff}\,\varphi} \qquad \sigma_{hub} = \frac{F}{(h - t_1)\,L_{eff}\,\varphi}$$

φ is the number of keys that carry load (1, or 1.5 for two keys). Shigley’s basis compares the shear with the shear yield strength from the distortion-energy theory, and the bearing stress with the yield strength of the weaker of the two parts in contact:

Margins $$\tau_{allow} = 0.577\,S_y^{key} \qquad \sigma_{allow} = \min(S_y^{key},\,S_y^{part}) \qquad MS = \frac{\text{allowable}}{n \cdot \text{applied}} - 1$$

For a square key the bearing face is only half the key height, while the shear plane is the full key width, so bearing usually governs. It governs harder still when the hub is aluminum or iron, which is why the hub material matters.

05

Effective Length & Multiple Keys

Rounded key ends sit in the rounded ends of an end-milled keyseat and carry no load. Form A (both ends round) loses one key width, form C one half, form B nothing:

Effective length and minimum length $$L_{eff} = L - b\ (A),\quad L - b/2\ (C),\quad L\ (B) \qquad L_{eff,req} = \max\left(\frac{n F}{\tau_{allow}\,b\,\varphi},\ \frac{n F}{\sigma_{allow}\,t_1\,\varphi},\ \frac{n F}{\sigma_{allow}\,(h - t_1)\,\varphi}\right)$$

Load is not spread evenly along a long key: the shaft twists along the hub, so the end where the torque enters takes more than its share. Length beyond about 1.5 D adds little real capacity, and the page warns when the key or the required length goes past it. Two keys at 180° are counted as 1.5 keys (the DIN 6892 load-sharing factor of 0.75 on each).

06

Woodruff Keys

A Woodruff key is a segment of a disc of diameter Dk and height h, sitting t₁ deep in a round-bottomed seat. The shear plane is the chord at the shaft surface, and the two bearing faces are the parts of the disc segment below and above the surface:

Woodruff geometry $$c = 2\sqrt{t_1\,(D_k - t_1)} \qquad A_{shear} = b\,c \qquad A_{shaft} = A_{seg}(t_1) \qquad A_{hub} = A_{seg}(h) - A_{seg}(t_1)$$ $$A_{seg}(x) = R^2 \cos^{-1}\!\frac{R - x}{R} - (R - x)\sqrt{2 R x - x^2}, \qquad R = D_k/2$$

The key projects only a little into the hub, so the hub face is small, and the seat is deep, so the shaft is weakened more than by a parallel key. Woodruff keys suit light torque and tapered shafts, where they can rock to line up with the hub.

07

Shaft Weakening

For the static check the keyed shaft is taken as a plain shaft of reduced strength, using H. F. Moore’s factor:

Moore’s strength factor $$e = 1 - 0.2\,\frac{b}{D} - 1.1\,\frac{t_1}{D} \qquad \tau_{keyed} = \frac{16\,T_d}{\pi D^3\,e} \le 0.577\,S_y^{shaft}$$

For fatigue the stress concentration at the end of the keyseat is what matters. Shigley’s first-iteration estimates are Kt = 2.14 in bending and Kts = 3.0 in torsion for an end-milled (profile) keyseat, and Kt = 1.7 in bending for a sled-runner keyseat. The sled-runner end is gentler but needs more length. Stopping the keyseat short of a shoulder keeps its stress concentration away from the shoulder fillet’s.

08

Shock, Reversing Load & Speed

The service factor KA scales the steady torque for the kind of machine: 1.0 for a uniform load, rising to 1.75–2.0 for heavy shock. Use the factor your industry or gearbox maker gives where there is one.

A peak torque, such as a motor’s breakdown torque or a jam, is a different question. It is rare, so it is checked against yield with no design factor: the key and the parts around it should not yield when it happens.

A reversing torque rocks the key in its seat. It frets the faces, loosens the hub and drives fatigue cracks from the keyseat end. Use a close fit, keep the hub from moving axially, and check the shaft for fatigue. At high speed, balance the shaft and hub together with the half-key convention of ISO 8821, or the key itself unbalances the rotor.

09

Tolerancing & Fits

ISO fitShaft keyseat widthHub keyway widthUse
FreeH9D10Hub slides along the key
NormalN9JS9General use, fixed hub
CloseP9P9Reversing or shock loads

The key itself is h9 on width and h11 on height (h9 for a square section). The page works the deviations out from ISO 286 at the key size, so they are exact for the class; the depth tolerances it shows (+0.1 mm up to 6 mm keys, +0.2 mm for 8 to 50 mm) are the usual DIN 6885 values and should be checked against the standard. ANSI B17.1 has Class 1, a clearance fit, and Class 2, a side fit that may have slight interference.

10

Worked Example: Shigley’s Keyed Gear

The key-selection example in Shigley’s Mechanical Engineering Design (chapter 7): a 1-7/16 in shaft carries 40 hp at 600 rpm into a gear. A 3/8 in square key of cold-drawn steel with Sy = 65 kpsi is used in a shaft with Sy = 75 kpsi, with a design factor of 2.80. Load this example into the calculator.

Step 1: torque and force $$T = \frac{63{,}025(40)}{600} = 4{,}202\ \text{lb-in} \qquad F = \frac{4{,}202}{1.4375/2} = 5{,}846\ \text{lbf}$$
Step 2: length for shear and for crushing $$L_{shear} = \frac{2.80(5{,}846)}{0.577(65{,}000)(0.375)} = 1.16\ \text{in} \qquad L_{crush} = \frac{2.80(5{,}846)}{65{,}000(0.375/2)} = 1.34\ \text{in}$$

Crushing governs, as it usually does for a square key, so the key must be at least 1.34 in long. The calculator gives the same two lengths.

11

Verification

The engine (js/keyway-math.js) runs in automated tests:

CaseBy handThis page
Shigley keyed gear, key length for shear1.16 in1.16 in
Same, key length for crushing1.34 in1.34 in
Ø 40 mm, 12 × 8 key, 500 N·m, Leff 50 mmτ 41.7, σshaft 100, σhub 166.7 MPasame
12 mm keyway, normal fitN9 0 / −0.043, JS9 ±0.0215 mmsame
At the required lengththe governing margin is exactly zerosame
References & Important Notices
  • ANSI B17.1: Keys and Keyseats. Inch parallel keys, sizes by shaft diameter, Class 1 and Class 2 fits.
  • ANSI B17.2: Woodruff Keys and Keyseats.
  • ISO 773 / DIN 6885-1: parallel keys and keyways, metric. DIN 6888: Woodruff keys. DIN 6892: calculation and design of parallel keys.
  • ISO 286-1: limits and fits, used here for the keyway width deviations.
  • Budynas, R. G. and Nisbett, J. K.: Shigley’s Mechanical Engineering Design, chapter 7 (keys and pins, Tables 7-1 and 7-6).
  • Machinery’s Handbook, Industrial Press: keys and keyseats, Moore’s strength factor for keyed shafts.
  • Pilkey, W. D. and Pilkey, D. F.: Peterson’s Stress Concentration Factors. Juvinall, R. C.: Fundamentals of Machine Component Design.
  • Tables not yet verified. The built-in ANSI B17.1 and DIN 6885-1 size tables are the widely published values. Check each size against a licensed copy of the standard before putting it on a drawing.
  • For informational use only. This calculator is provided as an engineering aid. Results must be verified by a qualified engineer before use in any safety-critical application. KasperCalc assumes no liability for design decisions made using these results.