Key and Keyway Calculator
Calculate shear and compressive stress in shaft keys and look up standard ANSI key sizes by shaft diameter
This free online key and keyway calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Supports both metric (SI) and imperial units with built-in unit selection dropdowns on every input field, so you can work in whatever units your problem provides. Designed for engineering students and professionals working through coursework, design projects, or quick reference calculations.
Key and Keyway Calculator
Calculate shear and compressive stresses in shaft keys with standard ANSI key size lookup.
Formulas
ANSI Recommended Key for d = 50.0 mm
w × h = 14 × 9 mm (shaft range 44–50 mm)
Results
Shear Stress τ
28.57 MPa
FOS = 2.800
Compressive Stress σ
88.89 MPa
FOS = 1.800
Governing FOS (compression controls)
1.800
How to Use This Calculator
Enter your input values
Fill in all required input fields for the Key and Keyway Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.
Review your inputs
Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.
Read the results
The Key and Keyway Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.
Explore parameter sensitivity
Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.
Formula Reference
Key and Keyway Calculator Formula
See calculator inputs for the governing equation
Variables: All variables and their units are labeled in the calculator interface above. Input fields accept values in multiple unit systems — select your preferred unit from the dropdown next to each field.
When to Use This Calculator
- •Use the Key and Keyway Calculator when solving homework or exam problems that require quick numerical verification of your hand calculations — instant feedback helps identify arithmetic errors before they propagate.
- •Use it during the early design phase to rapidly iterate on parameters and narrow down feasible configurations before committing time to detailed finite element simulations or full design packages.
- •Use it when reviewing a colleague's calculation or checking a vendor's data sheet for plausibility — a quick sanity check can prevent costly downstream errors.
- •Use it to generate reference data for a technical report or presentation without manual computation, ensuring consistent, reproducible numbers throughout the document.
- •Use it in the field when a quick estimate is needed and a full engineering software package is not available.
About This Calculator
The Key and Keyway Calculator is a precision engineering calculation tool designed for students, engineers, and technical professionals. Calculate shear and compressive stress in shaft keys and look up standard ANSI key sizes by shaft diameter All calculations are performed using established engineering formulas from the relevant scientific literature and standards. Inputs support both metric (SI) and imperial unit systems, with unit conversion handled automatically — simply select your preferred unit from the dropdown next to each field. Results are computed instantly in the browser without sending data to a server, ensuring both speed and privacy. This calculator is intended as a supplementary tool for learning and design exploration; always verify results against authoritative references for safety-critical applications.
The Theory Behind It
Shaft keys transmit torque between a shaft and a hub (gear, pulley, sprocket). Standard key dimensions follow ANSI B17.1: for shaft diameter d, the square or rectangular key has width w ≈ d/4 and length determined by torque requirements. The key sees both shear and compression (bearing) stress. Shear stress τ = F/(w·L) = T/(r·w·L), where F is the tangential force at the shaft surface, r is shaft radius, w is key width, and L is key length. Compression (bearing) stress σ = F/((h/2)·L), where h is key height. Design checks both stresses against allowable values. For rectangular keys, the height h typically equals the width w (square key) or is slightly smaller. The typical failure mode is shear on the plane through the middle of the key; bearing failure on the keyway walls is less common. Keyway stress concentration reduces shaft strength by 15-25%, which is why reported shaft yields include this factor. Woodruff keys (semicircular) and tapered keys are alternatives for specific applications. Splines (multiple parallel keys cut into the shaft) handle higher torques than single keys with less stress concentration.
Real-World Applications
- •Gear-to-shaft connections in gearboxes, transmissions, and machine drives.
- •Pulley and sprocket attachment to shafts in belt and chain drives.
- •Coupling-to-shaft connections for motor shaft and machinery shafts.
- •Impeller-to-shaft in pumps and compressors.
- •Flywheel attachment in engines and punch presses.
Frequently Asked Questions
How do I size a shaft key?
Select width w = d/4 from standard tables for the shaft diameter d. Compute required length from shear: L_shear ≥ 2T/(w·d·τ_all). Compute required length from bearing: L_bearing ≥ 4T/(h·d·σ_all). Use the longer of the two. Round up to a standard length from ANSI B17.1.
What's the difference between shear and bearing stress in a key?
Shear stress is the tangential force divided by the key's cross-sectional area perpendicular to that force (w·L). Bearing stress is the normal force from the key pressing on the keyway wall, divided by (h/2)·L (half the key height times length). Both must be checked; usually shear governs for short keys, bearing governs for long keys.
Why does a keyway reduce shaft strength?
The keyway is a geometric stress concentration — it removes material from a critical location and creates sharp corners that amplify local stress. Stress concentration factor Kt ≈ 2-3 for typical keyways. For fatigue analysis, the notch reduction factor Kf is slightly less but still significant. This is why keyed shafts are designed to lower allowable stress than unkeyed shafts (AISC reduces allowable by 25%).
What's a Woodruff key?
A semicircular (half-disc) key that fits into a slotted keyway cut in the shaft. Used for smaller shafts where the semi-circular seat provides better alignment and lower assembly stresses. The key itself is weaker than a rectangular key but easier to install and remove. Common in automotive flywheels, small gears, and instrument shafts.
Can I use splines instead of keys?
Yes. Splines (multiple parallel grooves cut into the shaft and hub) distribute torque over many contact points, reducing stress and increasing capacity. Involute splines are most common for automotive and machine tool applications. Splines cost more than keys but carry 2-4× the torque and have much better fatigue performance.
Related Calculators
Shaft Design Calculator
Design solid and hollow shafts under combined bending and torsion using ASME distortion energy criteria
Bearing Life Calculator
Calculate L10 bearing life in revolutions and hours for ball and roller bearings using basic dynamic load rating
Belt Drive Calculator
Calculate belt length, speed ratio, belt tensions, and required belt width for V-belt and flat-belt drives
Helical Spring Design Calculator
Calculate spring rate, deflection, and shear stress with Wahl correction factor for helical compression springs
Bolt Preload Calculator
Calculate bolt preload, torque requirements, and joint clamping force using the torque-tension relationship T = KFd
Weld Strength Calculator
Calculate allowable load and factor of safety for fillet and butt welds under shear, tension, and bending loads