A rack and pinion calculator derives every dimension of a rotary-to-linear drive from the module and the pinion tooth count. The tool below gives the pinion's pitch, tip and root diameters together with the rack's pitch and tooth depth, and answers the question people actually come for: how far does the axis travel in one pinion revolution? Enter a pinion speed and you also get the linear feed rate; enter a rack length and you get its tooth count.
What is a rack and pinion drive?
A rack can be understood as a gear of infinite diameter. As the tooth count goes to infinity the pitch circle flattens into a straight line, and the involute tooth profile degenerates into a straight flank. That is why a rack tooth has straight sides, and why its flank angle equals the pressure angle of the pinion it will mesh with.
In practice this means the rack profile is identical to a standard cutting tool profile. A hob is essentially a rack; what it does while cutting a gear is imitate a rack rolling over the blank. For a rack and pinion to work together there is only one requirement: the same module and the same pressure angle.
How far does the pinion travel per revolution?
This is the most used output of the whole calculation and the answer is simple: the pinion rolls on its pitch circle, so one full turn covers exactly the circumference of that circle.
Travel per revolution = π · d = π · m · z
A module 2, 20 tooth pinion travels π · 2 · 20 = 125.66 mm per turn. Profile shift does not change this, because the rolling always happens on the pitch circle. Two more practical quantities follow: the travel per degree of rotation (πmz / 360) and the number of revolutions for a given distance (distance / πmz). With a known speed n the linear rate follows directly: v = π · m · z · n [mm/min].
That relationship also explains why rack and pinion is the drive of choice for long linear axes. The travel per turn is fixed by module and tooth count alone, while the stroke is limited only by the length of rack you install. On a ballscrew, whip and torsional wind-up become the limit as the stroke grows; with a rack you simply butt another length of rack against the first.
Rack and pinion formulas
| Quantity | Symbol | Formula |
|---|---|---|
| Pinion pitch diameter | d | z · m |
| Pinion base diameter | d_b | d · cos α |
| Pinion addendum | hₐ | m · (1 + x) |
| Whole depth | h | 2.25 · m |
| Pinion outside diameter | dₐ | d + 2hₐ |
| Pinion root diameter | d_f | dₐ − 2h |
| Rack pitch | p | π · m |
| Rack addendum | hₐ | 1.00 · m |
| Rack dedendum | h_f | 1.25 · m |
| Centre distance | a | z·m / 2 + H + x·m |
| Travel per revolution | — | π · m · z |
| Linear speed | v | π · m · z · n [mm/min] |
Symbols: m module, z pinion tooth count, α pressure angle, x profile shift coefficient, H the height from the rack's base face to its pitch line, n pinion speed. Lengths in millimetres, angles in degrees.
Rack tooth count and length
The tooth count of a rack is its length divided by the pitch: z = L / (π·m). At module 2 the pitch is 6.283 mm, so a 1000 mm rack carries 159 full teeth. The division rarely lands on a whole number and a partial tooth at the end is normal — it does not affect how the drive works.
On long axes racks are butted end to end, and the critical point of that joint is pitch continuity: the distance from the centre of the last tooth of one length to the centre of the first tooth of the next must also be exactly p = π·m. Otherwise the pinion takes an impact every time it crosses the joint. This is why quality racks are supplied with their ends machined to the pitch.
Undercut and profile shift
When the pinion tooth count is chosen too low, the cutter digs into the root and thins the tooth. This is undercut, and it both weakens the tooth and destroys useful involute next to the base circle. For an unshifted gear the limit is:
z_c ≥ 2 / sin²α — 18 teeth at a 20° pressure angle, 32 teeth at 14.5°.
In rack and pinion drives a small pinion is often wanted, because it gives finer positioning per motor revolution. The answer is profile shift: the minimum coefficient follows from x = 1 − (z/2)·sin²α. For a 12 tooth pinion at 20° that gives x = 0.298. The shift changes the pinion's outside diameter and the centre distance; the rack profile is unaffected, which is one of the practical conveniences of this pairing. The calculator works out the required coefficient whenever the tooth count falls below the limit.
Rack drives on CNC axes: speed, resolution and backlash
Rack and pinion drives show up on the long axes of large machines, on gantry routers, plasma and laser cutters, and on heavily loaded linear axes. Their advantages over a ballscrew are unlimited stroke and high traverse speeds; their weak points are backlash and positional resolution.
Resolution comes straight out of the relationship above. With a module 2, 20 tooth pinion, one degree of motor rotation moves the axis 0.349 mm. Direct-driven that is far too coarse, which is why rack axes almost always run through a reducer; the real resolution becomes πmz / (reduction ratio × motor steps per revolution). Reducing the module or the pinion tooth count also improves resolution, at the cost of load capacity — the design sits somewhere between those two extremes.
For backlash the common answer is a twin-pinion head, where two spring-loaded pinions are preloaded against the rack in opposite directions. Single-pinion drives instead use an adjustable eccentric hub to set the meshing force. Either way the centre distance has to be set correctly, and the calculated value of a is the starting point for that adjustment.
Helical racks
Where speed is high and noise matters, a helical rack is used. The teeth run at an angle along the rack, so contact builds up gradually and the drive runs quieter. The logic is unchanged; only the plane of measurement moves. The normal module mₙ is defined perpendicular to the tooth and the relations above hold with mₙ. On the pinion side helical gear geometry applies: the pitch diameter is d = z·mₙ / cos β, and the travel per revolution is π·d accordingly.
The price, as with any helical mesh, is thrust: F_a = F_u · tan β, carried by the pinion bearings and growing with the helix angle. For the full helical geometry see our helical gear calculator.
Frequently asked questions
How do you find the module of a rack?
Measure the pitch. Since the distance between corresponding points of two adjacent teeth is p = π·m, the module is m = p / π. For accuracy, measure across several teeth and divide: if ten tooth spaces measure 62.83 mm, the pitch is 6.283 mm and the module is 2. You can cross-check against the tooth depth, which should be 2.25·m.
What should the distance between rack and pinion be?
The pinion's pitch circle is set tangent to the rack's pitch line. The distance from the pinion axis to the rack's base face is a = z·m/2 + H + x·m, where H is the height from that base face to the pitch line — a dimension of the rack section itself. In practice a small clearance is left on top of this value.
How many teeth should the pinion have?
A smaller pinion gives finer positioning resolution; a larger one gives higher speed and a stronger tooth. If you go below the undercut limit of 18 teeth (at a 20° pressure angle) you have to apply a profile shift. In practice 15 to 25 teeth is the common range.
Does profile shift change the travel per revolution?
No. Travel per revolution is π·m·z and is independent of profile shift, because the rolling happens on the pitch circle in every case. The shift only changes the outside diameter, the tooth thickness and the centre distance.
The tool and formulas on this page are for the standard full-depth profile and are intended for education and preliminary design; verify the results before manufacturing. Related tools: spur gear calculator, helical gear calculator, gear module finder, and the combined gear formulas reference.