Keyway & Keyseat Calculator

Type the shaft diameter and get the parallel key, the shaft keyseat and hub keyway sizes, their width tolerances for the fit you want, the check sizes to measure, a key length and an optional strength check. DIN 6885-1 (metric) or ANSI B17.1 (inch).

1. Shaft and standard

2. Key length and strength

mm
MPa
Uses the uniform-pressure method: shear on the key width and crushing on the shorter contact face, allowed shear 0.577 × yield ÷ SF, allowed pressure yield ÷ SF.

Results JS engine

Shaft Hub Key

Sizes from DIN 6885-1 / ISO 773 and ANSI B17.1; width limits from ISO 286. Check them against your copy of the standard before cutting.

How the Keyway Calculator Works

A parallel key sits half in the shaft and half in the hub. The standards fix the key size from the shaft diameter, and how deep the keyseat goes into the shaft and the keyway into the hub. This calculator looks the sizes up, adds the width tolerances for the fit you choose and works out the sizes you can actually measure.

The Formulas

DIN 6885-1 (metric)
shaft check size = d − t1
hub check size = d + t2
t1 and t2 come from the table for each shaft range. Both are + tolerances: +0.1 mm for keys up to 6 mm high, +0.2 up to 18 mm and +0.3 above, so d − t1 is 0/−tol and d + t2 is +tol/0. The key top clears the keyway by t1 + t2 − h.
ANSI B17.1 (inch)
Y = (D − √(D² − W²)) ÷ 2
S = D − Y − H/2   T = D − Y + H/2 + C
Y is the height of the arc cut off by the keyseat. The keyseat goes H/2 deep at its side wall; the hub keyway goes H/2 + C, with C = 0.005 in for parallel keys. S is measured from the keyseat bottom to the far side of the shaft, T from the keyway bottom to the far side of the bore. Depth tolerance is +0.010 in, so S is 0/−0.010 and T is +0.010/0.
Width tolerances
DIN keys are h9 wide (h11 high for flat keys). The keyseat and keyway widths follow ISO 286: free fit H9 shaft and D10 hub (the hub can slide), normal fit N9 and JS9, tight fit P9 in both. ANSI Class 1 pairs undersize bar stock keys with plus-toleranced keyseats for a clearance fit; Class 2 uses oversize key stock for a close side fit.
Strength check
F = 2T ÷ d   τ = F ÷ (b·le)   p = F ÷ (k·le)
τallow = 0.577·Sy ÷ SF   pallow = Sy ÷ SF
le is the straight bearing length: l − b for round ends, l for square ends. k is the shorter contact face: h − t1 in the hub or t1 in the shaft (DIN), H/2 (ANSI). Use the yield strength of the weakest part. Crushing usually decides.

Worked Examples

Ø25 mm shaft, DIN 6885-1, normal fit
  • 25 mm falls in "over 22 up to 30": key 8 × 7, t1 = 4.0, t2 = 3.3 (+0.2).
  • Shaft check size 25 − 4 = 21.0 mm (0/−0.2); hub check size 25 + 3.3 = 28.3 mm (+0.2/0). Clearance over the key 4 + 3.3 − 7 = 0.3 mm.
  • Normal fit: shaft keyseat 8 N9 = 8.000 / 7.964, hub keyway 8 JS9 = 8 ± 0.018.
  • 100 N·m on a 32 mm round-ended key, 1045 cold drawn (530 MPa), SF 2: F = 2 × 100 ÷ 0.025 = 8,000 N, le = 24 mm, τ = 41.7 MPa, p = 8,000 ÷ (3 × 24) = 111 MPa. Safety factor 4.77 on crushing; the key could be as short as 18.1 mm.
1 in shaft, ANSI B17.1, Class 1
  • 1 in falls in "over 7/8 to 1-1/4": 1/4 in square key.
  • Y = (1 − √(1 − 0.0625)) ÷ 2 = 0.0159 in.
  • S = 1 − 0.0159 − 0.125 = 0.859 in; T = 1 − 0.0159 + 0.125 + 0.005 = 1.114 in. These match the published B17.1 depth tables.
  • Class 1: key 0.250 (0/−0.002), keyseat 0.250 (+0.002/0).

Measuring a Keyseat

  • Shaft: put a micrometer or caliper across from the keyseat bottom to the far side of the shaft. That is the check size (d − t1 or S). It avoids guessing where the round top of the shaft was.
  • Hub: measure from the keyway bottom across to the far side of the bore with an inside micrometer, a bore gauge over a gauge block, or a keyway gauge. That is d + t2 or T.
  • Width: a gauge block or the key itself should slide in with the fit you chose. Width tolerances are tight (about 0.04 mm), so broach, slot or wire-cut the keyway; a laser or plasma cut keyway needs finishing.
  • Making the hub: the DXF Part Maker draws hubs, gears, sprockets and pulleys with this keyway at nominal size. Use the button above to open it with your shaft size.

Frequently Asked Questions

Normal fit (shaft N9, hub JS9) for most gears, pulleys and couplings fixed on a shaft. Free fit (H9 / D10) when the hub must slide along the key. Tight fit (P9 / P9) for reversing, shock or vibrating loads, where any play hammers the key. In inch work, Class 1 is the usual clearance fit and Class 2 the closer side fit.

The depth t1 starts at the top of the round shaft, which has been cut away, so you cannot put a tool on it. The size from the keyseat bottom to the far side of the shaft is easy to measure with a micrometer, and drawings usually give it.

Usually about 1 to 1.5 times the shaft diameter and a little shorter than the hub. Longer keys do not share the load evenly; if the strength check needs more than about 1.5 × d, use two keys at 180°, a bigger shaft or a spline. DIN 6885 lists standard lengths from 6 to 400 mm.

Yes, pick it under Key size. The table size balances key strength with the metal left in the shaft and hub. A bigger key weakens the shaft; a smaller one carries less torque. The calculator flags a changed size so you remember to check both.

It checks the key itself for shear and crushing with even pressure along the key, the usual first check. It does not cover shaft fatigue at the keyseat end, which has a stress concentration, or shock loads. Use a bigger safety factor for shock and check the shaft too.

Pick the standard of the key you will buy. You can type the shaft in either unit: the calculator converts it, works in the standard's own units and shows the other unit alongside. Mixing standards between a shaft and a hub will not fit.

Key sizes, depths and lengths follow DIN 6885-1 / ISO 773 and ANSI B17.1 (the ANSI sizes reproduce the published S and T depth values), and the full tables are in the Keyway and Key Size Chart. ANSI Class 1 and 2 width tolerances are as given in Machinery's Handbook. Check critical sizes against your copy of the standard.