Skip to main content

Keyway Size Calculator

Determine standard keyway dimensions from shaft diameter using ANSI/DIN tables. Enter values for instant results with step-by-step formulas.

Skip to calculator
Engineering

Keyway Size Calculator

Determine standard keyway dimensions from shaft diameter using ANSI and DIN tables. Includes key width, height, and keyseat depths.

Last updated: December 2025

Calculator

Adjust values & calculate
25 mm
Key Size for 25mm Shaft (22 - 30 mm)
8 x 7 mm
Width x Height
Shaft Keyseat Depth
3.60 mm
Hub Keyseat Depth
3.50 mm
Recommended Length
37.5 mm
Shear Area
300.0 mmยฒ

ANSI Key Size Reference Table

6-8 mm shaft2 x 2 mm key
8-10 mm shaft3 x 3 mm key
10-12 mm shaft4 x 4 mm key
12-17 mm shaft5 x 5 mm key
17-22 mm shaft6 x 6 mm key
22-30 mm shaft8 x 7 mm key
30-38 mm shaft10 x 8 mm key
38-44 mm shaft12 x 8 mm key
44-50 mm shaft14 x 9 mm key
50-58 mm shaft16 x 10 mm key
58-65 mm shaft18 x 11 mm key
65-75 mm shaft20 x 12 mm key
75-85 mm shaft22 x 14 mm key
85-95 mm shaft25 x 14 mm key
95-110 mm shaft28 x 16 mm key
110-130 mm shaft32 x 18 mm key
Your Result
Shaft: 25mm | Key: 8mm x 7mm | Shaft Depth: 3.60mm | Hub Depth: 3.50mm
Share Your Result
Understand the Math

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.

Last reviewed: December 2025

Worked Examples

Example 1: Standard Keyway for 25mm Shaft

Determine the standard keyway dimensions for a 25mm diameter shaft using ANSI B17.1.
Solution:
Shaft diameter: 25mm falls in the 22-30mm range Key width (w) = 8mm Key height (h) = 7mm Shaft keyseat depth = 7/2 + 0.1 = 3.6mm Hub keyseat depth = 7 - 3.6 + 0.1 = 3.5mm Recommended 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

Find keyway dimensions for a 75mm shaft driving a heavy-duty gearbox coupling.
Solution:
Shaft diameter: 75mm falls in the 65-75mm range Key width (w) = 20mm Key height (h) = 12mm Shaft keyseat depth = 12/2 + 0.1 = 6.1mm Hub keyseat depth = 12 - 6.1 + 0.1 = 6.0mm Recommended key length = 1.5 x 75 = 112.5mm
Result: Key: 20mm x 12mm | Shaft depth: 6.1mm | Hub depth: 6.0mm | Length: ~112mm
Expert Insights

Background & Theory

The Keyway Size Calculator applies the following established principles and formulas. Structural and construction engineering is governed by fundamental load analysis, material science, and regulatory standards that ensure the safety and durability of built structures. The primary distinction in load analysis is between dead loads โ€” the permanent self-weight of structural elements, finishes, and fixed equipment โ€” and live loads, which represent variable occupancy, furniture, and environmental forces such as wind and snow. These are combined using factored load equations, such as the ASCE 7 formula U = 1.2D + 1.6L, where D is dead load and L is live load. Concrete mix design is governed by the water-cement (w/c) ratio, which is the primary determinant of compressive strength and durability. A w/c ratio of 0.40โ€“0.45 typically yields concrete with 28-day compressive strengths of 30โ€“40 MPa. Common mix ratios by weight for structural concrete are approximately 1 part cement : 1.5โ€“2 parts sand : 3 parts coarse aggregate. Structural steel is characterized by its yield strength (the stress at which permanent deformation begins, typically 250โ€“350 MPa for mild steel) and ultimate tensile strength (typically 400โ€“500 MPa). Mid-span deflection of a simply supported beam under a central point load is given by ฮด = FLยณ / (48EI), where F is force, L is span length, E is Young's modulus, and I is the second moment of area. Building insulation is rated by R-value, a measure of thermal resistance in units of mยฒยทK/W (SI) or ftยฒยทยฐFยทh/BTU (imperial). Higher R-values indicate greater resistance to heat flow. Foundation design depends on the allowable bearing capacity of the underlying soil, which ranges from approximately 75 kPa for soft clay to over 10,000 kPa for bedrock. Drainage gradients for surface water are typically specified as a minimum of 1โ€“2% slope away from building foundations to prevent hydrostatic pressure and water infiltration.

History

The history behind the Keyway Size Calculator traces back through the following developments. The history of construction engineering spans thousands of years of accumulated empirical knowledge and, more recently, rigorous scientific analysis. The ancient Egyptians built the Great Pyramid of Giza around 2560 BCE using an estimated 2.3 million stone blocks, demonstrating sophisticated logistics, geometry, and workforce organization. Roman engineers advanced the field dramatically through the use of pozzolanic concrete โ€” a mixture of volcanic ash, lime, and seawater โ€” enabling the construction of the Pantheon dome (43.3 m diameter, completed around 125 CE) and a vast network of aqueducts and roads across the empire. Cast iron emerged as a structural material during the Industrial Revolution, first used prominently in the Iron Bridge at Coalbrookdale, England, completed in 1779. Wrought iron and later steel allowed far greater spans and heights. The Eiffel Tower, completed in 1889, demonstrated the structural possibilities of wrought iron at scale and influenced the development of steel-frame skyscraper construction in Chicago and New York. Reinforced concrete was systematically developed by Joseph Monier, a French gardener, who patented iron-reinforced concrete pots and panels in the 1860s, and later by engineers including Franรงois Hennebique who created the first comprehensive reinforced concrete framing system in the 1890s. The 1906 San Francisco earthquake caused widespread devastation and galvanized the engineering profession to develop seismic design provisions. Subsequent earthquakes โ€” including the 1971 San Fernando and 1994 Northridge events โ€” drove successive improvements in seismic codes, base isolation technology, and ductile detailing of reinforced concrete and steel frames. Building codes became increasingly standardized in the twentieth century, with the International Building Code (IBC) first published in 2000 providing a unified model code adopted across much of the United States. Building Information Modeling (BIM) emerged in the 2000s as a digital workflow integrating architectural, structural, and MEP design into a unified three-dimensional model, fundamentally changing coordination practices across the industry.

Share this calculator

Explore More

Frequently Asked Questions

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.
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.
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.
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.
Standard practice distributes the key height between the shaft keyseat and the hub keyseat. For rectangular keys, the shaft keyseat depth is approximately half the key height plus a small clearance of 0.1 to 0.2mm. The hub keyseat depth is the remaining key height minus the shaft depth plus clearance. This ensures the key fits with slight interference or transition fit in the radial direction. The total of shaft depth plus hub depth should be slightly more than the key height to prevent the key from bottoming out in both slots simultaneously. Precise depth dimensions and tolerances are specified in the relevant standard and should be followed exactly for reliable torque transmission.
Keyways can be machined using several methods depending on the production volume and required accuracy. Broaching is the most common production method for internal hub keyways, producing excellent dimensional accuracy and surface finish in a single pass. Shaping or slotting machines cut keyways using a single-point tool in a reciprocating motion and are common in job shops. Milling with an end mill is used for shaft keyways, cutting either a sled-runner style (open-ended) or profile (closed-ended) keyway. Wire EDM is used for hardened materials or complex shapes. Regardless of method, the keyway must be located accurately relative to the shaft centerline and have the correct width tolerance for the specified fit class.
Educational Note: This calculator is provided for educational and informational purposes. Results are based on the formulas and inputs provided. Always verify important calculations independently. NovaCalculator processes calculator inputs client-side; optional analytics follow visitor consent settings. ยฉ 2024โ€“2026 NovaCalculator.

Share this calculator

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.

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.

How deep should the keyway be cut into the shaft and hub?

Standard practice distributes the key height between the shaft keyseat and the hub keyseat. For rectangular keys, the shaft keyseat depth is approximately half the key height plus a small clearance of 0.1 to 0.2mm. The hub keyseat depth is the remaining key height minus the shaft depth plus clearance. This ensures the key fits with slight interference or transition fit in the radial direction. The total of shaft depth plus hub depth should be slightly more than the key height to prevent the key from bottoming out in both slots simultaneously. Precise depth dimensions and tolerances are specified in the relevant standard and should be followed exactly for reliable torque transmission.

How do I machine a keyway accurately?

Keyways can be machined using several methods depending on the production volume and required accuracy. Broaching is the most common production method for internal hub keyways, producing excellent dimensional accuracy and surface finish in a single pass. Shaping or slotting machines cut keyways using a single-point tool in a reciprocating motion and are common in job shops. Milling with an end mill is used for shaft keyways, cutting either a sled-runner style (open-ended) or profile (closed-ended) keyway. Wire EDM is used for hardened materials or complex shapes. Regardless of method, the keyway must be located accurately relative to the shaft centerline and have the correct width tolerance for the specified fit class.

References

Reviewed by Daniel Agrici, Founder & Lead Developer ยท Editorial policy