Home / Articles / How to draw a keyway on a shaft and hub
How to draw · Basics

How to draw a keyway on a shaft and hub

7 min read · updated 12 Nov 2026

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.

b t1 d − t1 shaft section Ø d with keyway
b = slot width · t1 = keyway depth in the shaft · d − t1 = floor of the slot to the opposite shaft surface (the dimension you actually inspect)
Shaft Ø (over–incl, mm)Key b×hShaft t1Hub t2
6–82×21.21.0
8–103×31.81.4
10–124×42.51.8
12–175×53.02.3
17–226×63.52.8
22–308×74.03.3
30–3810×85.03.3
38–4412×85.03.3
44–5014×95.53.8
50–5816×106.04.3
Remember: t1 + t2 is slightly more than the key height h (about 0.2–0.3 mm), which leaves clearance over the back of the key — so the key drives on its sides, not its top.

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).

  1. Press C and draw the shaft circle, radius 15 at 0,0 (Ø30).
  2. 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,11 to 4,16 (let it poke just past the surface for now).
  3. 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.
  4. 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.

  1. Make the keyseat slightly shorter than the hub length — say 40 mm long, 8 mm wide.
  2. 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.
  3. 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 Online

The 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.

Tolerances: the slot width b is usually toleranced (for example N9 for a normal fit, or P9/JS9 depending on use), while the depths t1/t2 are normal. Dimension with d − t1 and d + t2 because those can be measured directly. The numbers here follow DIN 6885-1 and may differ slightly from other standards — always quote the key standard you actually use.

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.