Quick answer

For a standard spur gear, pitch diameter = teeth × module, outside diameter = (teeth + 2) × module and root diameter = (teeth − 2.5) × module. A module 2, 20-tooth gear is 40.000 mm at the pitch circle, 44.000 mm outside and 35.000 mm at the root, and runs with a 40-tooth gear at 60.000 mm centres. In inch gears, module = 25.4 ÷ diametral pitch: a 16 DP, 24-tooth gear is 1.500" pitch and 1.625" outside diameter.

Tables of common values

Module 2, 20° spur gears with no profile shift or backlash (mm)

Module 2, 20° spur gears with no profile shift or backlash (mm)
TeethPitch diameterOutside diameterRoot diameterSpan (W)Undercut
1224.00028.00019.0009.193 over 2 teethyes
1530.00034.00025.0009.277 over 2 teethyes
1734.00038.00029.0009.333 over 2 teethyes
1836.00040.00031.00015.265 over 3 teethno
2040.00044.00035.00015.321 over 3 teethno
2448.00052.00043.00015.433 over 3 teethno
2550.00054.00045.00015.461 over 3 teethno
3060.00064.00055.00021.505 over 4 teethno
4080.00084.00075.00027.690 over 5 teethno
50100.000104.00095.00033.874 over 6 teethno
60120.000124.000115.00040.058 over 7 teethno

Diametral pitch to module

Diametral pitch to module
Diametral pitchModuleCircular pitch
46.35000.7854 in
64.23330.5236 in
83.17500.3927 in
102.54000.3142 in
122.11670.2618 in
161.58750.1963 in
201.27000.1571 in
241.05830.1309 in
320.79370.0982 in
480.52920.0654 in

Source: Gear geometry to ISO 21771 with the ISO 53 basic rack (addendum 1.00 m, dedendum 1.25 m); span measurement formula from KHK's gear technical reference (section 5). Reviewed . Use the calculator below for any other size.

Gear Generator with DXF, STL and STEP Export

Draw a spur, helical, internal (ring) gear or rack the way a hob cuts it, check it against its mating gear, get the span and over-pins sizes to measure it, and download a DXF, SVG, STL or a real STEP solid. Published November 19, 2026.

Everything runs in your browser. Nothing you enter and no file you make is uploaded.

Gear

Backlash is the total play of the pair at the pitch circle; each gear's teeth are thinned by half of it. Profile shift moves the cutter out (+) or in (−) by x × module.

Bore, keyway and hub

0 = no bore or no hub. The keyway size is picked from the bore by the standard's table; the hub sits on one face.

Mating gear and measuring

A helical mate is made with the opposite hand (same hand for an internal gear). Same module, pressure angle and helix angle as the gear above.

Loading the gear engine…

Preview

Dimensions and Checks

    Download

    STEP is a closed solid in mm for CAD and CAM. STL is a watertight mesh for 3D printing. DXF (closed polylines with true arcs, in inches when Imperial is selected) and SVG (mm) are the flat profile for laser, waterjet or wire EDM.

    How the Gear Generator Works

    The tool cuts the gear the way a hob or rack cutter does. It moves the standard cutter profile (straight flanks with a rounded tip) past the gear blank while the blank turns, and keeps the shape the cutter leaves behind. That gives the true involute flank, the trochoidal root fillet and, on small gears, the undercut, rather than a drawing made of guessed arcs.

    The cutter is the ISO 53 basic rack: addendum 1.00 m, dedendum 1.25 m and a 0.38 m tip radius (smaller when it will not fit, for example at 25°). The flanks and fillets are then fitted with arcs within 0.001 mm for DXF and SVG, and with B-splines within 0.0005 mm for the STEP solid.

    The Method

    1. Basic sizes (ISO 21771)
    mt = mn ÷ cos β, tan αt = tan αn ÷ cos β
    d = z mt, db = d cos αt
    da = d + 2 mn(1 + x), df = d − 2 mn(1.25 − x)
    Spur gears have β = 0. Internal gears follow KHK: da = d − 2 m(1 − x), df = da + 4.5 m.
    2. Profile shift and centre distance
    inv αwt = 2 tan αn (x1 + x2) ÷ (z1 + z2) + inv αt
    a = (z1 + z2) mt cos αt ÷ (2 cos αwt)
    inv α = tan α − α. With the tip option ticked, both tips are shortened by (x1 + x2 − y) m so the root clearance stays 0.25 m (KHK Table 4.3).
    3. Contact ratio
    εα = [√(ra1² − rb1²) + √(ra2² − rb2²) − a sin αwt] ÷ (π mt cos αt)
    εβ = b sin β ÷ (π mn)
    The checks also find where the mating tip starts contact and compare it with the start of the true involute from the cutting simulation, so fillet interference is caught as well as undercut.
    4. Measuring (KHK section 5)
    W = mn cos αn [π(k − 0.5) + z inv αt] + 2 x mn sin αn
    inv φ = dp ÷ (mn z cos αn) − π ÷ (2z) + inv αt + 2 x tan αn ÷ z
    M = z mt cos αt ÷ cos φ + dp (even z)
    For odd teeth the first term is multiplied by cos(90° ÷ z). Backlash thinning is included in W, M and the chordal thickness.

    Module, Diametral Pitch and Pressure Angle

    Module (metric) is the pitch diameter in mm divided by the teeth. Diametral pitch (inch) is the other way up: teeth per inch of pitch diameter. They convert with module = 25.4 ÷ DP, so DP 16 is module 1.5875 and module 2 is DP 12.7. Gears only mesh if their module (or DP) and pressure angle match.

    Pressure angle is the slope of the flank at the pitch circle. 20° is the modern standard. 14.5° is found on older inch machines and change gears: quieter, but undercut starts below about 32 teeth. 25° makes stronger, stubbier teeth for heavy duty.

    Profile shift moves the cutter away from (+) or towards (−) the gear centre while keeping the same pitch circle. A positive shift stops undercut on small pinions and makes the teeth thicker at the root but more pointed at the tip; the tool warns when the tip gets thin. It also lets you hit an odd centre distance.

    How to Measure a Gear

    • Span (base tangent length, W): a disc micrometer across k teeth. It does not depend on the tip diameter or on run-out, so it is the easiest check of tooth thickness. On a helical gear the face must be wider than W sin βb plus about 3 mm.
    • Over pins or balls (M): two pins (spur) or balls (helical) in opposite tooth spaces and a micrometer over them. The "ideal" size touches the flank near the pitch circle; use the nearest pin you own and type it in, and the tool recalculates M.
    • Chordal thickness: a gear tooth vernier set to the chordal height from the tip. It depends on the tip diameter being right, so it is the least accurate of the three.

    Worked Examples

    1. Metric spur pair: module 2, 20°, 20 and 40 teeth, 0.1 mm backlash, 10 mm bore
    • Pitch diameter 2 × 20 = 40.000 mm, tip 44.000 mm, root 35.000 mm, base 37.588 mm. No undercut: the involute starts at 37.640 mm.
    • Centre distance (20 + 40) × 2 ÷ 2 = 60.000 mm; contact ratio 1.635.
    • Each gear is thinned 0.05 mm for the 0.1 mm backlash. Span over 3 teeth: W = 15.274 mm (15.321 mm with no backlash). Over two 3.449 mm pins: M = 44.642 mm.
    • The 10 mm bore gets a DIN 6885 3 × 3 key, hub groove depth t2 = 1.4 mm (bore + t2 = 11.4 mm).
    2. Inch helical pair: 16 DP (normal), 20°, 24 and 48 teeth, 20° helix, 1/2" face, 0.004" backlash
    • Transverse module 1.5875 ÷ cos 20° = 1.6894 mm, so the pitch diameter is 1.5963 in (40.545 mm) and the tip 1.7213 in.
    • Centre distance 2.3944 in. Contact ratio 1.536 plus overlap 0.871 = 2.407, which is why helical gears run quietly.
    • Lead 13.778 in; over the 1/2" face each tooth twists 13.06°. The mating 48-tooth gear is left hand.
    • Span over 4 teeth: W = 0.6691 in (it needs 0.333 in of face, so it fits). Over two 2.710 mm (0.1067 in) balls: M = 1.7377 in.

    Tips for Using the Results

    • 3D printing: printed teeth come out slightly fat. Add backlash (try a few tenths of a millimetre on module 1 to 2, then test-print one tooth pair), print the gear flat, and use STL. Positive profile shift on small pinions gives stronger roots.
    • CNC, laser and waterjet: use the DXF, which holds true arcs within 0.001 mm of the generated profile. A cutter cannot get into a root fillet smaller than its radius; check the root radius against your end mill or kerf.
    • Hobbing or shaping: cut to the span or over-pins size, not to the drawing. Those two numbers already include the backlash thinning.
    • STEP vs STL: STEP is an exact solid (planes, arcs as true circles, flanks as B-spline surfaces) that CAD and CAM can edit, dimension and machine. STL is a triangle mesh: fine for slicers, poor for CAM. For helical gears both are twisted correctly.
    • Mating: tick a mating gear to see contact ratio, interference and clearance before you cut. Keep the contact ratio over 1.2.

    Frequently Asked Questions

    Module = 25.4 ÷ diametral pitch. So 16 DP is module 1.5875, 20 DP is module 1.27 and 10 DP is module 2.54. They are close to, but not the same as, the nearest metric modules, so an inch gear will not run properly with a metric one.

    For a spur gear with no profile shift it is 2 ÷ sin²α: about 17.1 teeth at 20°, 31.9 at 14.5° and 11.2 at 25°. Below that the cutter eats into the bottom of the flank. A 12-tooth, 20° pinion needs a profile shift of at least 0.298 to avoid it.

    The backlash you enter is shared between the two gears, so each tooth is thinned by half of it at the pitch circle. On a spur gear the span W drops by that thinning × cos α: with 0.3 mm of backlash each gear is thinned 0.15 mm and W drops by 0.141 mm at 20°.

    Count the teeth, measure the outside diameter to estimate the module (outside diameter ÷ (teeth + 2) for an unshifted gear), then measure the span with a disc micrometer and compare it with the tool. A standard 20-tooth, module 2, 20° gear measures 15.321 mm over 3 teeth with no backlash; a smaller reading means thinner teeth.

    More than the standard one when the shifts add up to more than zero. A module 3 pair with 12 and 24 teeth and shifts of 0.6 and 0.36 runs at 56.500 mm instead of 54 mm, with a working pressure angle of 26.089°. Choose the mating gear in the tool and it calculates this for you.

    A real closed solid. Flat faces are planes, circles are exact arcs, and each flank is a B-spline surface fitted to the generated tooth within 0.0005 mm. Helical flanks are swept with the twist, staying within 0.001 mm of the true helix. Before it is offered, every solid type is read back in tests and its volume matches the drawing.

    Limits: external gears are generated with the ISO 53 rack (hob); internal gears are drawn with true involute flanks but a sharp root corner, because their fillet depends on the shaper cutter used. The pair checks assume the gears are mounted at the calculated centre distance and do not cover strength or tooth loads. Keyway sizes follow DIN 6885-1 and ANSI B17.1 (square keys) nominal values without fit tolerances; check them against your key. Formulas: ISO 21771 and the KHK Gear Technical Reference.

    Open-source credits: the gear engine is written in Rust and runs as WebAssembly. The STEP solid is built with truck (truck-modeling, truck-topology) and written by truck-stepio (Apache-2.0, RICOS); caps are triangulated with earcutr (ISC); serde and serde_json (MIT/Apache-2.0); wasm-bindgen (MIT/Apache-2.0); 3D preview by three.js (MIT).