Keyway Depth Calculator
Determine standard key sizes, shaft depths (t₁), and hub depths (t₂) per DIN 6885-1 and ANSI B17.1.
Keyway & Key Size Standards Calculator
Table of Contents10 Topics • Click to expand
- 1. What Is a Keyway & Joint Mechanics?
- 2. How Keyway Depth Is Determined
- 3. Shaft vs Hub Keyway Depth
- 4. Key Width, Height, Depth & Types
- 5. Keyway Fit Classes & Tolerances
- 6. Worked Example (Metric DIN 6885)
- 7. Worked Example (Imperial ANSI B17.1)
- 8. Design Limitations & Stress Analysis
- 9. Frequently Asked Questions
- 10. References & Standards
What Is a Keyway & Joint Mechanics?
A keyway is a precision axial slot machined into a shaft and its mating hub bore to accommodate a machine key (Wikipedia). The key is a standardized metallic component—typically a square or rectangular steel bar—that mechanically locks the rotating assembly, transmitting drive torque while preventing relative rotation between components such as pulleys and belt drives, gears, sprockets, and couplings.
The slot machined into the outer diameter of the shaft is technically designated the keyseat, while the mating internal slot in the hub bore is the hub keyway. Torque transmission creates a tangential force F = 2T / d across the shaft radius, generating simultaneous horizontal shear stress across the key's interface cross-section and compressive bearing (crushing) stress against the vertical keyway sidewalls.
Figure 2: Keyed shaft joint stress analysis per Shigley's Mechanical Engineering Design. Sunk keys are subjected to simultaneous horizontal shear across the shaft/hub interface plane (b × L) and lateral compressive bearing stress across the side flanks (t₁ × L and t₂ × L).
How Keyway Depth Is Determined
In modern machine design, keyway dimensions are governed by empirical and standardized lookups rather than arbitrary formulas. International standards—such as DIN 6885-1 / ISO 773:1978 for metric shafts and ANSI/ASME B17.1-1967 (R2013) for imperial shafts—assign optimal key dimensions and keyway depths to specific shaft diameter ranges.
The standard engineering workflow consists of:
- Measuring the nominal shaft diameter d (or evaluating shaft sizing from our Shaft Critical Speed Calculator).
- Selecting the applicable standard system (Metric DIN 6885-1 or Imperial ANSI B17.1).
- Matching d to the standardized diameter bracket.
- Extracting the standardized key width (b or W), key height (h or H), shaft keyway depth (t₁), and hub keyway depth (t₂).
These standardized depth allocations are engineered to optimize the balance between shaft torsional fatigue strength and key bearing load capacity, incorporating built-in radial clearances.
Shaft Keyway Depth vs. Hub Keyway Depth
Shaft keyway depth (t₁) and hub keyway depth (t₂) are distinct geometric dimensions. In metric engineering per DIN 6885-1, the key is not split symmetrically in half:
Figure 1: Parallel keyway dimensioning cross-section per DIN 6885-1 and ANSI B17.1. For metric keys, the sum of shaft depth (t₁) and hub depth (t₂) exceeds key height (h) to provide standardized radial clearance, ensuring torque is transmitted purely through tangential key flanks.
| Parameter / Feature | Metric (DIN 6885-1 / ISO 773) | Imperial (ANSI/ASME B17.1) |
|---|---|---|
| Shaft Keyway Depth (t₁) | Tabulated per standard diameter range | Nominally H / 2 for square keys |
| Hub Keyway Depth (t₂) | Tabulated per standard diameter range | Nominally H / 2 for square keys |
| Depth Symmetry (t₁ = t₂) | Asymmetric (t₁ > t₂ for virtually all sizes) | Symmetric for square keys (t₁ = t₂ = H/2) |
| Top Radial Clearance (c) | Built-in: c = (t₁ + t₂) − h > 0 (e.g. +0.2 to +0.4 mm) | Nominally zero on basic size; controlled via fit class |
| Workshop Caliper Inspection | Direct depth check: d − t₁ | Chordal depth check: S = D − Y − H/2 |
The intentional excess in metric clearance (t₁ + t₂ > h) guarantees that radial thermal expansion or slight misalignment never causes top-of-key jamming, ensuring pure tangential torque transmission across key flanks.
Key Width, Height, Depth & Standard Key Styles
Key dimensions are defined along distinct geometric axes:
- Key Width (b or W): Tangential dimension parallel to the shaft circumference. Dictates the direct shear plane area A_s = b × L.
- Key Height (h or H): Radial thickness dimension from shaft core toward hub. Dictates the side flank bearing contact areas t₁ × L and t₂ × L.
- Keyway Depth (t₁, t₂): Machine cut depth measured radially from the shaft or hub circumference.
Depending on assembly requirements, shock loading, and shaft taper, engineers choose between three primary key styles:
Figure 3: Cross-sectional comparison of machine key styles. Parallel keys transmit torque through purely tangential forces with no axial thrust. Woodruff keys self-align in circular milled pockets for tapered shafts. Tapered keys wedge at a 1:100 slope to provide axial lockup under heavy reversing shock loads.
While parallel keys remain the universal standard for continuous power transmission, Woodruff keys (Wikipedia) provide self-aligning seating on tapered shafts, and tapered gib-head keys deliver positive axial lockup under violent reversing shock loads.
Keyway Fit Classes & Tolerances (ISO / DIN 6885)
Keyway slot widths are machined to standardized ISO tolerance classes (Wikipedia) depending on the operating dynamics of the driven assembly:
Figure 4: Standard ISO keyway tolerance classes per DIN 6885-1. Normal fit (JS9/N9) is the industry standard for general mechanical assemblies. Close fit (P9) eliminates rotational backlash under alternating shock torque, while free fit (D10) allows axial displacement.
- Normal / Standard Fit (JS9 / N9 for Shaft, JS9 for Hub): The universal default for gearboxes, bearing-supported shafts, and industrial pumps. Allows light mallet tap assembly into the shaft and smooth sliding onto the hub.
- Close / Press Fit (P9 for Shaft and Hub): Interference fit eliminating rotational backlash under reversing rotational shock loads.
- Free / Sliding Fit (D10 for Shaft and Hub): Clearance fit allowing smooth axial translation under load (e.g. dog clutches, gear shifter sleeves).
Worked Example — Metric (DIN 6885-1)
Scenario: A motor drive shaft has a nominal diameter of d = 30.0 mm. Determine the standard parallel key and keyway dimensions per DIN 6885-1.
- Shaft Diameter: d = 30.0 mm.
- Diameter Bracket: The standard DIN 6885-1 table specifies bracket >22 to 30 mm.
- Standard Key Size: 8 × 7 mm (Width b = 8 mm, Height h = 7 mm).
- Shaft Keyway Depth: t₁ = 4.0 mm.
- Hub Keyway Depth: t₂ = 3.3 mm.
- Clearance Verification: t₁ + t₂ = 4.0 + 3.3 = 7.3 mm > h = 7.0 mm (+0.3 mm radial clearance).
- Workshop Caliper Inspection: Shaft depth check d − t₁ = 30.0 − 4.0 = 26.0 mm.
Worked Example — Imperial (ANSI B17.1)
Scenario: An industrial drive shaft has a nominal diameter of d = 1.000 in. Determine standard key and keyseat dimensions per ANSI/ASME B17.1.
- Shaft Diameter: d = 1.000 in.
- Diameter Range: The ANSI B17.1 standard assigns shaft range 7/8" to 1-1/4".
- Standard Key Size: 1/4 in Square (W = H = 0.2500 in).
- Shaft Keyseat Depth: t₁ = H / 2 = 0.1250 in (1/8 in).
- Hub Keyway Depth: t₂ = H / 2 = 0.1250 in (1/8 in).
- Direct Caliper Inspection: Shaft bottom dimension d − t₁ = 1.0000 − 0.1250 = 0.8750 in (7/8 in).
Design Limitations & Stress Verification
Structural & Fatigue Design Scope
This calculator determines standardized geometric dimensions per DIN 6885-1 and ANSI B17.1. A complete mechanical joint verification must include:
- Key Shear Stress: τ = 2T / (d · b · L) ≤ 0.577 · S_y / n per Distortion Energy Theory.
- Compressive Bearing Stress: σ_b = 2T / (d · t₁ · L) ≤ S_y / n (commonly governs key length L).
- Shaft Keyway Stress Concentration: Sharp keyseat corners introduce stress concentration factors (K_t ≈ 2.0 to 3.0). Always specify corner fillet radius r to prevent rotational fatigue fractures per Peterson (1932).
- Shaft Critical Speeds: Keyways slightly reduce shaft moment of inertia; evaluate torsional and lateral dynamics using our Shaft Critical Speed Calculator.
- Pre-Tapped Fasteners: Ensure set screw holes over the keyseat are drilled with proper tap pre-holes using our Tap Drill Calculator.
Frequently Asked Questions
What is the difference between a keyseat and a keyway?
In engineering terminology, the slot machined into the cylindrical shaft surface is called the keyseat, whereas the matching internal groove broached or slotted through the hub bore is termed the keyway. In casual shop practice, “keyway” is often used interchangeably for both.
Why is the sum of metric keyway depths (t₁ + t₂) greater than key height (h)?
Under DIN 6885-1 and ISO 773, the sum t₁ + t₂ is intentionally larger than h (typically by 0.1 to 0.5 mm) to provide standardized radial clearance at the top of the key. This ensures the key never bottoms out vertically, forcing torque to be transmitted strictly through the vertical side flanks.
How do I inspect shaft keyway depth on the shop floor?
Machinists measure from the bottom floor of the keyseat directly across to the opposite outer diameter of the shaft using a vernier caliper or micrometer. The target caliper reading is d − t₁.
Can I use this calculator for Woodruff keys or spline shafts?
This calculator is specifically calibrated for parallel metric (DIN 6885-1) and imperial (ANSI B17.1) keys. For semi-circular Woodruff keys, refer to DIN 6888 or ANSI B17.2; for splined shafts, refer to ISO 4156 or ANSI B92.1.
References & Academic Literature
Authoritative Standards
- ISO/R 773:1969 / ISO 773:1978. Rectangular or square parallel keys and their keyways (Dimensions in millimetres). International Organization for Standardization. [ISO 773 Standard Specification]
- ANSI/ASME B17.1-1967 (R2013). Keys and Keyseats. American Society of Mechanical Engineers. [ASME B17.1 Standard]
- Oberg, E., Jones, F. D., Horton, H. L., & Ryffel, H. H. (2020). Machinery's Handbook (31st ed.). Industrial Press. Keys, Keyseats, and Power Transmission.
- Budynas, R. G., & Nisbett, J. K. (2020). Shigley's Mechanical Engineering Design (11th ed., Ch. 7: Shafts and Shaft Components). McGraw-Hill Education.
Peer-Reviewed Research Papers
- Peterson, R. E. (1932). Fatigue of shafts with keyways. Proceedings of the American Society for Testing and Materials (ASTM), 32(2), 413–420.
- Fessler, H. (1957). Photoelastic determination of stresses in keyed shaft connections. Proceedings of the Institution of Mechanical Engineers, 171(1), 633–646. [DOI: 10.1243/PIME_PROC_1957_171_056_02]
- Orthwein, W. C. (1979). Shaft keyway stress concentration factors under torsional and bending fatigue. ASME Journal of Mechanical Design, 101(2), 248–254. [DOI: 10.1115/1.3454058]
Engineering Disclaimer
This calculator provides standard-based dimensional lookups for parallel key and keyway selection. It does not replace a comprehensive finite element or fatigue stress verification of shaft, key, and hub assemblies under dynamic shock loads. Always verify allowable shearing and bearing limits against material specifications.