G-code reference

G17 G-Code: XY Plane Selection

XY Plane Selection — Selects the XY plane for circular interpolation, cutter compensation and canned cycles. This is the default plane on milling machines.

By cnccode · Updated
PropertyValue
CodeG17
FunctionXY Plane Selection
Modal group02
TypeModal — stays active until replaced by another code of the same group
Used onMilling machines
SyntaxG17

What does G17 do?

Selects the XY plane for circular interpolation, cutter compensation and canned cycles. This is the default plane on milling machines.

G17 is modal: once programmed it remains in effect for the following blocks until another code from modal group 02 replaces it or the control is reset.

Syntax and parameters

Format
G17

G17 example program

Example
G17 G21 G40 G49 G80 G90 (safe start block)

▶ Open this example in the G-code viewer

Tips and common mistakes

  • Include G17 in every safe start line in case a previous program left G18/G19 active.

Controller compatibility

G17 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.

Frequently asked questions

Is G17 modal?
Yes. G17 belongs to modal group 02 and stays active until another code of that group is programmed.
What does G17 mean in CNC?
G17 means XY Plane Selection. Selects the XY plane for circular interpolation, cutter compensation and canned cycles. This is the default plane on milling machines.
What is the difference between G17 and G18?
G17 is XY Plane Selection, while G18 is XZ Plane Selection. See the G18 page for its syntax and examples.
Can I use G17 on a lathe?
Usually not with the same meaning: G17 is documented here for milling machines. Check your control manual for the equivalent.