Skip to main content
Industrial Free Pro Features Available

Shaft & Keyway Sizing Calculator

Size shafts from torque loads and select ANSI standard keys and keyways per ANSI B17.1 and Machinery's Handbook

Free shaft and keyway sizing calculator for mechanical engineers, millwrights, and industrial maintenance professionals. Enter the transmitted horsepower, RPM, and service factor to calculate the required shaft diameter based on shear stress. Then select the shaft size to get the standard ANSI B17.1 square or rectangular key dimensions, width, height, keyway depth in shaft, keyway depth in hub, and recommended tolerances. Checks key shear and compressive bearing stress against material allowables. Supports common shaft materials (1045, 4140, 4340, 316 SS) with their allowable stress values.

Pro Tip: The keyway weakens the shaft, it creates a stress concentration and removes material from the cross-section. A standard rule of thumb is to increase the calculated shaft diameter by 15-25% when a keyway is present. For intermittent or shock loads, use a service factor of 1.5 to 3.0 from AGMA standards. The most common field failure is key roll-over (compressive bearing failure), not key shear, check both stresses.

PREVIEW All Pro features are currently free for a limited time. No license key required.

Shaft & Keyway Calculator

How It Works

  1. Enter the Load

    Enter the transmitted horsepower (or kW) and shaft RPM. Select a service factor based on the driven equipment, 1.0 for uniform loads, 1.25-1.5 for moderate shock, 2.0-3.0 for heavy shock or reversing loads.

  2. Select Shaft Material

    Choose the shaft material to set the allowable shear stress. Common choices: 1045 steel (general purpose), 4140 (heat-treatable, higher strength), 4340 (high-strength, critical applications), 316 SS (corrosion resistance).

  3. Review Shaft Diameter

    The calculator shows the minimum shaft diameter based on torsional shear stress and the next standard shaft size. If a keyway is present, the tool increases the diameter to compensate for the stress concentration.

  4. Get Key and Keyway Dimensions

    For the selected shaft diameter, the calculator outputs the standard ANSI B17.1 key width, height, keyway depth (shaft and hub), length recommendation based on the applied torque, and both shear and compressive bearing stress on the key.

Built For

  • Mechanical engineers sizing drive shafts for conveyors, mixers, and pumps
  • Millwrights selecting replacement keys for worn keyways during equipment rebuilds
  • Maintenance engineers verifying that an existing shaft can handle an increased load after a motor upgrade
  • Machine designers specifying key and keyway tolerances for new shaft-to-hub connections
  • Students learning the ANSI B17.1 standard key sizing system and shaft stress calculations

Assumptions

  • The shaft is loaded in pure torsion, bending loads, axial loads, and combined loading require additional analysis.
  • Key dimensions follow ANSI B17.1 standard square or rectangular key proportions.
  • Material properties are for the normalized or quenched-and-tempered condition as specified, actual values depend on heat treatment.

References

  • ANSI B17.1, Keys and Keyseats
  • Machinery's Handbook, 31st Edition, Shafts, Keys, and Couplings sections
  • ASME B106.1M, Design of Transmission Shafting
  • Shigley's Mechanical Engineering Design, 11th Edition, Shaft and key design chapters

Frequently Asked Questions

From the basic torsional shear formula: T = HP × 63,025 / RPM (for torque in in-lbs), then d = (16T / (π × allowable shear stress))^(1/3). The allowable shear stress is typically 30-50% of the yield strength, depending on the design code and the service factor applied.
ANSI B17.1 (Keys and Keyseats) defines standard dimensions for square and rectangular keys based on shaft diameter. For shafts up to about 6.5 inches, the standard specifies a square key (width = height). Above that, rectangular keys are standard (width > height). The standard also defines keyway depth, corner radius or chamfer, and fit classes (Class 1 for light fit, Class 2 for tight fit, Class 3 for interference fit).
The key bears against the side of the keyway with only half its height in contact (half in the shaft, half in the hub). The bearing area is width × length × 0.5, while the shear area is width × length. Since the bearing area is half the shear area, compressive stress is twice the shear stress for the same load. In practice, keys almost always fail by rolling over (compressive crushing of the keyway wall) rather than shearing through the middle.
The key length should be enough to keep both shear and compressive stresses within allowables. A starting rule: the key length should be about 1.5 times the shaft diameter for moderate loads. The maximum practical length is limited by the hub length and the difficulty of maintaining alignment over long keys. If the required key length exceeds the hub length, consider using two keys 180° apart or switching to a spline connection.
Disclaimer: This calculator provides shaft and keyway sizing estimates based on standard engineering formulas and ANSI B17.1 dimensions. Actual shaft design must consider bending loads, fatigue, critical speed, and specific application requirements. Verify critical shaft designs with a licensed professional engineer.

Learn More

Industrial

Shaft and Keyway Sizing: Torque, Stress, and ASME B17.1

How to select key size for a given shaft diameter and torque. Shear and bearing stress calculations, standard key dimensions, and common failure modes.

Related Tools

Industrial Live

Air Compressor Leak Calculator

Find out how much compressed air leaks cost your facility per year. Enter leak count, system pressure, and electricity rate to see CFM losses, kW waste, and annual dollars wasted.

Industrial Live

Compressed Air System Sizing & Cost Calculator

Size your shop air compressor based on real tool CFM demand with duty cycles. Get HP recommendations, pipe sizing, receiver tank sizing, and true 5-year operating cost comparison.

Industrial Live

Concrete Volume Calculator

Calculate how many cubic yards of concrete to order. Accounts for overdig, pour-specific waste factors, and short load fees. Supports slabs, footings, walls, columns, and steps.