Keyway Size Calculator
Determine standard keyway dimensions from shaft diameter using ANSI/DIN tables. Enter values for instant results with step-by-step formulas.
Reviewed by Daniel Agrici, Founder & Lead Developer
Formula
Key size is determined by shaft diameter from ANSI B17.1 or DIN 6885 tables
Standard keyway dimensions are selected based on the shaft diameter range. The key width and height increase with shaft diameter according to standardized tables. Shaft keyseat depth is approximately half the key height plus clearance.
Worked Examples
Example 1: Standard Keyway for 25mm Shaft
Problem:Determine the standard keyway dimensions for a 25mm diameter shaft using ANSI B17.1.
Solution:Shaft diameter: 25mm falls in the 22-30mm range\nKey width (w) = 8mm\nKey height (h) = 7mm\nShaft keyseat depth = 7/2 + 0.1 = 3.6mm\nHub keyseat depth = 7 - 3.6 + 0.1 = 3.5mm\nRecommended key length = 1.5 x 25 = 37.5mm (use 38mm)
Result:Key: 8mm x 7mm | Shaft depth: 3.6mm | Hub depth: 3.5mm | Length: ~38mm
Example 2: Keyway for Large Industrial Shaft
Problem:Find keyway dimensions for a 75mm shaft driving a heavy-duty gearbox coupling.
Solution:Shaft diameter: 75mm falls in the 65-75mm range\nKey width (w) = 20mm\nKey height (h) = 12mm\nShaft keyseat depth = 12/2 + 0.1 = 6.1mm\nHub keyseat depth = 12 - 6.1 + 0.1 = 6.0mm\nRecommended key length = 1.5 x 75 = 112.5mm
Result:Key: 20mm x 12mm | Shaft depth: 6.1mm | Hub depth: 6.0mm | Length: ~112mm
Frequently Asked Questions
What is a keyway and what is its purpose in mechanical design?
A keyway is a slot machined into a shaft and a matching slot (called a keyseat) in the hub of a gear, pulley, or coupling that together hold a key to transmit torque between the shaft and the mounted component. The key prevents relative rotation between the shaft and the hub while allowing the component to slide axially for assembly and disassembly. Keyways are one of the most common and economical methods of transmitting torque in mechanical power transmission systems. They are used in applications ranging from small electric motors to large industrial machinery, providing a positive drive connection that is simple to manufacture and maintain.
How do I determine the correct keyway size for my shaft?
The correct keyway size is determined primarily by the shaft diameter using standardized tables from ANSI B17.1 or DIN 6885. These standards specify the key width and height based on the shaft diameter range. For example, a 25mm shaft uses an 8mm wide by 7mm tall key according to both standards. The key length is typically determined by the hub width of the component being mounted and the torque requirements. Always use the standard dimensions unless specific engineering analysis shows different dimensions are needed. Using non-standard keyway sizes makes replacement keys difficult to source and increases manufacturing costs.
What is the difference between ANSI and DIN keyway standards?
ANSI B17.1 is the American standard while DIN 6885 is the European (German) standard for parallel keys and keyways. Both standards define very similar key cross-sections for given shaft diameter ranges, and in many cases the dimensions are identical. The main differences are in tolerances, fit classes, and some dimensional preferences at certain shaft sizes. ANSI tends to use fractional inch sizes for imperial shafts while DIN uses metric dimensions throughout. When designing new equipment choose the standard that matches your market and supply chain. For replacement parts identify which standard the original equipment used by measuring the existing keyway dimensions carefully.
What are the different types of keys used in keyway connections?
Several types of keys are used in mechanical design, each suited to different applications. Square keys have equal width and height and are used for shaft diameters up to about 22mm. Rectangular (flat) keys are wider than they are tall and used for larger shafts where the deeper shaft keyseat would weaken the shaft too much. Woodruff keys are semicircular and self-aligning, commonly used in tapered shaft applications and automotive transmissions. Gib-head keys have a head that allows removal without access to both ends and are used where the key must be driven out from one end. Round (pin) keys are simple and inexpensive for light-duty applications.
References
Reviewed by Daniel Agrici, Founder & Lead Developer ยท Editorial policy