A cutter has width, but a drawing shows a line with no width. Cutter compensation bridges that gap: it lets you program the part outline exactly as drawn and have the control automatically keep the tool’s edge on that line. G41 and G42 choose which side of the line the tool rides.

What cutter compensation does

Without compensation, you would have to calculate the tool-center path yourself, offsetting every coordinate by the cutter radius. With it, you program the part contour straight from the print, and the control shifts the tool by its radius for you. That value lives in a D offset register, so changing one number adjusts for a worn or different-diameter tool without touching the program. The behavior is documented in the LinuxCNC compensation reference and the standard cutter radius compensation guides.

G41 left vs G42 right

The only thing G41 and G42 decide is which side of the programmed path the tool sits on. The trick is the reference frame: imagine standing behind the tool, looking in the direction it is moving.

CodeOffset sideLooking along the direction of travel
G41LeftTool rides to the left of the path
G42RightTool rides to the right of the path
G40NoneCompensation cancelled

The side you choose, combined with the spindle direction, also determines whether you are climb or conventional milling, which is why the choice is not arbitrary. The full address grammar for these codes is summarized on the Wikipedia G-code page.

The D register holds the radius

Like tool length offset, cutter comp reads a stored value. Here the D register holds the tool’s radius (or diameter on some controls). A typical engagement line looks like G01 G41 X10. Y10. D02 F150. That is the same idea as the H register in G43 tool length offset, just for radius instead of length. Keeping the three offsets straight matters:

OffsetCodeRegisterCorrects for
Work offsetG54offset tablePart location
Tool lengthG43HTool length in Z
Cutter radiusG41 / G42DTool radius in XY

The work offset (G54) and the two tool offsets are separate systems, and beginners crash by confusing them, which is why cutter comp belongs on every list of common G-codes for CNC beginners.

Engaging and cancelling safely

The most common cutter-comp crash is turning it on or off in the wrong move. The control needs a straight lead-in move to ramp the tool from the programmed path out to the offset path:

G00 X-10. Y-10.        (approach point, off the part)
G01 G41 X0 Y0 D02 F150 (engage comp on a linear lead-in)
... contour moves ...
G01 X-10. Y-10.        (lead-out, clear of the part)
G40                    (cancel comp on the lead-out)

The rules that keep this safe: command G41 or G42 on a linear (G00 or G01) move, make that move at least as long as the cutter radius, and never switch comp on or off during an arc. Cancel with G40 on a lead-out move that takes the tool clear of the finished surface. These are exactly the kinds of setup details you learn to spot when you read a CNC program.

Bottom line

G41 is compensation left, G42 is right, judged looking along the direction of travel. They offset the tool from the programmed path by the radius stored in the D register, so you can program the contour straight from the print. Engage on a linear lead-in, cancel with G40 on a lead-out, and never toggle comp during an arc.

Sources

Frequently asked questions

What is the difference between G41 and G42?

Both turn on cutter radius compensation, offsetting the tool from the programmed path by its radius. G41 offsets to the left of the path and G42 to the right, judged looking in the direction of travel. G40 cancels it.

What does the D value do in cutter compensation?

D points to the register holding the tool’s radius (or diameter). The control uses it to decide how far to shift the path, so changing D adjusts for tool wear or a different cutter without re-posting.

Why does cutter compensation need a lead-in move?

The control needs a straight move to ramp the tool out to the offset path, so G41 or G42 is commanded on a linear lead-in, not during an arc, and G40 is cancelled the same way on a lead-out.

What is the best way to remember G41 vs G42?

Drill the pair with active recall. A free app like G-Code Sprint shows G41 and G42 as side-by-side timed questions and repeats whichever one you keep missing.

G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.