How to draw a keyway on a shaft and hub
A keyway is the rectangular slot cut in a shaft and in a hub bore that holds a key, so the two turn together instead of slipping. Drawing it correctly means knowing the width b and the slot depth, both taken from the shaft size by standard. This guide gives the key-size table by shaft diameter (DIN 6885 / ISO 773), the shaft and hub depths, and exact coordinate steps for drawing it in DXCAD2D, all checked.
Key size comes from the shaft diameter
A parallel key has a rectangular section, width b and height h, chosen from the shaft diameter range — not picked freely. The slot depth has two values: t1, the depth in the shaft, and t2, the depth in the hub.
| Shaft Ø (over–incl, mm) | Key b×h | Shaft t1 | Hub t2 |
|---|---|---|---|
| 6–8 | 2×2 | 1.2 | 1.0 |
| 8–10 | 3×3 | 1.8 | 1.4 |
| 10–12 | 4×4 | 2.5 | 1.8 |
| 12–17 | 5×5 | 3.0 | 2.3 |
| 17–22 | 6×6 | 3.5 | 2.8 |
| 22–30 | 8×7 | 4.0 | 3.3 |
| 30–38 | 10×8 | 5.0 | 3.3 |
| 38–44 | 12×8 | 5.0 | 3.3 |
| 44–50 | 14×9 | 5.5 | 3.8 |
| 50–58 | 16×10 | 6.0 | 4.3 |
Draw the shaft end-view in DXCAD2D
Example: a Ø30 shaft (in the 22–30 range) takes an 8×7 key, shaft depth t1 = 4.0. Put the shaft centre at (0,0).
- Press C and draw the shaft circle, radius 15 at
0,0(Ø30). - The 8 mm slot is centred at the top, so it spans x = −4 to +4. The floor sits t1 = 4 below the top surface (y = 15), at y = 11. Press REC and draw a rectangle from
-4,11to4,16(let it poke just past the surface for now). - Press trim to cut the arc across the slot mouth and the rectangle sides that stick out past the circle, leaving a clean slot flush with the shaft surface.
- Check with M that the slot mouth is 8 wide and that floor-to-opposite-surface = d − t1 = 30 − 4 = 26.0 mm.
Draw the longitudinal keyseat (side view)
Along the shaft, the keyseat is a round-ended slot (obround) as long as the key and as wide as b.
- Make the keyseat slightly shorter than the hub length — say 40 mm long, 8 mm wide.
- Draw it as a round-ended slot as in the draw a slot / obround guide: two Ø8 circles 32 mm apart (40 − 8), join with tangent lines, then trim the excess.
- A round-ended seat (milled with an end mill) is preferred over a square-ended one — it is easier to cut and reduces stress concentration.
The longitudinal depth is the same t1 (4.0 mm for a Ø30 shaft), and you still dimension it as d − t1, because that can be measured with a micrometer across the shaft.
Try it right now — a free 2D CAD in your browser. Nothing to install, no sign-up.
Open DXCAD2D OnlineThe hub side (the bore)
The hub keyway is measured from the bore surface out into the hub material, depth t2. Example: a Ø30 bore with an 8×7 key gives t2 = 3.3.
The inspection value is d + t2 = 30 + 3.3 = 33.3 mm, measured from the keyway floor in the hub to the opposite bore wall. Press C for the Ø30 bore, press REC for an 8-wide slot projecting 3.3 mm out of the bore, then trim so the slot mouth meets the bore cleanly.
Frequently asked questions
What size key does a 30 mm shaft use
A Ø30 shaft falls in the 22–30 mm range and takes an 8×7 key, with shaft depth t1 = 4.0 and hub depth t2 = 3.3 (per DIN 6885-1).
How is keyway depth measured
On the shaft it is given as d − t1, the floor of the slot to the opposite shaft surface; in the hub as d + t2, the hub slot floor to the opposite bore wall. Both can be measured with a micrometer.
Round-ended or square-ended keyseat — what is the difference
A round-ended seat is milled with an end mill, easier to cut and lower stress. A square-ended seat needs a side-and-face cutter or shaping. Round-ended is the usual choice for general work.
What tolerance does the keyway width take
N9 is common for a normal fit. The key height and slot depth leave a little clearance over the back of the key, so the key drives on its sides, not its top.
Summary
Drawing a keyway starts with picking the key size b×h from the shaft diameter range in the table, then drawing a slot width b, depth t1 in the shaft and t2 in the hub. Dimension with d − t1 and d + t2 because those are measurable. In DXCAD2D draw the shaft/bore with C, the slot with REC, then trim it flush; draw the longitudinal seat as a round-ended slot. The table follows DIN 6885-1 — check it against the key standard you use before machining.