August 2026 13 min read

Key Design Calculator

Free online key design calculator for mechanical engineering. Compute key shear stress τ=2T/(w·L·d), crushing stress σ_c=4T/(h·L·d), safety factors and required key length for shaft-hub torque transmission. Includes DIN 6885 sizing and material strength analysis.

Key Design Calculator

Key & Shaft Details

Unit System
SI — Nm, mm, MPa Imperial — lb-ft, in, psi
Torque (T) (Nm)
Nm

Torque transmitted through the key joint

Shaft Diameter (d) (mm)
mm
Key Width (w) (mm)
mm
Key Height (h) (mm)
mm
Key Length (L) (mm)
mm

Engaged length of the key in the hub

Material Yield Strength (MPa)
MPa

Yield strength of the key material

Target Safety Factor

Typically 2–4 for steady, 3–4 for shock duty

Decimal Precision
Auto-calculate instantly

Required Key Length

39.5mm

Minimum key length to meet the target safety factor of 2. Current entry: 70 mm.

Design is SAFE — adequate margins
Shear Stress τ

20.41MPa

Crushing Stress σ_c

63.49MPa

Safety Factor (Shear)

3.31

Safety Factor (Crush)

1.77

Governing Torque Capacity

885.9Nm

Required Key Length

39.5mm

Shear Stress τ

20.41MPa

Actual shear stress in the key

Crushing Stress σ_c

63.49MPa

Actual crushing stress in the key

Safety Factor (Shear)

3.31

τ_allowable / τ_actual

Safety Factor (Crush)

1.77

σ_c,allowable / σ_c,actual

Governing Torque Capacity

885.9Nm

min(T_shear, T_crush)

Required Key Length

39.5mm

To meet target safety factor

Result Summary

Shaft Diameter50 mm
Key w × h14 × 9 mm
Applied Torque500 Nm
Shear Stress (τ)20.41 MPa
Crushing Stress (σ_c)63.49 MPa
Shear FS3.31
Crush FS1.77
VerdictSAFE — adequate margins
Estimated Result — Results assume a snug-fitting parallel key, uniform stress distribution along the key, and allowable stresses based on 0.3·S_y for shear and 0.5·S_y for crushing divided by the target safety factor. Keyway stress concentration in the shaft, fretting, dynamic loads and standard tolerance fits are not included. Verify final designs against the governing standard with a qualified engineer.

Interactive Diagram

Applied torque T Shear arrows τ Crushing arrows σ_c

Diagram updates live with your inputs — the SAFE/UNSAFE badge and arrow colours reflect whether the actual stresses stay within the allowable limits.

Visualizations

Stresses vs Allowable (MPa)

20.4MPaShear τ
63.5MPaCrush σ_c
67.5MPaAllow τ
112.5MPaAllow σ_c

Governing Utilization

1 / min(SF)56%

Formula

A key transmits torque through two parallel failure modes: shear across the key cross-section at the shaft-hub interface, and crushing (bearing) on the key side faces. The lower of the two governing capacities sets the torque the joint can carry.

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

Alternative Form

T_shear = w·L·d·τ_allow/2 ; T_crush = h·L·d·σ_c,allow/4

Variables

SymbolNameUnitDescription
TApplied torqueNmTorque transmitted through the key joint
wKey widthmmWidth of the key in the axial-radial plane
hKey heightmmTotal height of the key (half in shaft, half in hub)
LKey lengthmmEngaged length of the key in the hub
dShaft diametermmDiameter of the shaft at the keyway
τShear stressMPaActual shear stress in the key
σ_cCrushing stressMPaActual bearing (crushing) stress on the key faces
FSFactor of safety—Allowable stress divided by actual stress (both modes)

Explanation

The shear formula τ = 2T/(w·L·d) arises because the torque T produces a tangential force F = T/(d/2) at the shaft surface; this force is resisted by two shear planes of area w·L, giving τ = F/(2·w·L) = 2T/(w·L·d) after converting torque units. The crushing formula σ_c = 4T/(h·L·d) uses the projected bearing area h·L on each of the two key faces (effective height h/2 each). Comparing each actual stress to its allowable value gives the two safety factors; the joint is safe only when both exceed the target.

Derivation

Force at key interface: F = T / (d/2). Shear area = 2·w·L → τ = F/(2·w·L) = (2T/d)/(2·w·L) = 2T/(w·L·d). Bearing area = 2·(h/2)·L = h·L → σ_c = F/(h·L) = (2T/d)/(h·L) = 2T/(h·L·d)·1000 in consistent units, equivalently 4T/(h·L·d) when T is in N·m. Rearranging for capacity: T_shear = w·L·d·τ_all/2 and T_crush = h·L·d·σ_c,allow/4.

Step-by-Step Calculation

Follow each step to understand how the result is calculated from your inputs.

Step 1

Read the input geometry, material and target safety factor.

Torque T:500 Nm
Shaft Ø d:50 mm
Key w × h:14 × 9 mm
Key length L:70 mm
Intermediate: Yield strength S_y = 450 MPa, target SF = 2
Result: All inputs validated and in consistent units
Step 2

Compute allowable stresses from yield strength and target safety factor.

τ_all = 0.3·S_y/SF ; σ_c,all = 0.5·S_y/SF
Intermediate: τ_all = 0.3·450/2 = 67.50 MPa
Result: σ_c,all = 0.5·450/2 = 112.50 MPa
Step 3

Compute the actual shear stress in the key.

τ = 2T / (w·L·d)
Intermediate: τ = 2·500 / (14·70·50) · 1000
Result: τ = 20.41 MPa
Step 4

Compute the actual crushing (bearing) stress in the key.

σ_c = 4T / (h·L·d)
Intermediate: σ_c = 4·500 / (9·70·50) · 1000
Result: σ_c = 63.49 MPa
Step 5

Evaluate the safety factors for both failure modes.

SF_shear = τ_all/τ ; SF_crush = σ_c,all/σ_c
Intermediate: SF_shear = 67.50/20.41
Result: SF_shear = 3.31, SF_crush = 1.77
Step 6

Determine torque capacity and the required key length; compare against the standard.

T_max = min(w·L·d·τ_all/2, h·L·d·σ_c,all/4) ; L_req = max(2T/(w·d·τ_all), 4T/(h·d·σ_c,all))
Intermediate: T_shear = 1,654 Nm, T_crush = 885.9 Nm
Result: T_max = 885.9 Nm; L_req = 39.5 mm; standard ≈ 14 × 9
Final Answer
39.5 mm

Worked Examples

See how the calculator works with different scenarios.

Scenario

A 50 mm shaft carries a 500 Nm gear load using a 14 × 9 key, 70 mm long, in AISI 1045 steel.

Inputs

Torque:500 Nm
Shaft Ø:50 mm
Key:14 × 9 mm
Length:70 mm
Yield:450 MPa
Target SF:2

Calculation

τ = 2·500/(14·70·50)·1000 = 20.4 MPa; σ_c = 4·500/(9·70·50)·1000 = 63.5 MPa; τ_all = 0.3·450/2 = 67.5 MPa; σ_c,all = 0.5·450/2 = 112.5 MPa

Result

SF_shear = 3.31, SF_crush = 1.77 — design SAFE

Interpretation

Both safety factors exceed 1 with comfortable margins; the key is well sized for the load.

Understanding Your Result

Your Result: 39.5 mm

Typical range: Practical key designs run safety factors of 1.5–4. Yours: shear FS 3.31, crushing FS 1.77.

What This Means

Your key sees a shear stress of 20.41 MPa and a crushing stress of 63.49 MPa. The governing safety factor is 1.77, so the joint is safe at the target SF of 2. The required key length to meet that target is 39.5 mm.

Why It Matters

Keys are the most common shaft-hub torque connection. Undersized keys fail by shear or by crushing the keyway walls, often with little warning. Checking both modes against allowables is essential to reliable power-transmission design.

Professional Interpretation

The key is adequately sized with margin to spare — confirm the keyway does not over-stress the shaft.

Shear vs Crushing

Shear stress is 20.41 MPa against an allowable 67.50 MPa; crushing is 63.49 MPa against 112.50 MPa.

Torque Capacity

Governing capacity is min(T_shear=1,654 Nm, T_crush=885.9 Nm) = 885.9 Nm.

Standard Match

For a 50 mm shaft, DIN 6885 suggests a 14 × 9 key. Compare with your 14×9 selection.

Recommendations

  • •Size the key to the DIN 6885 standard for the given shaft diameter, then verify length for your torque.
  • •Watch crushing first — for rectangular keys it usually governs before shear.
  • •Crushing governs; a taller key (larger h) helps more than extra length.
  • •Account for the shaft keyway stress concentration separately — it can reduce shaft fatigue strength by 25% or more.
  • •Keep engaged key length within roughly 1.5·d for uniform load distribution.

Educational Content

Introduction

Keys are the humble workhorses of mechanical power transmission — almost every gear, pulley, sprocket and coupling that turns a shaft relies on one. A key is a small prism fitted into matching keyways in the shaft and hub; it locks the two parts together so torque transfers without slipping. Understanding how a key carries load, and how to size it so it neither shears nor crushes, is core machine-design knowledge, and this key design calculator turns the classical formulas into instant answers.

Concept Explanation

Torque T on a shaft produces a tangential force F = T/(d/2) at the key interface. That force attempts to shear the key across two planes (each of area w·L) and to crush the key against the side walls of the keyway (projected bearing area h·L). The resulting stresses are τ = 2T/(w·L·d) for shear and σ_c = 4T/(h·L·d) for crushing. Each is compared with an allowable value derived from the material yield (typically 0.3·S_y for shear, 0.5·S_y for crushing) divided by the chosen safety factor. The joint is safe only when both ratios exceed 1; the weaker mode governs the torque capacity.

Applications

▸Sizing keys for gears, pulleys, sprockets and couplings
▸Verifying hub-to-shaft connections in pumps and compressors
▸Selecting keys for conveyor, mixer and agitator drives
▸Checking repair/rebuild joints against original torque ratings
▸Teaching shear and bearing stress in machine-design courses
▸Preliminary sizing before more detailed spline analysis

Benefits

  • •Instant shear and crushing checks without hand derivation
  • •Both failure modes evaluated and the weaker one identified
  • •Required key length solved directly for a target safety factor
  • •DIN 6885 standard cross-section suggestions built in
  • •Live diagram and charts that build intuition about stress state

Limitations

  • •Assumes uniform stress along the full key length (no end effects)
  • •Excludes shaft keyway stress concentration and fatigue
  • •Allowable stresses are simple fractions of yield, not code-based
  • •No account of fit tolerances, fretting or dynamic/shock loads
  • •Single parallel key only — not splines or multiple-key layouts

Best Practices

  • •Start from the DIN 6885 standard key for the shaft diameter
  • •Keep engaged length ≤ 1.5·d to avoid non-uniform loading
  • •Use a taller key or stronger material when crushing governs
  • •Verify the shaft itself (with keyway) separately for strength
  • •Apply a safety factor of 2–4 for steady, 3–4 for shock duty

Common Misconceptions

Myth: If the key does not shear, it is fine.
Truth: Crushing of the keyway walls often governs first — a key can be perfectly safe in shear yet emboss the hub long before failure.
Myth: A longer key is always better.
Truth: Beyond ~1.5·d the extra length carries little load because the shaft twists; multiple shorter keys then beat one very long key.
Myth: Shear and crushing stresses are the same.
Truth: For a square key (w = h) the crushing stress is exactly twice the shear stress because the bearing area is half the shear area.
Myth: Any steel key matches the shaft strength.
Truth: The key should have yield comparable to or above the shaft; a soft key in a hard shaft crushes the hub keyway regardless of shaft capacity.

Practical Tips

  • •Your governing safety factor is 1.77. Aim for 2–3 in final designs to absorb shock and misalignment.
  • •For rectangular keys, crushing usually governs — prefer a taller section before adding length.
  • •Match the key to the DIN 6885 standard for the shaft diameter; off-standard sizes are harder to source.
  • •Remember the keyway cuts the shaft: de-rate shaft allowable stress by ~25% for fatigue.
  • •Keep engaged key length under 1.5·d for even load share.

Common Mistakes

Forgetting the unit conversion in the formula
Torque in N·m must be multiplied by 1000 (to N·mm) before dividing by w·L·d in mm; the calculator does this automatically — keep all inputs in the chosen unit system.
Checking only shear
Always check crushing too; for rectangular and square keys the crushing stress is 2× the shear stress and usually governs the design.
Using a key far longer than 1.5·d
Beyond ~1.5·d the shaft twist makes the ends carry most load; add a second key at 180° or move to a spline rather than lengthening further.
Ignoring the shaft keyway stress concentration
The keyway notch can cut shaft fatigue strength by 25–60%; de-rate the shaft separately even when the key itself is safe.
Choosing a key weaker than the shaft
Size the key material yield to match or exceed the shaft; an under-strength key crushes the hub keyway regardless of shaft capacity.

Assumptions

This calculator makes the following assumptions to provide estimates:

Parallel key, snug fit: Assumes a tight-fitting parallel key with no clearance that would let the key rock or shift under load.
Uniform stress distribution: Stress is taken as uniform along the full engaged length; end effects and shaft twist are ignored.
Allowable = fraction of yield: Allowable shear is 0.3·S_y and allowable crushing is 0.5·S_y, each divided by the target safety factor.
Static loading: Loads are steady; fatigue, shock and impact amplification are not modelled.
Steel-on-steel keyway: The weaker of key, shaft and hub controls; a single representative yield is used here.

Limitations

Be aware of these limitations when using this calculator:

Single key only: One parallel key is analysed; multiple-key and spline load sharing require separate treatment.
No shaft fatigue: The keyway stress concentration in the shaft and its effect on fatigue life are excluded.
No fit/tolerance effects: DIN/ISO fit classes and clearance that influence load transfer are not included.
Empirical allowables: 0.3/0.5 yield fractions are rules of thumb, not a substitute for the governing design code.
No dynamic loads: Shock, vibration and impact factors must be applied externally before final sizing.

Frequently Asked Questions

Answers to common questions about this calculator.

What is a key in mechanical design?
A key is a machine element used to connect a rotating shaft to a hub (gear, pulley, coupling) to transmit torque. It fits into a keyway — a groove machined into both the shaft and the hub. Keys prevent relative rotation between the shaft and the mounted component.
How does a key transmit torque?
A key transmits torque through shear and crushing (bearing) stresses. The torque applied to the shaft creates a force at the key interface. Half the key height is in the shaft keyway and half in the hub keyway, creating shear planes and bearing surfaces.
What are the common types of keys?
Common key types include: square keys (equal width and height), rectangular (flat) keys, gib-head keys (with a head for removal), Woodruff keys (semi-circular), taper keys (1:100 taper for axial locking), splines (multiple keyways), and feather keys (allow axial sliding).
How is key shear stress calculated?
Key shear stress is calculated using τ = 2T/(w·L·d), where T is torque, w is key width, L is key length, and d is shaft diameter. The shear stress acts across the shear plane at the interface between the shaft and key.
How is key crushing stress calculated?
Key crushing (bearing) stress is calculated using σ_c = 4T/(h·L·d), where h is the key height. For square keys (w = h), the crushing stress is twice the shear stress. The crushing stress acts on the side faces of the key.
What is the factor of safety for key design?
Factor of safety for keys is typically 2-4 for shear and 1.5-3 for crushing, depending on application criticality, load type (steady vs shock), and material properties. Higher safety factors are used when shock loads or misalignment are expected.
What materials are used for keys?
Keys are typically made from medium-carbon steel (AISI 1018-1045) with tensile strength 450-700 MPa. Stainless steel keys are used for corrosion resistance. Brass or aluminum keys are used in low-load applications or where galvanic compatibility is needed.
What is standard key sizing?
Standard key sizes are defined in DIN 6885, ISO 3912, and ANSI B17.1. For a given shaft diameter, standard key width and height are specified. Key length is typically 1-1.5 times the hub width and is sized to carry the required torque with adequate safety factor.
What is the difference between a key and a spline?
A key is a single element in a single keyway, suitable for moderate torques. A spline has multiple teeth (typically 6-24) machined directly on the shaft, providing higher torque capacity, better centering, and the ability to transmit torque while allowing axial sliding.
How do I select key length?
Key length is determined by the required shear and crushing capacity. L = max(2T/(w·d·τ_all), 4T/(h·d·σ_c_all)). The length should not exceed 1.5 times the shaft diameter to avoid misalignment issues. Standard lengths range from 10-200 mm.
What is a Woodruff key?
A Woodruff key is a semi-circular key that fits into a curved keyway machined with a Woodruff cutter. It self-aligns in the keyway and is used for low-torque applications, tapered shafts, and where axial space is limited. Common in machine tools and automotive applications.
What is a gib-head key?
A gib-head key has a head (gib) at one end to facilitate removal without special tools. It is typically used with a 1:100 taper that locks the hub axially. The head provides a striking surface for driving the key out during disassembly.
What is the keyway depth?
Keyway depth varies by standard. For square keys in shaft: depth ≈ w/2. For hub keyway: depth ≈ w/2 + 0.5mm clearance. Total keyway depth plus clearance equals the key height. Proper depth ensures the key sits correctly without protruding.
How does keyway affect shaft strength?
Keyways reduce shaft strength by creating stress concentrations. The effective stress concentration factor K_t for keyways is approximately 2.0-3.0 for fatigue loading. ASME recommends reducing allowable stress by 25% for shafts with keyways.
What is the standard key taper?
Standard taper for taper keys is 1:100 (1 mm per 100 mm length). This taper is applied to the top face of the key, matching a tapered keyway in the hub. When driven in, the taper creates an interference fit that prevents axial movement.
What are DIN 6885 key sizes?
DIN 6885 specifies standard metric key sizes: shaft 6-8mm → 2x2, 8-10 → 3x3, 10-12 → 4x4, 12-17 → 5x5, 17-22 → 6x6, 22-30 → 8x7, 30-38 → 10x8, 38-44 → 12x8, 44-50 → 14x9, 50-58 → 16x10, 58-65 → 18x11, 65-75 → 20x12, 75-85 → 22x14, 85-95 → 25x14, 95-110 → 28x16.
What is a feather key?
A feather key is a parallel key that is fixed to the shaft (usually with screws) and allows the hub to slide axially along the shaft while transmitting torque. Used in sliding gearboxes and clutch mechanisms where axial movement is required under load.
How do I install a key?
Key installation: 1) Clean keyway and key, removing burrs. 2) Apply light oil or anti-seize. 3) For parallel keys, position in shaft keyway. 4) For taper keys, drive in from the large end until hub is locked. 5) For gib-head keys, leave enough head exposed for removal.
What causes key failure?
Common key failure modes: shear failure (key shears at shaft-hub interface), crushing failure (keyway walls deform), fretting wear (micro-motion between key and keyway), fatigue failure (cyclic loading), and corrosion (in hostile environments).
What is the torque capacity of a key?
Torque capacity is limited by both shear and crushing: T_shear = w·L·d·τ_all/2, T_crushing = h·L·d·σ_c_all/4. The actual torque capacity is the minimum of these two values. The key material yield strength and safety factor determine the allowable stresses.
How does multiple key design work?
For high-torque applications, two keys at 180° apart or splines distribute load. With two keys, torque capacity approximately doubles, but precise load sharing requires tight tolerances. Multiple keys are common in heavy machinery and marine propulsion.
What is the difference between parallel and taper keys?
Parallel keys have constant cross-section and require separate axial retention (set screws, circlips). Taper keys have a 1:100 taper that provides both torque transmission and axial location. Taper keys cannot be used where the hub must slide axially.
How is key material selected?
Key material should have yield strength comparable to or higher than the shaft material. Common materials: AISI 1018 (S_y = 370 MPa) for general use, AISI 1045 (S_y = 450 MPa) for higher loads, and alloy steels (4140, S_y = 655 MPa) for heavy-duty applications.
What is a keyway broach?
A keyway broach is a cutting tool used to cut internal keyways in hubs. It is pulled or pushed through the hub, removing material progressively. Broaching is the most common method for producing accurate internal keyways in production quantities.
What is the standard keyway tolerance?
Keyway width tolerances per DIN 6885/ISO are: P9 for hub keyway, N9 for shaft keyway. The key itself is h9 tolerance. These tolerances provide a transition fit ensuring the key fits snugly without being too tight to assemble.
What is a splined shaft?
A splined shaft has multiple integral keys (spline teeth) machined directly on the shaft, matching internal splines in the hub. Splines provide higher torque capacity, better concentricity, and allow axial sliding under load. Common in transmissions and drivelines.
How do I calculate key length for a given torque?
Required key length L = max(2T/(w·d·τ_all), 4T/(h·d·σ_c_all)). For a 50mm shaft with 14x9 key at 1000 Nm and τ_all = 80 MPa: L_shear = 2×1000/(0.014×0.05×80e6) = 0.0357m = 36mm, L_crush = 4×1000/(0.009×0.05×80e6) = 0.111m = 111mm. Use 112mm.
What is the advantage of square keys?
Square keys (w = h) are the most common and economical. The equal width and height simplifies manufacturing since the same cutter can machine both shaft and hub keyways. The stress distribution is symmetric, and standard sizing is well-established.
What is the contact pressure in a key joint?
Contact pressure (bearing stress) on the key side faces is p = 2T/(h·L·d) per face. Maximum allowable contact pressure depends on the weaker of the key, shaft, and hub materials. Typical limits range from 50-150 MPa for steel components.
How does key length affect stress distribution?
Longer keys reduce stress for a given torque, but very long keys (L > 1.5d) experience non-uniform load distribution due to torsional deflection of the shaft. The ends of long keys carry higher stress. Multiple shorter keys are better than one very long key.
What is a set screw with key?
A set screw (grub screw) is often used in combination with a key to prevent axial movement of the hub. The set screw presses against the key or directly on the shaft through the hub. It is not a torque-transmitting element but provides axial retention.
What is the fatigue life of a key joint?
Key joint fatigue life depends on stress amplitude in the key and keyway stress concentration in the shaft. Keyway fatigue failures initiate at the keyway corners. Radiused keyway corners (0.4-0.6mm radius) significantly improve fatigue life compared to sharp corners.
What is key rolling or key fretting?
Key rolling and fretting occur due to micro-motion between the key and keyway under cyclic loading. Fretting produces wear debris and surface damage, leading to reduced torque capacity and eventual failure. Proper fit tolerances and lubrication reduce fretting.
Can I use this calculator for spline design?
This calculator is designed for single-key design. For splines, use a dedicated spline calculator that accounts for multiple teeth, pressure angles, root fillets, and load distribution factors. The basic stress principles are similar but spline analysis is more complex.
Explore the full collection:

Related Calculators

Explore more calculators related to this topic.

Next Logical Steps

Explore more calculators related to this topic.

Related Guides

Deepen your understanding with these educational resources.

Glossary

Technical terms used in mortgage calculations explained in plain language.

Shear Stress
Stress that occurs when forces are applied parallel to a surface, causing layers to slide past each other.
Crushing Stress
Also known as bearing stress, it occurs when compressive loads are applied over a small area, causing deformation or failure of the material.
Factor of Safety
A design parameter that provides a margin of safety by dividing the material strength by the expected stress.
Torque
A measure of rotational force that causes an object to rotate about an axis.
Keyway
A groove machined into a shaft and hub to accommodate a key for torque transmission.
DIN 6885
German standard that specifies dimensions and tolerances for metric keys and keyways.

Authoritative References

Trusted sources and standards referenced by this calculator.

Applicable Standards

DIN 6885ISO 3912ANSI B17.1

Was This Calculator Helpful?

Page Information

Last Updated:

August 2026

Version:

2.1.0

License:

Free to use for educational and professional purposes.