Enjoy 10% off your first order with code FIRST10 — max $500 discount. Start an Instant Quotehello@rivcut.com
Calculator

Keyway & Key Size Calculator

Calculate keyway width, depth, and key size for any shaft diameter per ANSI B17.1 and ISO 773 standards. Enter your shaft diameter and see recommended key dimensions instantly.

Shaft & Key Details

Results

Key Width
0.250 in
Key Height 0.250 in
Shaft Keyway Depth 0.125 in
Hub Keyway Depth 0.130 in
Key Length (recommended) 1.50 in
Keyway Width Tolerance +0.002 / -0.000
ANSI B17.1: Key size is determined by shaft diameter range.
Shaft depth ≈ H/2  •  Hub depth ≈ H/2 + clearance
Recommended key length = 1.5 × shaft diameter

Based on ANSI B17.1 / ISO 773 standards. Verify critical designs with your engineer.

Standard Keyway Sizes (ANSI B17.1)

The table below shows standard key and keyway dimensions for common shaft diameters per ANSI B17.1. All dimensions in inches.

Shaft Dia. Range Key Width Key Height Shaft Depth Hub Depth

How Keyway Sizing Works

Key size is standardized based on the shaft diameter. The key width equals approximately one-quarter of the shaft diameter for most sizes. The key sits half in the shaft and half in the hub, with slight differences in depth to ensure proper seating and clearance.

Key Fit Classes

ANSI B17.1 defines three fit classes for keys and keyways:

  • Class 1 (Tight Fit): Used when the key must not move. Interference fit between key and keyway. Common in high-torque applications.
  • Class 2 (Normal Fit): The most common fit. Allows easy assembly with minimal play. Suitable for most power transmission applications.
  • Class 3 (Loose Fit): Used when the key must slide axially. Common in adjustable mechanisms and light-duty applications.

Pro tip: For keyways in hardened shafts, wire EDM produces the cleanest slot with no burrs and excellent dimensional accuracy. For soft materials, CNC end milling is faster and more cost-effective.

Need keyways machined in your shafts?

Upload your CAD file for an instant quote. Free DFM review included with every order.

Upload CAD for Instant Quote

Frequently Asked Questions

A keyway is a slot machined into a shaft and a mating hub (gear, pulley, or coupling) that accepts a key. The key transmits torque between the shaft and hub, preventing relative rotation while allowing axial movement for assembly and disassembly.
Key size is determined by the shaft diameter. ANSI B17.1 provides a standard lookup table that maps shaft diameter ranges to recommended key widths and heights. For example, a 1-inch shaft uses a 1/4 x 1/4 inch key. This calculator automates that lookup.
The shaft keyway depth is the slot cut into the shaft, and the hub keyway depth is the slot cut into the bore of the hub. Together they must accommodate the full height of the key plus a small clearance. Typically the shaft keyway is deeper than the hub keyway.
For a Class 2 (normal) fit per ANSI B17.1, the keyway width tolerance is typically +0.002/-0.000 inches for the shaft slot and +0.003/-0.000 inches for the hub slot. Tighter Class 1 fits use +0.000/-0.000 to +0.001/-0.000 for interference fits.
Yes. Keyways are commonly machined using CNC milling (end mill plunge or slotting), broaching, or wire EDM. CNC milling is the most versatile method and can achieve tight tolerances on both shaft and hub keyways. RivCut machines keyways daily for shafts up to 4 inches in diameter.

Keyway Machining at RivCut

We machine keyways and keyseats daily for power transmission, robotics, and industrial equipment applications. From single prototypes to production batches.

Tight Tolerances

We hold ±0.0005″ on keyway widths and depths. Our CNC mills and EDM machines maintain consistent dimensions across production runs.

Multiple Methods

CNC end milling, slotting, and wire EDM. We pick the best method for your material, tolerance, and budget. EDM for hardened steels, milling for everything else.

Quality & Inspection

Every keyway is inspected with calibrated gauges and CMM when required. We verify width, depth, squareness, and surface finish to your spec.

Get a Keyway Quote

Get Free DFM Feedback on Your Keyway Design

Upload your CAD file or drawing and our engineers will review your keyway design for free. We check dimensions, tolerances, fit class, and manufacturability.

  • Key size verification for your shaft diameter
  • Tolerance and fit class recommendations
  • Best machining method for your material
  • Surface finish and edge break guidance
Upload CAD for Free DFM Review Learn About DFM

Accepts STEP, IGES, SolidWorks, Fusion 360 · Response within 24 hours · No obligation

Get Exact Pricing for Your Parts

Upload your CAD file and get instant AI pricing. Prototypes ship in as few as 3 days. No minimums required.

No minimums · 100% Made in USA · Never brokered · Ships anywhere in the US

Need a keyway machined?

Upload CAD for Instant Quote