Skip to main content
Industrial 11 min read Mar 14, 2026

Shaft and Keyway Sizing: Torque Transmission Done Right

ANSI B17.1 tables, stress analysis, and the failure modes that catch designers off guard.

Keys and keyways are the most common method of transmitting torque between a shaft and a hub (gear, sprocket, pulley, coupling). They are simple, reliable, and field-replaceable -- when sized correctly. Undersized keys shear, undersized keyways crush, and poorly toleranced fits either seize or develop fretting corrosion that destroys both shaft and hub.

This guide covers key selection per ANSI B17.1 (Keys and Keyseats), stress analysis for shear and bearing failure, combined loading effects, and the stress concentration that keyways introduce into shaft bending calculations.

Key Types and Standard Sizes per ANSI B17.1

ANSI B17.1 standardizes three key types:

  • Square keys: Width = Height = approximately 1/4 of shaft diameter. Standard for shaft diameters up to about 6.5 inches. Most common type.
  • Rectangular keys: Width = approximately 1/4 of shaft diameter, Height = approximately 3/16 of shaft diameter. Used for larger shafts where a square key would be too deep.
  • Woodruff keys: Semicircular cross-section. Self-aligning, easy to assemble. Common in machine tools and automotive. Not suitable for high torque or reversing loads.

Standard key sizes from ANSI B17.1 (selected):

  • Shaft 0.500–0.625": Key 1/8 × 1/8"
  • Shaft 0.625–0.875": Key 3/16 × 3/16"
  • Shaft 0.875–1.250": Key 1/4 × 1/4"
  • Shaft 1.250–1.375": Key 5/16 × 5/16"
  • Shaft 1.375–1.750": Key 3/8 × 3/8"
  • Shaft 1.750–2.250": Key 1/2 × 1/2"

Key length should be between 1 and 1.5 times the shaft diameter. Shorter keys have high bearing stress. Longer keys may not load uniformly due to shaft/hub deflection.

ANSI B17.1 sizes are based on shaft diameter. Do not arbitrarily select key sizes -- use the standard table. Non-standard keys make replacement difficult and may not fit standard keyway cutters.
Industrial

Shaft & Keyway Calculator

Size keys and keyways for shafts transmitting torque. Shear and compressive stress checks per ASME B17.1 with standard key size lookup.

Launch Calculator →

Shear and Bearing Failure Analysis

Keys fail in two modes: shear along the interface between shaft and hub halves, and bearing (crushing) on the contact surfaces between key and keyway.

Shear stress on the key:

τ = (2T) / (d × W × L)

Where T is torque, d is shaft diameter, W is key width, and L is key length. The shear plane is at the shaft-hub interface, through the full width and length of the key.

Bearing stress on the key sides:

σb = (2T) / (d × (H/2) × L)

Where H is key height. Bearing acts on half the key height (the portion in the shaft or the portion in the hub). For square keys, H = W, so bearing stress is twice the shear stress -- bearing failure is more common than shear failure.

Allowable stresses depend on key material (typically AISI 1018 or 1045 steel): shear allowable is about 0.5 × yield strength; bearing allowable is about 0.9 × yield strength. For AISI 1045 (yield ~60 ksi): allowable shear ≈ 30 ksi, allowable bearing ≈ 54 ksi.

With a 2:1 design factor of safety applied: allowable shear ≈ 15 ksi, allowable bearing ≈ 27 ksi. For reversing or shock loads, increase the safety factor to 3:1 or higher.

Warning: For square keys, bearing stress is twice the shear stress. Most key failures are bearing (crushing) failures, not shear. Always check both modes.
Industrial

Shaft & Keyway Calculator

Size keys and keyways for shafts transmitting torque. Shear and compressive stress checks per ASME B17.1 with standard key size lookup.

Launch Calculator →

Keyway Stress Concentration on the Shaft

A keyway is a stress raiser on the shaft. The sharp corners at the bottom of the keyway create stress concentrations that reduce the shaft's fatigue strength in bending. This is particularly important for shafts subject to rotating bending loads (most shaft applications).

Stress concentration factors (Kt) for keyways per Peterson's Stress Concentration Factors:

  • Sled-runner (end-milled) keyway: Kt ≈ 1.6–2.0 for bending, 1.3–1.5 for torsion
  • Profile (side-milled) keyway: Kt ≈ 2.0–2.5 for bending, 1.5–2.0 for torsion

The profile keyway has higher stress concentration because of the sharp step at each end. Sled-runner keyways have a gradual runout that reduces the concentration.

When sizing a shaft with a keyway, the bending fatigue strength must be reduced by the notch sensitivity factor (q) and stress concentration factor. The effective fatigue stress concentration factor Kf is:

Kf = 1 + q(Kt − 1)

Where q is the notch sensitivity (typically 0.7–0.9 for steel shafts). A shaft that is adequate without a keyway may be undersized once the keyway stress concentration is included.

Tip: Specify sled-runner (end-milled) keyways instead of profile (side-milled) when possible. The gradual runout reduces the bending stress concentration factor by 20–30%.
Industrial

Shaft & Keyway Calculator

Size keys and keyways for shafts transmitting torque. Shear and compressive stress checks per ASME B17.1 with standard key size lookup.

Launch Calculator →

Key Fits, Tolerances, and Installation

ANSI B17.1 defines three classes of fit for keys and keyways:

  • Class 1 (Clearance fit): Easy assembly and disassembly. Key fits loosely. For light duty, infrequent disassembly, or applications where axial freedom is needed.
  • Class 2 (Side clearance or transition fit): Key fits snugly with slight clearance or slight interference on the width. Standard for most industrial applications. Light tapping may be needed for installation.
  • Class 3 (Interference fit): Key is interference fit on the width. Requires pressing or heating hub for assembly. For heavy torque, shock loads, or applications where zero backlash is critical.

Key material is typically softer than both shaft and hub so the key fails first, acting as a mechanical fuse that protects the more expensive components. AISI 1018 cold-drawn steel is standard for keys in carbon steel shafts.

Keyway depth in the shaft and hub must be carefully controlled. The standard is H/2 in the shaft and H/2 in the hub (splitting the key height equally). The keyway bottom should have a fillet radius (typically 1/64" to 1/32") to reduce stress concentration, but the key corners must be chamfered to clear the fillet.

Tip: Always use a key material softer than the shaft and hub. The key should be the sacrificial element -- replacing a $2 key is vastly cheaper than replacing a $2,000 shaft or gear.
Industrial

Shaft & Keyway Calculator

Size keys and keyways for shafts transmitting torque. Shear and compressive stress checks per ASME B17.1 with standard key size lookup.

Launch Calculator →
Industrial

Shaft & Keyway Calculator

Size keys and keyways for shafts transmitting torque. Shear and compressive stress checks per ASME B17.1 with standard key size lookup.

Launch Calculator →

Frequently Asked Questions

Use the ANSI B17.1 standard table, which specifies key width and height based on shaft diameter. Do not arbitrarily size keys -- non-standard sizes make replacement difficult and may not fit standard keyway cutters.
For square keys, bearing stress is twice the shear stress because bearing acts on only half the key height, while shear acts on the full width. Bearing (crushing) failure is the dominant mode in most applications.
Yes. Keyways create stress concentrations with K_t values of 1.6–2.5, reducing fatigue strength in bending. Always include the keyway stress concentration factor when sizing shafts subject to bending loads.
AISI 1018 cold-drawn steel is standard. The key should be softer than both shaft and hub so it fails first as a mechanical fuse, protecting the more expensive components.
Disclaimer: This guide provides general engineering guidance for key and keyway design. Critical applications require validation by a qualified mechanical engineer. Reference ANSI B17.1 for complete standard specifications.

Calculators Referenced in This Guide

Industrial Live

Shaft & Keyway Calculator

Size keys and keyways for shafts transmitting torque. Shear and compressive stress checks per ASME B17.1 with standard key size lookup.

Related Guides

Machinist 13 min

Compression Spring Design: Rate, Stress, and Fatigue Life

Helical compression spring design from scratch. Wire diameter, spring rate, Wahl correction, solid height, buckling, and fatigue life estimation.

Industrial 12 min

Roller Chain Selection: HP Ratings, Service Factors, and Sprockets

How to select ANSI roller chain by horsepower and speed. Service factors, multi-strand ratings, sprocket tooth count, and chain life considerations.