Keyway Size Calculator
Determine standard keyway dimensions from shaft diameter using ANSI/DIN tables. Enter values for instant results with step-by-step formulas.
Calculator
Adjust values & calculateANSI Key Size Reference Table
Formula
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
Example 2: Keyway for Large Industrial Shaft
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.
Frequently Asked Questions
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