G54.APP

G-code deep dive

G17, G18, G19: Plane Selection for Arcs and Cycles

G17G18G19

G17, G18 and G19 select the working plane — the pair of axes the control uses to interpret circular moves (G2/G3), cutter compensation, and canned cycles:

The third axis — the one perpendicular to the active plane — becomes the helix axis for spiral arcs and the drilling axis for canned cycles.

What the plane changes

An arc block is only two-dimensional: start point, end point, center. The plane tells the control which two of the three axes those live in. The same G2 block means a different curve under each plane:

G17 G2 X10 Z-5 I5 J0    ; arc in XY, helixing down in Z
G18 G2 X10 Z-5 I5 K0    ; arc in ZX — a completely different shape

Cutter compensation (G41/G42) offsets the tool within the active plane, and canned cycles plunge along its normal. That's three separate systems all quietly keyed to one modal setting — which is why the plane belongs in every program's preamble even though 3-axis mill work never changes it:

G21 G90 G17 G54    ; mm, absolute, XY plane, work offset 1
OperationLinuxCNCGRBLCentroidFANUCMach3Mach4Notes
Select XY plane G17 G17 G17 G17 G17 G17 Default. Arcs use I/J.
Select ZX plane G18 G18 G18 G18 G18 G18 Arcs use I/K.
Select YZ plane G19 G19 G19 G19 G19 G19 Arcs use J/K.

— means the control has no equivalent code. Full cross-control tables: the complete G-code & M-code reference.

When you actually switch planes

If none of those apply, the correct number of plane changes in your program is zero — one G17 at the top.

Common mistakes

Frequently asked questions

What is the default plane in G-code?

G17, the XY plane, on every control in the table. Milling programs almost never leave it — but stating G17 in the preamble protects you from whatever a previous program left active.

Which I/J/K words go with which plane?

Arc centers use the two axes of the active plane: G17 (XY) uses I and J, G18 (ZX) uses I and K, G19 (YZ) uses J and K. The unused offset word is either ignored or an error depending on the control.

When would I actually use G18 or G19?

Lathe work runs in G18 (ZX) by convention. On a mill, G18/G19 appear when cutting arcs on a vertical face — corner-rounding with the side of the tool — or when using canned cycles on a horizontal boring setup. For everyday 3-axis milling, G17 is the only plane you'll see.

Does plane selection affect drilling cycles?

Yes. Canned cycles like G81 drill along the axis perpendicular to the active plane — Z under G17. Run a cycle with G18 active and the 'drill axis' becomes Y, which is almost never what you meant on a mill.

See it, don't guess it

Paste a program into the free G54.APP viewer and watch these codes execute — toolpaths, stock removal, and machine state, live in your browser. Nothing is uploaded.

Open the G-code viewer