Important – use at your own risk. Figures, code and guides on this site are guides only, not professional or technical advice. Always check your machine’s manual and the manufacturer’s limits before use. You are responsible for your own safety and for checking every result. See the disclaimer and terms.

Keyway calculator (metric & inch)

Safety: a key carries the full torque of the drive. If the part matters (motors, gearboxes, lifting), use the maker’s rating, not this page alone, and never leave a sharp-edged key proud on a rotating shaft.
How it works, guides and notes

Enter a shaft diameter to get the standard key, how deep to cut the shaft keyseat and hub keyway, and the dimension to measure so you know when to stop.

How it works

shaft: d − t1hub: d + t2
Measure the shaft with a micrometer from the keyseat floor to the far side (d − t1); measure the hub keyway from its floor across the bore (d + t2).

Metric (DIN 6885-1): the shaft diameter range picks the key section b × h, the shaft depth t1 and the hub depth t2. Depths are measured at the side of the key, but you cannot measure there easily, so the page gives d − t1 and d + t2 to measure across the shaft or bore. Widths come from the chosen fit: N9 / JS9 for a normal fixed key, P9 for a tight key, or H9 / D10 when the hub has to slide along the key. The width limits are worked out from the ISO 286 formulas, so treat them as estimates within a few microns.

Inch (ASME B17.1): the key is square up to 6½" shafts (rectangular is optional). The keyseat is set by the chordal height Y = (D − √(D² − W²)) ÷ 2, giving the shaft dimension S = D − Y − H ÷ 2 and the hub dimension T = D − Y + H ÷ 2 + C, where C is a 0.005" clearance over the key.

Worked example: a 40 mm shaft takes a 12 × 8 mm key. Cut the shaft 5.0 mm deep (measure 35.0 mm across) and the hub 3.3 mm deep (43.3 mm across the bore). At the edge of the keyseat the depth reads about 4.08 mm because the shaft curves away. A 1" shaft takes a ¼" square key: S = 0.8591", T = 1.1141".

On the lathe, a hub keyway is usually cut by slotting with a boring-bar-style tool in the toolpost, racking the carriage by hand in many light strokes; a shaft keyseat is milled with a slot drill or a woodruff-style cutter. Centre the cutter carefully on the shaft axis. Round off the ends of keys, chamfer key edges, and make the bottom corners of the keyseat with a small radius to reduce stress.

Data: DIN 6885-1 (parallel keys, high form) and ASME B17.1 (keys and keyseats), sizes cross-checked between published references; formulas for S, T and Y as given in standard machining references. The standards themselves are not reproduced. Check the current editions for critical work. Related: fits and tolerances, milling feeds, gear cutter picker.

Spotted a mistake? Report an error.