Keyway Calculator (Metric)

Calculate recommended parallel key size and minimum key length using shaft diameter, transmitted torque, allowable shear stress, and allowable crushing stress. Supports torque input directly or power + speed conversion.

Used to select the standard metric key size (b × h).
Unchecked: calculator recommends standard metric key from shaft diameter.
If entered, the calculator will perform pass/fail checks for shear and crushing.
Factored Design Torque
Recommended Key Size
Minimum Length from Shear
Minimum Length from Crushing
Required Minimum Key Length
Governing Failure Mode

Formulas used (N-mm units): Lshear = 2T/(d·b·τallow), Lcrush = 4T/(d·h·σc,allow). T is multiplied by safety factor.

Keyway Calculator Guide: How to Size a Shaft Key Correctly

A keyway calculator is one of the most practical tools in mechanical design when you need to connect a shaft to a hub and transmit torque safely. Whether you are designing a pulley, gear, coupling, sprocket, or flywheel connection, a properly sized key and keyway help prevent slipping, fretting, and sudden failure. This page combines a working keyway calculator with a detailed engineering guide so you can estimate key dimensions faster and make stronger design decisions.

In simple terms, a machine key is a mechanical element that sits partly in the shaft keyseat and partly in the mating hub keyway. As torque is applied, the key transfers load from one component to the other. If the key is undersized, it may fail in shear or crushing (bearing). If it is oversized or improperly fitted, you can create stress concentration, manufacturing issues, or assembly difficulty. Good keyway design balances strength, geometry standards, fit quality, and service conditions.

What This Keyway Calculator Does

Core Key Design Formulas

The calculator uses a widely used first-pass approach for rectangular parallel keys in metric units. Let:

Minimum length from shear:

Lshear = 2T / (d · b · τallow)

Minimum length from crushing:

Lcrush = 4T / (d · h · σc,allow)

Required minimum length is the larger of the two values. A safety factor is normally applied to transmitted torque before these checks.

Standard Metric Key Size Selection (Typical)

For many designs, key width and height are first chosen from standard ranges based on shaft diameter. The table below is a typical quick-reference set commonly used in machine design practice. Always verify against your governing standard and manufacturing tolerance class.

Shaft Diameter d (mm) Recommended Key b × h (mm)
6 to 82 × 2
8 to 103 × 3
10 to 124 × 4
12 to 175 × 5
17 to 226 × 6
22 to 308 × 7
30 to 3810 × 8
38 to 4412 × 8
44 to 5014 × 9
50 to 5816 × 10
58 to 6518 × 11
65 to 7520 × 12
75 to 8522 × 14
85 to 9525 × 14
95 to 11028 × 16
110 to 13032 × 18
130 to 15036 × 20
150 to 17040 × 22
170 to 20045 × 25
200 to 23050 × 28

How to Use the Calculator Step by Step

  1. Enter shaft diameter in millimeters.
  2. Choose torque mode:
    • Torque mode: enter transmitted torque directly.
    • Power + RPM mode: enter power and speed; calculator converts to torque.
  3. Enter allowable shear and crushing stresses for your key/hub material system.
  4. Set design safety factor appropriate to duty cycle and shock loading.
  5. Use standard key size lookup or enable custom b and h values.
  6. Click Calculate to get minimum key length and governing mode.
  7. Optionally input actual key length to verify pass/fail margin.

Engineering Notes for Better Keyway Design

1) Material and Heat Treatment Matter

Allowable stresses should come from credible material data and your design code. Key steel, shaft steel, and hub material can differ, and real failure often starts in the weaker interface. If hub material is soft, crushing may govern before key shear. For hardened shafts with softer keys, wear and fretting also become important in cyclic service.

2) Shock and Reversing Loads

Steady torque sizing is only part of design. Start-stop cycles, impact, misalignment, and reversal can produce peak loads far above nominal values. Increase safety factor for harsh duty and evaluate fatigue where needed. If dynamic loading is severe, splines, interference fits, or alternative coupling strategies may outperform a single key.

3) Effective Length vs. Nominal Length

Nominal key length may be greater than effective load-bearing length due to chamfers, radiused ends, and local contact conditions. Designers often choose a practical standard length above the minimum calculated value. In compact hubs, ensure adequate engagement remains after accounting for edge relief and assembly constraints.

4) Keyway Geometry and Stress Concentration

A keyway introduces a stress raiser in the shaft, reducing torsional capacity relative to a plain shaft. For high-performance rotating systems, check shaft strength with keyway factor corrections and evaluate fatigue stress concentration. The key itself may pass, while the shaft root near the keyseat can become the critical location.

5) Fits, Tolerances, and Manufacturing

Even correctly sized keys can fail early if tolerances are poor. Excessive side clearance can cause impact loading and fretting. Over-tight fits can make assembly difficult and transfer load unpredictably. Use the relevant fit class, ensure quality broaching/milling, and verify key seating depth and parallelism.

Common Keyway Design Mistakes

When to Use Splines Instead of Keys

Keys are cost-effective and easy to manufacture, especially for moderate torque and simple assemblies. However, splines distribute load over multiple teeth and are often preferred for high torque density, frequent assembly/disassembly, precise angular positioning, or axial sliding. If your key length becomes impractically long, or if local contact stress is too high, evaluate a spline design.

FAQ: Keyway Calculator and Key Sizing

What units does this calculator use?

It uses metric units: mm for geometry, N·m for torque input, kW and RPM for power-based conversion, and MPa for allowable stresses.

Can I use custom key dimensions?

Yes. Enable the custom key option and enter width (b) and height (h) manually. This is useful when a legacy machine uses non-default dimensions.

What if my actual key length is less than required?

You should redesign: use a longer key, increase key size where standards allow, reduce transmitted torque, increase material strength/allowables if justified, or switch connection method.

Is this calculator enough for final design approval?

No. It is a first-pass engineering calculator. Final design should include full code compliance, tolerance stack-up, fatigue checks, shaft strength with keyway effects, and manufacturing review.

Why does crushing often govern?

Because contact pressure on the key flank can be high, especially with short hubs or softer materials. In many practical applications, bearing (crushing) sets the required key length before shear does.

Conclusion

A reliable keyway design starts with correct key size selection and minimum length checks under realistic torque and safety assumptions. This calculator helps you get that baseline quickly and consistently. For best results, pair these calculations with material validation, manufacturing tolerance control, and full system-level mechanical review.