Shaft Key Size Calculator
Standard parallel key and keyseat depths for a shaft diameter from ASME B17.1 or DIN 6885, plus the key length needed for shear and crushing at your torque.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the Shaft Key Size Calculator?
Enter the shaft diameter and the torque (or power and speed). The key size calculator picks the standard parallel key for that diameter, from ASME B17.1 for inch shafts or DIN 6885-1 for metric ones, gives the keyseat depth in the shaft and the keyway depth in the hub, and works out how long the key has to be so it neither shears nor crushes.
The length check follows Shigley's Mechanical Engineering Design (section 7-7): the torque becomes a force F = 2T/d at the shaft surface, the key must carry it in shear across its width, and its side faces must carry it in bearing on the part of the key that projects into the hub: half the key height for ASME B17.1, and h − t1 for DIN 6885-1, whose keyseat is cut deeper into the shaft. Crushing uses the weakest of the key, shaft and hub. The larger of the two lengths is rounded up to the next DIN 6885 standard length (adding the key width for a round-ended form A key, which bears only on l − b) or the next 1/8 in. Give a hub length and the calculator also shows the longest standard key that fits in the hub, with its stresses and factors of safety, and it warns when a key would be longer than the hub or than about 1.5 shaft diameters.
Metric defaults are a 30 mm gearbox shaft carrying 144.9 N·m. Switch to inch and the inputs become Shigley's Example 7-6: a 1 7/16 in shaft transmitting 40 hp at 600 rpm, which takes a 3/8 in square key at least 1.34 in long.
- ASME B17.1 square and rectangular keys for 5/16 to 6 1/2 in shafts
- DIN 6885-1 keys for 6 to 500 mm shafts with t1, t2 and length ranges
- Required length for shear and crushing, with the governing mode
- Next standard length, factors of safety and warnings for long keys
- Torque or power and speed input
- Copy and share; runs entirely in your browser
Updated
How to use the Shaft Key Size Calculator
- Choose metric (DIN 6885) or inch (ASME B17.1). For inch, pick square or rectangular keys.
- Enter the shaft diameter at the keyseat.
- Enter the torque, or switch to power and speed. Use the peak torque the joint will see.
- Enter the yield strength of the key and of the weaker of shaft and hub, the design factor and, optionally, the hub length.
- Read the key size, keyseat depths, the length needed for shear and for crushing, and the standard length to use. The table below highlights the row for your shaft.
Worked examples
Shigley Example 7-6
Input
Inch, 1.4375 in shaft, 40 hp at 600 rpm, key Sy 65 kpsi, shaft Sy 75 kpsi, n = 2.8
Output
3/8 × 3/8 in key; shear 1.16 in, crushing 1.34 in; use 1-3/8 in
T = 63,025 × 40 / 600 = 4,202 lbf·in and F = 2T/d = 5,846 lbf. Crushing governs. The textbook notes that a key as long as the hub, usually longer than the shaft diameter, has ample strength.
Metric gearbox shaft
Input
30 mm shaft, 144.9 N·m, key Sy 390 MPa (1020 CD), hub Sy 490 MPa, n = 2, hub 40 mm
Output
8 × 7 mm form A key, t1 = 4.0 mm, t2 = 3.3 mm; needs 16.5 mm of bearing length, so 25 mm; a 40 mm key fills the hub
F = 2 × 144,900 / 30 = 9,660 N. Shear needs 10.7 mm and crushing on h − t1 = 3 mm needs 16.5 mm. A round-ended key bears on l − 8, so the shortest standard key is 25 mm. The 40 mm key that fills the hub bears on 32 mm: 100.6 MPa, factors 5.96 in shear and 3.88 in crushing.
A 30.01 mm shaft
Input
Shaft just over 30 mm
Output
10 × 8 mm key
Ranges are "over, up to and including", so 30 mm takes 8 × 7 and anything larger takes the next size up.
Background and insight
A parallel key sits half in a keyseat milled into the shaft and half in a keyway broached into the hub. Torque passes from shaft to key through one side face and from key to hub through the other, so the key is loaded in shear on the plane where shaft and hub meet and in bearing (crushing) on its side faces. Key sizes are standardised by shaft diameter so that the key, keyseat cutters and broaches are interchangeable: ASME B17.1-1967 for inch shafts, which ASME lists as 1967 (S2023), kept under its stabilized maintenance option, and DIN 6885-1 (current edition 2021-11) for metric shafts. The DIN widths and heights are the same as in the 1969 ISO Recommendation ISO/R 773, which ISO lists as withdrawn since 1998.
In ASME B17.1 the key is square up to a 6 1/2 in shaft, with a rectangular (flat) option, and the keyseat is half the key height deep in both shaft and hub. DIN 6885-1 keys are rectangular above 22 mm (8 × 7 for a 30 mm shaft), and the depths are split unevenly: t1 in the shaft and t2 in the hub, with a little clearance above the key. Only h − t1 of the key projects into the hub (3 mm of an 8 × 7 key), so the hub-side bearing face is smaller than half the key height. The table also gives the range of lengths each key size is made in.
Shear stress in the key is F/(w·L). Using the distortion energy theory, the shear yield strength is 0.577 times the tensile yield strength, so L = F·n / (0.577·Sy·w). The bearing stress on the hub-side face of height hb is F/(hb·L), so L = F·n / (Sy·hb), with hb = h/2 in ASME B17.1 and h − t1 in DIN 6885-1. Because hb is always less than 0.577 times the key width for standard keys, crushing needs the longer length, which is why Shigley's Example 7-6 is governed by crushing at 1.34 in rather than shear at 1.16 in. Keys are deliberately made of a softer steel than the shaft, so that in an overload the cheap key fails before the shaft or hub.
Common use cases
Designing a keyed gear, pulley or coupling
Pick the key size for the shaft and check that a key the length of the hub carries the torque.
Machining and repair
Look up keyseat and keyway depths and widths before cutting a shaft or broaching a hub.
Checking an upgrade
See whether an existing key still has margin after a motor upgrade or a change of gear ratio.
Coursework
Work Shigley-style key problems in inch or metric units and see both failure modes.
Tips and limitations
- Use the peak torque, including starting and shock loads. A key that only just passes at running torque will fret and loosen.
- Keep the key no longer than the hub and no longer than about 1.5 times the shaft diameter; beyond that, shaft twist loads one end of the key more than the other. Use two keys at 180°, a spline or a larger shaft instead.
- A keyseat raises the stress in the shaft. Check the shaft at the keyseat with the shaft diameter calculator (Kt about 2.14 in bending and 3.0 in torsion for an end-milled keyseat).
- The ASME B17.1 range here covers shafts over 5/16 in up to 6 1/2 in, where square keys are preferred. For larger inch shafts use the standard directly.
- Fit tolerances (free, normal or close fit) and keyseat width limits are in the standards; this tool gives nominal sizes.
Sources and further reading
- B17.1 Keys and Keyseats, ASME. ASME B17.1-1967 (S2023): key size versus shaft diameter
- DIN 6885-1:2021-11 Drive type fastenings without taper action, parallel keys, keyways - Deep pattern - Part 1: Dimensions, tolerances, mass, DIN Media. Current edition 2021-11
- Shigley's Mechanical Engineering Design, 11th edition, Budynas and Nisbett, McGraw-Hill (record at Missouri S&T). Section 7-7 and Example 7-6 on key strength
Frequently asked questions
What size key do I need for my shaft?
The key size is set by the shaft diameter in the standard tables. For example, a 1 in shaft takes a 1/4 in square key under ASME B17.1 (shafts over 7/8 up to 1 1/4 in), and a 30 mm shaft takes an 8 × 7 mm key under DIN 6885-1 (over 22 up to 30 mm). Only the length depends on the torque.
How do I calculate the required key length?
Find the force at the shaft surface, F = 2T/d. For shear, L = F·n / (0.577·Sy·w); for crushing, L = F·n / (Sy·hb), where hb is the key height projecting into the hub (h/2 for ASME B17.1, h − t1 for DIN 6885-1) and Sy is the weakest material in contact. Use the larger value, add the key width for a round-ended key, and round up to a standard length.
How deep should the keyseat be?
In ASME B17.1 the keyseat is half the key height deep in the shaft and half in the hub, measured at the side of the keyseat. In DIN 6885-1 the depths are listed separately: t1 in the shaft and t2 in the hub, for example 4.0 and 3.3 mm for an 8 × 7 key.
Why is the key made of a weaker material than the shaft?
So that an overload shears the key, which is cheap and quick to replace, rather than damaging the shaft or the hub. Cold-drawn low-carbon steel such as AISI 1020 is a common key material.
Which governs, shear or crushing?
Crushing, for every standard key when the key material is the weakest in the joint, because the bearing face is at most half the key height while the shear plane is the full key width. DIN keys, whose hub-side face is only h − t1, and hubs softer than the key make crushing govern by even more.
What if no standard key length is long enough?
The torque is too high for one key on that shaft. Options are two keys at 180°, a spline, a shrink or press fit, a keyless locking device, or a larger shaft diameter.
Is there an in-depth guide to the Shaft Key Size Calculator?
Yes. “Shaft and Key Sizing: Torsion, Combined Loads and Keyways” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.