Free · runs in your browser · no signup

Gear Generator (STL)

Pick the number of teeth and the module (tooth size), add a mating gear to set the ratio, and choose the shaft hole. The preview turns the pair at the real ratio, the table shows every diameter and the centre distance, and you download a watertight STL or 3MF ready to slice.

Loading the gear generator...
Demo with a sample file, recorded in this tool.

Gear generator examples

Gear generator STL preview: a 20-tooth and a 40-tooth spur gear at module 2 meshing at a 2:1 ratio, centre distance 60 mm
Spur pair, 20 and 40 teeth at module 2: a 2:1 ratio with the shafts 60 mm apart.
Herringbone gear pair with 15 and 45 teeth and a D-flat shaft hole, a 3:1 ratio, with the undercut warning shown
Herringbone, 15 and 45 teeth for 3:1, with a D-flat bore. 15 teeth triggers the undercut warning.
A 24-tooth helical gear model with a hex shaft hole and a raised hub, ready to download as an STL
A single 24-tooth helical gear with a hex bore and a hub, ready for STL download.

From gear model to STL file to printed part

This gear STL generator builds the gear model in your browser and saves it as a file a slicer can read straight away. Choose spur, helical or herringbone teeth, set the tooth count and the module, add a mating gear for the ratio, and pick a round, D-flat, keyway or hex shaft hole with an optional hub, as in the examples above. Each gear downloads as its own STL, or both come together in one 3MF, already sized in millimetres and with the backlash built into the teeth.

If you do not have a desktop slicer, the free 3MF to G-code slicer turns the 3MF into G-code in the browser. To trim a gear or add a part to it before printing, open the STL in the STL editor. Need a place to keep the finished gears and screws? The Gridfinity bin generator makes storage bins and baseplates on the 42 mm Gridfinity grid.

How to make a 3D printable gear

  1. 1

    Set the teeth and size

    Teeth count plus module in mm (or diametral pitch in inches). Both gears in a pair must use the same module and pressure angle.

  2. 2

    Add the mating gear

    Its teeth set the ratio: 20 and 40 teeth give 2:1. Mount the shafts at the centre distance shown.

  3. 3

    Fit the shaft

    Round, D-flat, keyway or hex hole, plus an optional hub. Printed holes come out small, so keep the 0.2 mm allowance.

  4. 4

    Download and print

    STL for each gear or one 3MF with both. Print each gear flat on the bed with 4 or more walls.

Need more than a gear?

Turn a photo or text into a printable 3D model with AI, with an STL download. The AI generators use credits; this gear tool does not.

More free tools: 3D print cost calculator · STL viewer

Gear formulas (module system)

These are the standard involute gear formulas the generator uses, with a worked example for 20 teeth at module 2 and a 20° pressure angle. The tooth flanks are true involutes from the base circle, with a rounded root fillet.

Pitch diameter dd = z × m (20 × 2 = 40 mm)
Outside diameter dada = d + 2m (44 mm)
Root diameter dfdf = d − 2.5m (35 mm, root clearance 0.25m)
Base circle dbdb = d × cos(pressure angle) (37.588 mm at 20°); the involute flank starts here
Circular pitch pp = π × m (6.283 mm tooth to tooth along the pitch circle)
Centre distance aa = m × (z1 + z2) / 2 (20 + 40 teeth: 60 mm)
Gear ratioz2 / z1 (40 / 20 = 2 : 1; the big gear turns at half the speed with twice the torque)
Diametral pitchm = 25.4 / DP (DP 12 = module 2.117 mm)

Tips for 3D printing gears

Common starting points for an FDM printer with a 0.4 mm nozzle; your printer may need small changes.

Module vs nozzleModule 1 or more prints cleanly with a 0.4 mm nozzle; module 1.5 to 2 is sturdier. Below about 0.8, use a 0.2 mm nozzle or a resin printer.
OrientationPrint each gear flat on the bed so the teeth are built from the side. Teeth printed standing up snap along the layer lines.
Layer height0.12 to 0.2 mm. Thinner layers give smoother flanks and quieter running.
Walls and infill4 to 6 walls so the teeth are solid plastic, then 40 to 60% infill for the body.
MaterialPLA is stiff and accurate for light loads. PETG is tougher and less brittle. Nylon wears best for gears that run a lot.
FitCheck the first print on its shafts. If it binds, add 0.05 to 0.1 mm of backlash; if a hole is tight, raise the allowance.
Elephant footA flared first layer makes the teeth rub. Turn on elephant-foot compensation or add a small chamfer by sanding.

Gear generator FAQ

Both describe tooth size. Module is the pitch diameter in millimetres divided by the number of teeth (module 2 with 20 teeth gives a 40 mm pitch circle). Diametral pitch is teeth per inch of pitch diameter, so a bigger DP means smaller teeth. Convert with module = 25.4 / DP. Two gears only mesh if they share the same module (or DP) and pressure angle.
20° is the modern standard and the right choice for almost every printed gear. 14.5° is an older standard that runs a little quieter but needs more teeth (about 32) to avoid undercut. 25° gives thicker, stronger roots and lets small gears (down to about 11 teeth) avoid undercut, at the cost of more load on the bearings.
Start with 0.15 to 0.2 mm total for PLA or PETG on a 0.4 mm nozzle; that is the default here. Well-tuned printers can go down to 0.1 mm; rough or over-extruding printers may need 0.3 mm. The tool thins each tooth by half the backlash, so the pair fits at the exact centre distance shown.
Lay the gear flat on the bed, use 4 to 6 walls so the teeth are solid, 40 to 60% infill, and a layer height of 0.12 to 0.2 mm. Use PETG or nylon for gears under load. A module of 1.5 or more and at least 17 teeth (at 20°) gives thicker teeth that do not snap.
A gear with fewer than about 17 teeth at 20° is undercut: the cutting rack would remove part of the tooth root, so the teeth get a thin neck. This generator models the cut, so the gear still meshes, but it is weaker. Use more teeth, or a 25° pressure angle, to remove the warning.
Helical teeth engage gradually, so they run smoother and quieter than spur gears, but they push sideways along the shaft. Herringbone gears are two mirrored helical halves, so the side forces cancel; they also print well because each half overhangs only a little. The mating gear is made with the opposite hand automatically.
At the centre distance shown under the preview: module × (teeth A + teeth B) / 2. For 20 and 40 teeth at module 2 that is 60 mm. The backlash is already built into the teeth, so do not add extra distance; if the pair binds, raise the backlash setting instead.
Yes. It runs entirely in your browser: nothing is uploaded, there is no signup and no watermark, and you can download as many STL and 3MF files as you like. The AI 3D generators linked below use credits; this tool does not.
Yes. Pick helical or herringbone instead of spur and the gear generator builds the twisted teeth into the STL. In a pair, the mating gear is cut with the opposite hand so the two mesh.
Yes. Download each gear as its own STL, or both together in one 3MF. The files are in millimetres and lie flat, ready to slice.
A round hole, a D-flat, a keyway or a hex hole, with an optional hub. Printed holes come out a little small, so the tool adds a 0.2 mm allowance by default.