Mechanical Engineering Calculator

Key & Keyway Calculator

Design parallel keys and keyways. Calculate required key length, check shear and crushing stresses, and get recommended standard key sizes based on shaft diameter (ISO / DIN 6885).

Key & Keyway Configuration

Parallel rectangular / square key transmitting torque between shaft and hub

d = shaft diameterw × h = key sectionL = key lengthHub

Input Parameters

SI units: N·mm, MPa, mm

mm

Nominal shaft diameter at the key location.

Suggested key (ISO/DIN): 14 × 9 mm
N·mm

Torque to be transmitted (1 N·m = 1000 N·mm).

mm

Width of the key (b).

mm

Height of the key.

mm

Active length of the key in contact.

MPa

Allowable shear stress of key material.

MPa

Allowable compressive stress of key material.

Governing Required Length

37.04mm

Shear Stress

20.41 MPa

Crushing Stress

63.49 MPa

PASS — Stresses within allowable limits

Required length (governing) = 37.04 mm (Shear: 23.81 mm / Crushing: 37.04 mm)

Detailed Results

Tangential Force20,000.0 N
Induced Shear Stress20.41 MPa
Induced Crushing Stress63.49 MPa
Required L (shear)23.81 mm
Required L (crushing)37.04 mm

Governing Formulas

τ = 2T / (d · w · L)
σc = 4T / (d · h · L)

Assumptions

  • Parallel rectangular / square key
  • Uniform pressure distribution
  • No stress concentration factors
  • Key material weaker or equal to shaft
  • ISO/DIN style standard sizes
  • Steady torque (no shock factors)

Engineering Code

Python
def key_stresses(T, d, w, h, L):
    """
    Parallel key shear & crushing stresses
    T : N·mm
    d, w, h, L : mm
    Returns τ and σc in MPa
    """
    tau = (2 * T) / (d * w * L)
    sigma_c = (4 * T) / (d * h * L)
    return tau, sigma_c


# Example
T = 500000
d = 50
w = 14
h = 9
L = 70

tau, sigma = key_stresses(T, d, w, h, L)
print(f"Shear stress: {tau:.2f} MPa")
print(f"Crushing stress: {sigma:.2f} MPa")
MATLAB
function [tau, sigma_c] = key_stresses(T, d, w, h, L)
    % Parallel key stresses (MPa)
    % T in N·mm, dimensions in mm
    tau = (2 * T) / (d * w * L);
    sigma_c = (4 * T) / (d * h * L);
end

% Example
T = 500000;
d = 50;
[tau, sigma] = key_stresses(T, d, 14, 9, 70);
fprintf('Shear: %.2f MPa, Crushing: %.2f MPa\n', tau, sigma);
Excel Formulas
Shear: =2*T/(d*w*L)   |   Crushing: =4*T/(d*h*L)

Real-World Engineering Cases

Key Shear Failure in a Conveyor Drive

A rectangular key sheared after only three months of service. Investigation showed the key length had been sized only for crushing; the shear length requirement was significantly longer.

Engineering Lesson

Always calculate both shear and crushing lengths and use the larger value. Never size a key on only one criterion.

Incorrect Key Size Selection

A designer used a key sized for a 40 mm shaft on a 55 mm shaft. The resulting high contact stress caused fretting and eventual hub cracking.

Engineering Lesson

Always select the key cross-section from the standard table that corresponds to the actual shaft diameter.

Frequently Asked Questions

What is the difference between shear and crushing of a key?

Shear is the tendency of the key to be cut across its width. Crushing is the compressive bearing stress on the contact faces between key, shaft and hub.

How do I choose standard key dimensions?

Use ISO 773 or DIN 6885 tables. The calculator suggests the appropriate width and height based on shaft diameter.

What allowable stresses should I use?

Typical values for steel keys: shear 40–70 MPa, crushing 80–150 MPa depending on material and load type (steady / shock).

Engineering calculations provided by this tool are for educational and preliminary design purposes. Always verify against applicable standards (ISO, DIN, ANSI), material certificates and safety factors before final manufacturing.