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.
Key Size
Dimensions
Fits and depth tolerances
Cross-section reference
W = key width; t1 = shaft keyseat depth; t2 = hub keyway depth. S and T are the caliper dimensions across the shaft and across the bore.
Edition and manufacturing check
The inch result is a preliminary lookup aligned to the shaft/key size relationship covered by ASME B17.1-1967 (S2023). Verify all dimensions and tolerances in the licensed standard and controlled drawing.
Official references: ANSI/ASME B17.1-1967 (S2023) · DIN 6885-1:2021-11.
Diameter out of range
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 diameter | Key W × H | Shaft depth | Hub depth |
|---|---|---|---|
| 3/4 in | 3/16 × 3/16 in | 0.0938 in | 0.0988 in |
| 1 in | 1/4 × 1/4 in | 0.1250 in | 0.1300 in |
| 1-1/2 in | 3/8 × 3/8 in | 0.1875 in | 0.1925 in |
| 12 mm | 4 × 4 mm | 2.5 mm | 1.8 mm |
| 40 mm | 12 × 8 mm | 5.0 mm | 3.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
- Enter the shaft diameter in either inches (ANSI) or millimeters (DIN/metric).
- Select the applicable standard: ANSI B17.1 or DIN 6885.
- The tool selects the table interval that actually contains the entered diameter; it does not round to a nearby shaft size.
- Key width and height, shaft and hub depths, chordal height, cutter depth and the S/T (d − t1, d + t2) dimensions are calculated.
- 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.
- 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.