Keyway Size Calculator

Enter a shaft diameter to get the key size, shaft keyseat depth and hub keyway depth, plus the S and T (or d − t1 and d + t2) dimensions you check with calipers. Inch rows follow ASME B17.1 (square or rectangular keys, shafts 5/16 to 30 in); metric rows reproduce legacy DIN 6885-1:1968 (6 to 500 mm) with ISO 286 width fits.

Pick the key from the shaft diameter range, then cut the shaft keyseat to half the key height (ASME B17.1) or to t1 (DIN 6885), and the hub keyway to H/2 + 0.005 in or t2.

Use the Keyway Size Calculator

Shaft Input

Quick examples

Enter a shaft diameter on the left to see standard keyway dimensions.

Copied!

Quick answer

Pick the key from the shaft diameter range, then cut the shaft keyseat to half the key height (ASME B17.1) or to t1 (DIN 6885), and the hub keyway to H/2 + 0.005 in or t2. Depths are measured at the side wall; because the shaft is round, the cut from the shaft crown is deeper by the chordal height.

Examples

Shaft diameterKey W × HShaft depthHub depth
3/4 in3/16 × 3/16 in0.0938 in0.0988 in
1 in1/4 × 1/4 in0.1250 in0.1300 in
1-1/2 in3/8 × 3/8 in0.1875 in0.1925 in
12 mm4 × 4 mm2.5 mm1.8 mm
40 mm12 × 8 mm5.0 mm3.3 mm

Enter your shaft diameter for key size, shaft and hub depths, S/T dimensions and fit tolerances.

Summary

A keyseat is a slot cut into a shaft and a matching keyway is cut into a hub or gear. This calculator maps a shaft diameter to the standard parallel-key row, then works out the depths a machinist needs: shaft and hub depth at the side wall, the chordal height Y = (D − √(D² − W²))/2, the total cutter depth from the shaft surface, and the caliper dimensions across the shaft (S or d − t1) and across the bore (T or d + t2). Metric results add ISO 286 width deviations for normal, close and free fits. It is a reference aid, not a substitute for the licensed current standard, the controlled drawing, torque sizing or inspection.

How it works

  1. Enter the shaft diameter in either inches (ANSI) or millimeters (DIN/metric).
  2. Select the applicable standard: ANSI B17.1 or DIN 6885.
  3. The tool selects the table interval that actually contains the entered diameter; it does not round to a nearby shaft size.
  4. Key width and height, shaft and hub depths, chordal height, cutter depth and the S/T (d − t1, d + t2) dimensions are calculated.
  5. Inch results use the ASME B17.1 depth-control formulas S = D − Y − H/2 and T = D − Y + H/2 + 0.005; metric results add ISO 286 width deviations for the chosen fit.
  6. Copy any value to clipboard with one click for use in drawings or CNC programs.

Use cases

  • Selecting keyway dimensions during mechanical shaft design.
  • Verifying dimensions on a machinist or engineering drawing.
  • Specifying key stock size when ordering hardware.
  • Cross-checking ANSI vs. DIN equivalents on international projects.
  • Teaching students standard shaft-key fitting principles.
  • Quick field reference on a tablet or phone without paper charts.

Frequently Asked Questions

Last updated: 2026-10-09 · Reviewed by Nham Vu